Fix dependencies with Maven Enforcer Plug-in #139
Merged
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.
This PR introduces the Maven Enforcer Plugin to the
verify
phase of the project build lifecycle.And it utilises a plug-in that makes sure we do not use transitive dependencies. It means that if we have dependencies like
commons-collections
(which includescommons-lang
version 2.x) andcommons-lang3
, in case we useStringUtils
fromcommons-lang
2.x, the build will fail. Ascommons-lang
2.x is a transitive dependency.When running
mvn verify -DskipTests=true
, I initially got the following errors:These 53 classes are currently used in the project, but they are available through transitive dependencies. In most cases it will build fine, but we could be either using the wrong class (the example above, for StringUtils from
commons-lang
2.x actually exists in the project) or have a problem later on, when we added another version with a different transitive dependency version.The PR also includes fixes for all the 53 cases. For each case, I simply looked in Eclipse which
jar
contained the class, then looked up in http://search.maven.org. Had a bit of problem withjai_core
classes, as thejar
doesn't seem to be available in Maven Central, but only pom and javadoc.Also updated Commons Lang, Jena, and LogBack, that are dependencies that I use in other projects and am a bit familiar with.
Cheers
Bruno