Correct jelly control file location

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Correct jelly control file location

Greg Allen
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

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/2d91a9d9-98a0-2b59-f15b-aa240d44dc37%40redhat.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Correct jelly control file location

Jesse Glick-4
On Tue, Apr 24, 2018 at 1:53 PM, Greg Allen <[hidden email]> 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

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr1UJzbwDzDfHJ0PWvHvwjDarBraYFNbSrcLuU0QSK3JMQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.