-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
EOL dependency on Maven Integration #5156
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jvz
approved these changes
Jan 8, 2021
Very nice to see this! |
oleg-nenashev
approved these changes
Jan 9, 2021
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.
Less code to maintain
timja
approved these changes
Jan 9, 2021
timja
added
the
ready-for-merge
The PR is ready to go, and it will be merged soon if there is no negative feedback
label
Jan 9, 2021
This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback. Thanks! |
res0nance
approved these changes
Jan 9, 2021
Long overdue. Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
internal
ready-for-merge
The PR is ready to go, and it will be merged soon if there is no negative feedback
skip-changelog
Should not be shown in the changelog
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
See jenkinsci/jenkins#5118 (comment) and jenkinsci/maven-plugin#155. The tests in Jenkins core depend on an old version of Maven Integration (i.e.,
maven-plugin
). This pollutes the dependency tree for the tests in Jenkins core, causingRequireUpperBoundDeps
issues and complicating maintenance.Problem
The tests in Jenkins core depend on an old version of
maven-plugin
for three reasons:hudson.maven.MavenModuleSet
orhudson.maven.MavenModuleSetBuild
. These classes were previously in Jenkins core before they were extracted tomaven-plugin
. However, the corresponding tests were never moved tomaven-plugin
. As a result, the tests are no longer in the same repository as the code under test.hudson.CustomPluginManagerTest
,hudson.CustomPluginManagerTest
, andhudson.util.FormFieldValidatorTest
load a checked-intasks.jpi
plugin using@WithPlugin("tasks.jpi")
, andtasks.jpi
depends onmaven-plugin
(which is currently provided viatest/pom.xml
). Note that the plugin page for Task Scanner reads: "The Task Scanner Plug-in reached end-of-life. All functionality has been integrated into the Warnings Next Generation Plugin." The dependency on the deprecated Task Scanner plugin is largely unnecessary, as is explained further below.jenkins.slaves.OldRemotingAgentTest
imports a class from a transitive dependency ofmaven-plugin
; namely,org.codehaus.plexus.util.FileUtils
. This is probably accidental; the programmer almost certainly meant to importorg.apache.commons.io.FileUtils
instead.Solution
To address these maintenance problems, we propose the following solution:
hudson.maven.MavenModuleSet
orhudson.maven.MavenModuleSetBuild
tomaven-plugin
.hudson.CustomPluginManagerTest
,hudson.CustomPluginManagerTest
, andhudson.util.FormFieldValidatorTest
such that they no longer depend on a checked-intasks.jpi
plugin (and therefore no longer depend, transitively, onmaven-plugin
). This eliminates two old and unmaintained plugins from the dependency tree, easing maintenance efforts.org.apache.commons.io.FileUtils
rather thanorg.codehaus.plexus.util.FileUtils
injenkins.slaves.OldRemotingAgentTest
, as was probably intended in the first place. This eliminates a dependency on Plexus (and therefore, onmaven-plugin
which provides Plexus).Implementation
We implement these changes with four separate commits:
MavenModuleSet
orMavenModuleSetBuild
tomaven-plugin
in Move tests that depend on MavenModuleSet and MavenModuleSetBuild from Jenkins core to Maven Integration maven-plugin#155. A handful of these tests are already disabled and have been for several years; we do not make any effort to revive these or move them. Rather we only move the tests that are still running regularly. Then we delete any references toMavenModuleSet
orMavenModuleSetBuild
from the tests in Jenkins core.tasks.jpi
from the source tree and remove any references to it. The reference inhudson.util.FormFieldValidatorTest
appears to be unused; the test passes without it and I cannot see any reason why it would be needed for the test case. The remaining references inhudson.CustomPluginManagerTest
andhudson.PluginManagerTest
are for test cases that require any JPI, nottasks.jpi
in particular. We replace these with references tohtmlpublisher.jpi
, another JPI file that is already checked in. This should serve the same purpose. The only exception ishudson.PluginManagerTest
, which deals withtasks.jpi
specifically in order to confirm that it has an optional dependency onmaven-plugin
. This seems pointless, and the test has this comment: "This actually doesn't really test what we need, though." In our judgment this test is not valuable. We deleted this pointless test.jenkins.slaves.OldRemotingAgentTest
.maven-plugin
fromtest/pom.xml
. This cascades into further deletion of somerequireUpperBoundDeps
exclusions, which were added specifically to deal withmaven-plugin
.