Correct jelly control file location

4 views
Skip to first unread message

Greg Allen

unread,
Apr 24, 2018, 1:53:39 PM4/24/18
to Jenkins Developers
I have created my own jelly control that I have placed in my maven
project at src/main/resources/lib/form/mycontrol.jelly. I then reference
this tag in my jelly file like this:

<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler"
xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson"
xmlns:f="/lib/form">
      <f:mycontrol title="title" field="field">
        <f:expandableTextbox/>
      </f:mycontrol>
</j:jelly>

This all seems to work find and my control is rendered correctly when I
run with "mvn hpi:run".

However, when I try to run a test using "mvn:test" the control is not
rendered correctly. In the testing environment it doesn't seem that
Jenkins can find my mycontrol.jelly file.

I assume there is some sort of search path that needs to be set up for
testing. What am I missing?

Thanks,

-- Greg

Jesse Glick

unread,
Apr 24, 2018, 2:11:43 PM4/24/18
to Jenkins Dev
On Tue, Apr 24, 2018 at 1:53 PM, Greg Allen <gal...@redhat.com> wrote:
> I have created my own jelly control that I have placed in my maven project
> at src/main/resources/lib/form/mycontrol.jelly.

The `/lib/form` namespace is reserved by Jenkins core and you may not
use it for your own controls.

Pick a different package structure corresponding to your plugin’s Java
package scheme. To register it as a tag library, you need merely
create an empty file (or contents irrelevant) `taglib` in the same
directory:

src/main/resources/io/jenkins/plugins/mystuff/form/taglib
Reply all
Reply to author
Forward
0 new messages