-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define slf4jVersion unconditionally #262
Conversation
proski
commented
Dec 1, 2019
I don't know if it's the right solution, but it fixes an issue with Stash Pull Request Builder plugin, which can use plugin-pom 3.53 but not 3.54. The plugin has a dependency:
That's how it fails to build:
Note that a reference to an invalid variable would fail much earlier. I can remove the dependency, but I believe it's important to declare dependencies of the code. The code uses I can use Moving the |
it should not have a version defined - it is in Now the flatten-maven plugin has a bug - that can not handle this case. whilst I generally agree that you should declare what you use, the way that the current Jenkins pom works is completely broken in this regard. The way to correctly handle this is to use the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temporary workaround is ok, but comment needs to be fixed. we do not want to encourage plugins to use this.
pom.xml
Outdated
@@ -77,7 +77,10 @@ | |||
<spotbugs.threshold>${findbugs.threshold}</spotbugs.threshold> | |||
<!-- Defines a SpotBugs effort. Use "Max" to maximize the scan depth --> | |||
<spotbugs.effort>${findbugs.effort}</spotbugs.effort> | |||
|
|||
|
|||
<!-- Version of slf4j, only used when BOM is not used, but needs to be at the top level to be usable by plugins --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is not supposed to be usable by plugins, so this comment is wrong.
the dependencies for slf4j are in dependencyManagement
or the bom
so you should omit the version entirely.
sadly the flatten maven plugin can not cope with this, but the comment should really be addressed that this should not be used and is only a workaround for plugins producing incrementals and also declaring a dependency on and slf4j artifact.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I've rephrased the comment. I hope I got it right.
I don't insist on this change. Stash Pull Request Builder plugin can use plugin-pom 3.53 for now and switch to BOM once it becomes more reasonable to require a newer Jenkins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Speaking of the newer Jenkins - README.md
is this repository implies that Jenkins 2.195 should be required, which is newer than the latest stable Jenkins version - way too new for plugin developers.
However, the bom
package provides retroactive dependencies for stable branches starting with 2.138.x and its README.md
recommends setting jenkins.version
to 2.138.4, which is entirely reasonable.
bitbucket-branch-source-plugin
has already switched to BOM and it requires Jenkins 2.138.4. I'm going to explore a similar change in Stash Pull Request Builder.
I think README.md
in this repository should be clarified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jenkins-bom and plugin-bom is not the same @proski
This is mostly for aligning plugins: https://github.com/jenkinsci/bom
This is jenkins bom: https://github.com/jenkinsci/jenkins/blob/master/bom/pom.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!!Do not use the BOM profile!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtnord too late? plenty of plugins use it.
https://github.com/search?q=org%3Ajenkinsci+%22io.jenkins.tools.bom%22+extension%3Axml&type=Code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong bom I'm talking about the profile so more bom confusion :)
Add a comment that slf4jVersion is only used in the profile that doesn't use Jenkins BOM. Conditionally defined slf4jVersion cannot be used in plugins. Even though ${slf4jVersion} expands during "validate" goal, it fails at the "flatten" goal.
90e865c
to
3cdc850
Compare
should be fixed in #269 |
Closing it after https://github.com/jenkinsci/plugin-pom/releases/tag/plugin-4.0-beta-1 . BOM should address the root cause issue. Thanks @proski for your pull request anyway! |