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.
Problem
pom.xml
currently has theenforcer.skip
property set totrue
. This completely disables the Enforcer checks, which hides useful warnings. Unfortunately, re-enabling the Enforcer checks reveals thisRequireUpperBoundDeps
warning:Evaluation
Normally, the solution to such conflicts is to add a
dependencyManagement
section explicitly selecting the highest version of the dependency that is required. Unfortunately, that solution isn't quite feasible for Jenkins's Guava dependency, which has a complicated history due to the way Jenkins does class loading. Bumping Guava in the test harness to 16.0.1 would represent significant risk, since Jenkins core actually delivers Guava 11.0.1 today. The test harness currently delivers a version matching Jenkins core, as can be seen by this output:To avoid the risk of any possible regressions, we want the version of Guava used in the test harness to match the version of Guava used in Jenkins core in production. However, selecting that version won't satisfy the
RequireUpperBoundDeps
check.Solution
The long-term fix is far beyond the realm of a single PR and is tracked in JENKINS-36779. This PR merely adds an exclusion for Guava to the
RequireUpperBoundDeps
check in the test harness. This allows the remaining Enforcer checks to run, which is a net improvement from the current code (where all Enforcer checks are disabled).