Enforcer confusion and problems

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Enforcer confusion and problems

Mike Caspar
Hi there,
This is working ...   

  <parent>
        <groupId>org.jenkins-ci.plugins</groupId>
        <artifactId>plugin</artifactId>
        <version>2.30</version>
        <relativePath />
    </parent>

<jenkins.version>2.73.3</jenkins.version>

.............
In the project I maintain, there is an external dependency on a plugin that uses org.apache.commons.lang3

When I try and switch to plugin version 2.31 or above, I get an enforcer error. 
When I research, it appears that I need to Exclude org.apache.commons   lang3 from the <dependency>

When I do this, enforcer passes, clean, compile all work but when the hpi:run actually tries and runs the code (during my manual test session), I get an exception that the class org.apache.commons.lang3.ArrayUtil cannot be loaded.  (sorrry.. the case me be off on ArrayUtil).

When I use 2.37 as the version plugin, I get the following (which seems to imply that the test harness has a similar problem).

I have no control over the pom of the dependency.


Require upper bound dependencies error for org.apache.commons:commons-lang3:3.1 paths to dependency are:
+-org.jenkins-ci.plugins:ironmq-notifier:1.0.19-SNAPSHOT
  +-io.iron.ironmq:ironmq:3.0.4
    +-org.apache.commons:commons-lang3:3.1
and
+-org.jenkins-ci.plugins:ironmq-notifier:1.0.19-SNAPSHOT
  +-org.jenkins-ci.main:jenkins-test-harness:2.31
    +-org.jenkins-ci.main:jenkins-test-harness-htmlunit:2.18-1
      +-org.apache.commons:commons-lang3:3.4


Any ideas or a direction (or samples) to go to next?

Thanks

--
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/9c97b945-441a-4ae8-93bc-f2435fe7fd66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Enforcer confusion and problems

Daniel Beck

> On 6. Jan 2018, at 03:20, Mike Caspar <[hidden email]> wrote:
>
> Any ideas or a direction (or samples) to go to next?
>

Define an explicit dependency on the higher of the two versions.

--
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/C6B18EE5-4034-4969-A1AF-28384394AFD5%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Enforcer confusion and problems

Mike Caspar-2
Thank you.

Adding the Maven dependency did the trick.

Is there a place where this is documented?

Would the stapler rules be documented somewhere?

I would be pleased to start a page called Maven Enforcer FAQs and do my
best to put in an explanation.  Or, is there a better approach? I'd be
glad to do something to help out the next person who is stuck.

Mike


On 2018-01-06 01:33 AM, Daniel Beck wrote:
>> On 6. Jan 2018, at 03:20, Mike Caspar <[hidden email]> wrote:
>>
>> Any ideas or a direction (or samples) to go to next?
>>
> Define an explicit dependency on the higher of the two versions.
>

--
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/b1839845-1d63-2b1c-033f-864119b26d58%40caspar.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Enforcer confusion and problems

Ulli Hafner

>
> I would be pleased to start a page called Maven Enforcer FAQs and do my best to put in an explanation.

I think starting a wiki page would be a good idea, this is something that happens quite often now. It would be good if we can provide some patterns on how to solve such a problem. E.g., what should one do if there is such an error in two depending plugins (or libraries) (and not in your own code)? Define an exclusion in the dependencies? Or add an exclusion in requireUpperBoundDeps of the enforcer?

> Or, is there a better approach? I'd be glad to do something to help out the next person who is stuck.
>
> Mike
>
>
> On 2018-01-06 01:33 AM, Daniel Beck wrote:
>>> On 6. Jan 2018, at 03:20, Mike Caspar <[hidden email]> wrote:
>>>
>>> Any ideas or a direction (or samples) to go to next?
>>>
>> Define an explicit dependency on the higher of the two versions.
>>
>
> --
> 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/b1839845-1d63-2b1c-033f-864119b26d58%40caspar.com.
> For more options, visit https://groups.google.com/d/optout.
--
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/85BF84BC-A9F7-4AAF-9D95-2D53121FCC67%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

signature.asc (540 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Enforcer confusion and problems

Daniel Beck
In reply to this post by Mike Caspar-2

> On 6. Jan 2018, at 17:04, Mike Caspar <[hidden email]> wrote:
>
> Is there a place where this is documented?

First Google hit for me was https://maven.apache.org/enforcer/enforcer-rules/requireUpperBoundDeps.html which explains it. It's not a Jenkins specific behavior.

Documentation on how to adapt plugins to newer parent POM releases (and core releases) is on my todo list, but help, as always, is appreciated.

--
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/40C390DB-C6B4-4B7C-902D-0E9A3A75B609%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Enforcer confusion and problems

Mike Caspar-2
Daniel,

How can I help to the best of my ability?

I'd like to start by trying to add this problem as well as the message
about java.level in properties..

Combined, these two problems burned about 8 hours of my time just trying
to go to the latest LTS and plugin version. (I don't do java coding for
my day job).

Would it be helpful for me to give it a try on the WIKI?

Mike


On 2018-01-06 08:37 AM, Daniel Beck wrote:
>> On 6. Jan 2018, at 17:04, Mike Caspar <[hidden email]> wrote:
>>
>> Is there a place where this is documented?
> First Google hit for me was https://maven.apache.org/enforcer/enforcer-rules/requireUpperBoundDeps.html which explains it. It's not a Jenkins specific behavior.
>
> Documentation on how to adapt plugins to newer parent POM releases (and core releases) is on my todo list, but help, as always, is appreciated.
>

--
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/e1b758f0-7be9-b69c-f95a-00ba5f73c8f2%40caspar.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Enforcer confusion and problems

Daniel Beck

> On 6. Jan 2018, at 17:46, Mike Caspar <[hidden email]> wrote:
>
> How can I help to the best of my ability?
>
> I'd like to start by trying to add this problem as well as the message about java.level in properties..
>
> Combined, these two problems burned about 8 hours of my time just trying to go to the latest LTS and plugin version. (I don't do java coding for my day job).
>
> Would it be helpful for me to give it a try on the WIKI?

Wiki works, but longer term for discoverability the content should probably be integrated to https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md (which explains what changes, but not how to adapt existing plugins to work with it) or into a new chapter 'Plugin Modernization' (or similar) on https://jenkins.io/doc/developer/ (which is what I plan to do, as a hub for plugin developers to read up on what recently changed in Jenkins, or tooling, and how to adapt).

--
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/91F0511F-7158-4070-91CA-75FC2DF06C96%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.