[英]Can I make Maven refuse to build when there are version conflicts?
The tile pretty much says it all. 瓷砖几乎说明了一切。
I often deal with a project which depends on libraries A
and B
, 我经常处理一个依赖于库A
和B
,
where A
wants to pull in C version 1.0.0
and B
wants to pull in C version 1.5.6
. A
想要引入C version 1.0.0
而B
想要引入C version 1.5.6
。
Maven's default behavior seems to be that mvn package
succeeds, including one or the other version of C
on the classpath. Maven的默认行为似乎是mvn package
成功,包括类路径上的一个或另一个版本的C
I would like to specify in my pom.xml
that maven should refuse to build the project until one of the two C
dependencies has been excluded. 我想在我的pom.xml
中指定maven应该拒绝构建项目,直到排除了两个C
依赖项中的一个。
Can this be done without first writing a new plugin? 这可以在没有先写一个新插件的情况下完成吗?
maven enforcer插件应该能够检查,请参阅此处的依赖性收敛
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.