How to build my plugin against a Jenkins version and load the jetty server in another version?

26 views
Skip to first unread message

Rafael Rezende

unread,
May 24, 2016, 10:37:17 AM5/24/16
to Jenkins Developers
Let's say my parent pom is 1.580.1 (or 2.9 with jenkins.version=1.580.1). When I run mvn hpi:run, a Jenkins instance with that version will be started with my plugin installed.

Is there any parameter to start my dev Jenkins instance with a different version of the parent pom? For example, I would like to see how that version behaves with Jenkins 2.6...

Robert Sandell

unread,
May 24, 2016, 11:04:03 AM5/24/16
to jenkin...@googlegroups.com
If you use the 2.x line of the plugin parent pom (not to be confused by Jenkins core 2.x) then you can just run mvn hpi:run -Djenkins.version=2.6

If you are going all the way from 1.580 with java.level=6 you might need to add -Djava.level=7 for some dependency checks might fail.

/B

On Tue, May 24, 2016 at 4:37 PM, Rafael Rezende <rafael...@gmail.com> wrote:
Let's say my parent pom is 1.580.1 (or 2.9 with jenkins.version=1.580.1). When I run mvn hpi:run, a Jenkins instance with that version will be started with my plugin installed.

Is there any parameter to start my dev Jenkins instance with a different version of the parent pom? For example, I would like to see how that version behaves with Jenkins 2.6...

--
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 jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/dc4ca7fc-0555-4e74-9971-ab3483854273%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Robert Sandell
Software Engineer
CloudBees Inc.

Rafael Rezende

unread,
May 24, 2016, 11:20:37 AM5/24/16
to Jenkins Developers
If I understood well, this will also build my plugin against the Jenkins core 2.6, isn't?

from plugin-2.9.pom
<dependency>
   
<groupId>org.jenkins-ci.main</groupId>
   
<artifactId>jenkins-core</artifactId>
   
<version>${jenkins.version}</version>
</dependency>

What I'm trying to do is just to build it with the minimum version I need (1.580.1) and test it against a Jenkins instance v2.6.
I could do that by packaging my plugin with dependency to 1.580.1, then installing it in a standalone Jenkins v2.6. But I would like to avoid the pain of packaging, reinstalling the plugin, restarting the instance etc...

Stephen Connolly

unread,
May 24, 2016, 12:55:48 PM5/24/16
to jenkin...@googlegroups.com
Well.... hpi:run will only recompile changed files so if you do

mvn clean install
mvn hpi:run -Djenkins.version=2.6

because the .java files have not changed, the .class files should not be changed and then there should be no recompile... but YMMV (it will still perhaps to localization recompile, etc)

Reply all
Reply to author
Forward
0 new messages