Maven excludes all transitive dependencies
October 08, 2014 ・0comments ・Topic: Java Maven OpenSource
Transitive dependencies are a new feature in Maven 2.0. This feature allows you to avoid the need to discover and specify the libraries that your own dependencies require, as they are included automatically.
I encountered a problem where some dependencies were available at runtime, but they weren't available in the public Nexus repositories. For example, Hibernate depends on the Sun JTA API JAR, which is not available in the central Maven repository because it cannot be freely redistributed. Consequently, when building the project, it tried to download transitive dependencies and failed.
<dependency> <groupId>sample.ProjectA</groupId> <artifactId>Project-A</artifactId> <version>1.0</version> <scope>compile</scope> <exclusions> <exclusion> <groupId>*</groupId> <artifactId>*</artifactId> </exclusion> </exclusions> </dependency>
This wildcard transitive dependencies ignoring is available with maven 3.2.1 release. So it's worth to upgrade into latest maven version.
Post a Comment