I am trying to find a “general” way to exclude a transitive dependency from an included one without having to exclude it from all its dependencies. For example, if I want to exclude slf4j, I do the following:
<dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-jmx</artifactId> <version>3.3.2.GA</version> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>3.4.0.GA</version> <type>jar</type> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> </exclusions> </dependency>
This is partly to clean the pom file, partly to avoid future problems when people add dependencies that depend on this excluded dependency and forget to exclude it.
Is there any way?
Sébastien Le Callonnec Jan 17 '11 at 18:09 2011-01-17 18:09
source share