How to override maven-core-2.0.7-uber.jar?

一个人想着一个人 提交于 2019-12-11 17:17:11

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/1716726/how-to-override-maven-core-2-0-7-uber-jar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!