mac01021
mac01021

Reputation: 825

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,

where A wants to pull in C version 1.0.0 and B wants to pull in 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.

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.

Can this be done without first writing a new plugin?

Upvotes: 3

Views: 67

Answers (1)

tom
tom

Reputation: 1503

The maven enforcer plugin should be able to check that, see Dependency Convergence here

Upvotes: 3

Related Questions