Maven: exclude transitive dependency in some modules

The project includes 7 modules. And the task is to exclude transitive dependency for one library in 4 modules.

Seemingly simple way is to write in each of 4 pom files:


But is there a more optimal way? Could I, for example, create one separate util pom.xml with dependencyManagment, and "link" this pom with each module, where I want to apply this dependencyManagment ?


  • You can define this in the parent POM and it then be used in all modules.