-
Notifications
You must be signed in to change notification settings - Fork 87
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
Add validate-hpi
which checks core version for dependencies before packaging
#191
Conversation
abadeca
to
f0dae04
Compare
f0dae04
to
67c5a27
Compare
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.
would be nice to also see a test that show this doesn't break exact version matches
e.g. 2.222.4 is fine in this case.
* Add a test with success case (exact version match) * Define jenkins.version in the pom for clarity and safeguard against parent pom bump
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.
Thanks
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.
Currently ValidateMojo
might be used for non-HPI packaging. With this change HPI packaging will be required IIUC the implementation. Please correct me if I am wrong. If not, I suggest creating a new validate-hpi
mojo for the new checks.
src/main/java/org/jenkinsci/maven/plugins/hpi/ValidateMojo.java
Outdated
Show resolved
Hide resolved
MavenArtifact maxCoreVersionArtifact = null; | ||
VersionNumber maxCoreVersion = new VersionNumber("0"); | ||
|
||
for (MavenArtifact artifact : Sets.union(getProjectArtfacts(), getDirectDependencyArtfacts())) { |
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.
Not a blocker: Note that it does not take transitive dependencies into account. All plugins in the dependency tree will have to adopt the new Maven HPI Plugin version to prevent from errors in transitive deps. Related to #195 which also needs a full plugin dependency tree resolution.
src/main/java/org/jenkinsci/maven/plugins/hpi/ValidateMojo.java
Outdated
Show resolved
Hide resolved
Note that you might expect this to be done by |
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.
LGTM. There could be a more fancy documentation, but it should be good enough for adoption in parent POMs.
validate-hpi
which checks core version for dependencies before packaging
https://github.com/jenkinsci/maven-hpi-plugin/releases/tag/maven-hpi-plugin-3.16 is out @Vlatombe . I'd guess we need to enable the new mojo by default in Jenkins Plugin POM. |
@oleg-nenashev Should be automatic since I added it to the |
right, let's see. An integration test would be useful in Plugin POM, just in case |
Perhaps, though as noted in #191 (comment), a misconfigured plugin build will already fail—it will just take a bit longer. FWIW I keep a custom shortcut in NetBeans to help test mvn clean test -Dtest=InjectedTest |
Adds check that the required core version is higher or equal to the core version required by plugin dependencies.
This is indirectly done by the injected tests already but it requires to run the tests and it is much longer.