Jelly Framework used in Jenkins

1.8k views Asked by At

Please let me know how Jelly is used in Jenkins. Any docs explaining the architecture of GUI in Jenkins will be helpful.

Any tutorial explaining the high level code details or any pointers in the region

2

There are 2 answers

0
KeepCalmAndCarryOn On

You will need maven and can install it from the command line

$ mvn -U org.jenkins-ci.tools:maven-hpi-plugin:create

This will ask you a few questions, like the groupId (the Maven jargon for the package name) and the artifactId (the Maven jargon for your project name), then create a skeleton plugin from which you can start with. Make sure you can build this:

$ cd newly-created-directory
$ mvn package

This is documented here https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial

This ships with lots of UI examples to look at. I would advise using either IntelliJ or eclipse as they have tools to integrate into the maven build process

0
Jocce Nilsson On

The starting point to Jenkins development is the Extend Jenkins page. On this page, there is a number of sub pages that discuss different aspects of Jelly, see under "Writing Views (Jelly/Groovy)" in the menu.

This along with the tutorials at the bottom of the Plugin tutorial page is a good start.

Some basics: All Jelly files are connected to a corresponding class based on the path of the Jelly file:

src/main/java/com/example/MyClass.java
src/main/resources/com/example/MyClass/config.jelly

There are a number of different names for different purposes on the jelly files, e.g.: portlet.jelly, index.jelly, global.jelly, config.jelly. If you are writing a job/build plugin, global.jelly corresponds to system configuration while for job configuration you will use config.jelly.

Happy coding!