Jenkins version - minimum dependency in pom vs. test harness required dependency

87 views
Skip to first unread message

Ullrich Hafner

unread,
Apr 23, 2019, 5:47:03 AM4/23/19
to Jenkins Developers
Is it possible, to specify a different minimum Jenkins version in a plugin for the runtime and the tests?

Currently my plugin is compatible with Jenkins 2.89.1 (from an API point of view).

However, due to some dependencies in my integration tests (declarative pipeline, etc.) the tests that use Jenkins test harness and the injected tests fail since they want a dependency to a Jenkins version >= 2.150.1.
I tried to use -Djenkins.version=2.150.1 when starting the test but this seems not to work.



Mark Waite

unread,
Apr 23, 2019, 7:25:01 AM4/23/19
to jenkinsci-dev
Passing -Djenkins.version=2.164.1 is the technique that many of the plugins now use to test Java 8 and Java 11 compilation and test.  Can you further describe how it fails when you use that argument to maven?  It may be a failure that is familiar to those working on Java 11.

--
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/610AEA80-3D9F-454C-B363-BBA35FA66DDB%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


--
Thanks!
Mark Waite

Ullrich Hafner

unread,
Apr 23, 2019, 7:55:26 AM4/23/19
to Jenkins Developers
Actually I used it as parameter in my Runner configuration in IntelliJ. 
Using it on the command line in maven seems to work indeed! Thanks!

Jesse Glick

unread,
Apr 23, 2019, 8:32:42 AM4/23/19
to Jenkins Dev
On Tue, Apr 23, 2019 at 5:47 AM Ullrich Hafner <ullrich...@gmail.com> wrote:
> Is it possible, to specify a different minimum Jenkins version in a plugin for the runtime and the tests?

Unfortunately it is not.

> Currently my plugin is compatible with Jenkins 2.89.1 (from an API point of view).
>
> However, due to some dependencies in my integration tests (declarative pipeline, etc.) the tests that use Jenkins test harness and the injected tests fail since they want a dependency to a Jenkins version >= 2.150.1.

Then you need to choose. Either update your `jenkins.version` to
something less ancient, which is what I recommend; or adjust your
integration tests to use older versions of dependencies which are
still compatible with 2.89.1.

Ullrich Hafner

unread,
May 3, 2019, 7:26:26 AM5/3/19
to Jenkins Developers
While the tests now work in maven they still not work in IntelliJ. Seems that the option -Djenkins.version is working in maven but not in IntelliJ. When I debug the WAR extraction in IntelliJ (class WarExploder) then it always extracts the version that is used in the pom as dependency. The property jenkins.version is never read here (or I just overlooked it). When I run the tests in maven then WarExploder.class.getResource(„/winstone.jar“) returns the correct war file that has been specified in jenkins.version. In IntelliJ null is returned here…

Any ideas? Or is this exactly the problem that Jesse already mentioned?
> --
> 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/CANfRfr3LprLZg%2B5qUpsLEoR%3DVdVs4vYsJzDO7wkGv7s8ey7XsQ%40mail.gmail.com.

Jesse Glick

unread,
May 3, 2019, 8:38:30 AM5/3/19
to Jenkins Dev
Is this time well spent, compared to just saying that anyone who wants
_new features_ from your plugin had also better be running a recent
LTS of core (or newer weekly)—not even necessarily the line with the
current security patches? Also see the discussion here:

https://github.com/jenkinsci/plugin-pom/pull/167

If and when you have some critical, small, safe fixes that you would
want to backport even for users of obsolete core lines, this is not at
all difficult:

https://gist.github.com/jglick/86a30894446ed38f918050c1180483e2

Ullrich Hafner

unread,
May 3, 2019, 10:26:04 AM5/3/19
to Jenkins Developers
Since the dependency is only required to make the test framework happy, I thought it is worth to see why it is not working as expected (since it works in maven I assumed that it is just a quick fix).

But you are right, for me as developer it is easier to increase the jenkins version (as this is already required by a different PR which increased the version due to an actual required new feature and not a test dependency). This also would help to enforce users to regularly upgrade their Jenkins instance.
> --
> 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/CANfRfr3c_C%3D18GPiZUzwAmCfyc4Xs7vTRMARLO-5G6rYHK6t7Q%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages