
Question:
My problem is that I am trying to use a specific JTidy version with maven (v8.0 or something). Everything works fine during compile time, but at runtime maven overrides the JTidy in the pom.xml with its own implementation in maven-core-2.0.7-uber.jar
.
See also <a href="https://stackoverflow.com/questions/1716290/how-to-find-out-what-jar-file-provides-a-class-during-runtime-using-maven" rel="nofollow">previous question</a>.
What can be done? My application compiles fine but fails at runtime because the classloader loads the file from maven-core-2.0.7-uber.jar
instead of the one given in pom.xml
. Is there some way to force it at runtime or preferably at compile time?
Setting the correct version in a <dependencyManagement>
element should override the default.
A workaround is to replace the JTidy JAR in your local copy of the maven repository with the version you want.
I also suggest to try Maven 2.2. They changed the artifact lookup rules, that might fix your issue. And have a look at the effective POM (mvn help:effective-pom
) to see which rules apply for plugin lookup.