简体   繁体   English

当版本冲突时,我可以让Maven拒绝构建吗?

[英]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 , 我经常处理一个依赖于库AB

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.0B想要引入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.

相关问题 我怎样才能拒绝破坏构建的mercurial签到? - How can I refuse mercurial check-ins that break the build? 使用eclipse / netbeans时,可以使用Maven进行构建吗? - when using eclipse/netbeans, can you make it use the maven to build? 只是我想在 maven 项目的构建失败时成为目标 - simply I want to make target when build is fail of maven project 最新版本和旧版本冲突的两个Maven依赖关系 - Two Maven Dependency for latest and old version conflicts 我在哪里可以查看 Apache Maven Java 构建版本? 什么是 JNI 错误? - Where Can I check Apache Maven Java build version? What's JNI Error? 如何使Maven构建从常量获取版本 - How to make maven build take version from constant maven build - 版本信息 - maven build - version information 如何使ProGuard Maven插件使用最新的ProGuard版本? - How can I make the ProGuard Maven plugin use the most recent ProGuard version? 在成功构建之前,您可以进行Maven构建吗? - Can you make maven build until you get a successful build? 我可以通过“Spring Boot Maven Plugin”制作带有“build-info”的可执行 jar 吗? - Can I make an executable jar with “build-info” by “Spring Boot Maven Plugin”?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM