tags:

views:

69

answers:

1

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 previous question.

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?

A: 

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.

Aaron Digulla
I have the correct version in <pre>dependencyManagement</pre> but <pre>Maven completely ignores it</pre> because it has its own Tidy without any dependency management. I will try newer Maven, hope it does not break anything.
Martin
You mean the class files for JTidy are inside of maven-core-2.0.7-ueber.jar?
Aaron Digulla
New maven worked. Phew.
Martin
Yes.. inside uber 2.0.8 too.
Martin