Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven3 global dependency exclusion

It is possible using Maven3 to have a global dependency exclusion instead of per-dependency exclusion ? If yes, how ? The documentation doesn't seems to be really friendly.

Thanks.

Later edit: Yeah, it seems that they'll fix this in 3.1 version of maven. So, till then, I guess I need to stick to the verbose way to do it for each dependency.

like image 210
Alin Avatar asked Dec 17 '10 19:12

Alin


People also ask

Is there a way to exclude Maven dependency globally?

Multiple transitive dependencies can be excluded by using the <exclusion> tag for each of the dependency you want to exclude and placing all these exclusion tags inside the <exclusions> tag in pom. xml. You will need to mention the group id and artifact id of the dependency you wish to exclude in the exclusion tag.

How you can exclude dependency in Maven?

You can use a diagram to exclude a dependency from the project's POM. Select a dependency in the diagram window. From the context menu, choose Exclude. From the list, select the module (if any) where the exclusion definition will be added.

What is dependency exclusion in Maven?

For example, a certain older jar may have security issues or be incompatible with the Java version you're using. To address this, Maven allows you to exclude specific dependencies. Exclusions are set on a specific dependency in your POM, and are targeted at a specific groupId and artifactId.

What is a transitive dependency Maven?

Transitive Dependencies. Maven avoids the need to discover and specify the libraries that your own dependencies require by including transitive dependencies automatically. This feature is facilitated by reading the project files of your dependencies from the remote repositories specified.


1 Answers

It looks like this is not possible. There are a few open issues (MNG-3196, MNG-1977, MNG-2163) related to this

like image 128
Raghuram Avatar answered Sep 28 '22 18:09

Raghuram