How to exclude a package from a jar (with maven)

1.7k views Asked by At

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.

1

There are 1 answers

1
P S M On BEST ANSWER
<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