一些想法:
在这种情况下,您可能根本无法从父项继承(并声明
base
排除项的依赖项)。如果您在父pom中有很多东西,则不方便。要测试的另一件事是在父pom 下声明
mail
具有所需版本的工件以强制收敛(尽管我不确定这是否可以解决范围问题)。ALL-DEPS``dependencyManagement
<dependencyManagement> <dependencies> <dependency> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> <version>???</version><!-- put the "right" version here --> </dependency> </dependencies> </dependencyManagement>
- 或者
mail
,如果您不使用依赖于log4j的功能,则可以将其从log4j中排除(这就是我要做的):
<dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.15</version> <scope>provided</scope> <exclusions> <exclusion> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> </exclusion> <exclusion> <groupId>javax.jms</groupId> <artifactId>jms</artifactId> </exclusion> <exclusion> <groupId>com.sun.jdmk</groupId> <artifactId>jmxtools</artifactId> </exclusion> <exclusion> <groupId>com.sun.jmx</groupId> <artifactId>jmxri</artifactId> </exclusion> </exclusions> </dependency>
- 或者,您可以恢复到log4j的1.2.14版本,而不是异端的1.2.15版本(为什么它们不将上述依赖项标记为 可选 ?!)。



