Warning maven relocated xml-apis to 1.0.b
来源:互联网 发布:博雅软件怎么用 编辑:程序博客网 时间:2024/06/05 11:06
maven 依赖
在maven项目中,一些基础的jar包被引用多次是很常见的事情。maven选择jar的版本是基于
- 依赖深度浅的 比如C项目依赖xml.jar。C依赖的B也引入了xml.jar。那么优先选择C中指定的
- 如果依赖深度一样,第一次依赖的jar被选中
实际项目开发,一般是exclude掉B项目中的xml.jar,在C项目中显示指定xml.jar的版本。
<dependency> <groupId>b</groupId> <artifactId>test</artifactId> <version>1.0</version> <exclusions> <exclusion> <groupId>xml</group> <artifactId>xml</artifactId> </exclusion> </exclusions></dependency><dependency> <groupId>xml</group> <artifactId>xml</artifactId> <version> 2.2</version></dependency>
问题
按照上面的原则对xml-apis.1.0.b进行升级到xml-apis.1.4。但是始终exclude不出去xml-apis1.0.b mvn dependency:tree
看到xml-apis.1.0.的来源已经不是依赖的项目中引入的,而是在根路径下。
这个颠覆了对maven的认知。
看了下xml-apis这个,就知道版本有多混乱了,2.0.2的比1.4的还要先发布。
解决
直接引入了xerces xercesImpl 2.10.0.这个jar包中有xml-apis1.4.01版本
<dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.10.0</version></dependency>
参考
http://javamoods.blogspot.com/2009/06/maven-how-relocated-artifacts-can-ruin.html
https://stackoverflow.com/questions/11677572/dealing-with-xerces-hell-in-java-maven?answertab=votes
https://gxnotes.com/article/29548.html
阅读全文
0 0
- Warning maven relocated xml-apis to 1.0.b
- maven 报错[WARNING] The artifact aspectj:aspectjrt:jar:1.5.4 has been relocated to org.aspectj:aspectj
- Gradle build.gradle to Maven pom.xml
- 用w3c读取xml 文件 使用的jar包:xml-apis-1.0.b2.jar
- Maven: Unable to find resource 'javax.transaction:jta:jar:1.0.1B' in repository
- Maven xml异常:Failure to transfer org.apache.maven.***
- Warning: Attempt to present A on B whose view is not in the window hierarchy!
- Warning: Attempt to present A on B whose view is not in the window hierarchy!
- Warning: Attempt to present A on B whose view is not in the window hierarchy!
- APIs
- 如何去掉maven的[WARNING] Using platform encoding (UTF-8 actually) to copy filter
- [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins....
- xml 解析问题(Warning parsing XML: XML InputStream(1) URI was not reported to parser for entity)
- How To Enumerate Applications Using Win32 APIs
- Using OAuth 2.0 to Access Google APIs
- Intro to the three Android Audio APIs
- Introduction to iOS Graphics APIs: Part 1
- Intro to the three Android Audio APIs
- 剑指offer面试题25-二叉树中和韦某一值的路径
- 裸的KMP实现
- Linux克隆后网络配置
- CodeForces
- mysql change buffer
- Warning maven relocated xml-apis to 1.0.b
- fastboot及lk解析
- Servlet应用中重定向与请求转发的区别
- Java实现浏览器端大文件分片上传
- 8.12 K-生成树
- 矩形覆盖
- SQL Server删除表及删除表中数据的方法
- Binder总结
- Linux常用指令集