我想从项目中排除geronimo-javamail_1.4_spec jar,我正在使用maven构建项目,我看到了this文章,并且在exclusion中添加了pom.xml部分,但是在构建项目后以某种方式我看到了我的战争档案geronimo-javamail_1.4_spec-1.7.1.jar中的WEB-INF\lib

请告诉我如何从我的.war中排除此罐子。

最佳答案

<dependency>
    <groupId>org.apache.geronimo.specs</groupId>
    <artifactId>geronimo-javamail_1.4_spec</artifactId>
    <version>1.4</version>
     <scope>provided</scope>
</dependency>


This way the maven will add them to the compilation classpath, but will not package them

10-01 14:17