1

I want to exclude the geronimo-javamail_1.4_spec jar from my project, I am using maven to build the project, I saw this article and I added the exclusion part to my pom.xml but somehow after I build my project I see the geronimo-javamail_1.4_spec-1.7.1.jar in my war file's WEB-INF\lib.

Please tell me how can I exclude this jar from my .war.

Community
  • 1
  • 1
Shahe
  • 964
  • 2
  • 13
  • 34
  • If it is declared as a direct dependency then you should use `provided`. If not - then you should try `mvn dependency:tree`, and find all the places where it is added. – user3707125 Feb 16 '16 at 12:42
  • I used `mvn dependency:tree` and found the places, what should I do now? – Shahe Feb 16 '16 at 12:57
  • @Shahe "what should I do now?" It seems like [the post you've cited](http://stackoverflow.com/a/23021872). "So, your solution would be to explicitly add the core jar with an exclusion to your dependencies." to all of your dependencies – John_West Feb 16 '16 at 13:11

1 Answers1

1
<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
P S M
  • 1,121
  • 12
  • 29