Home > Errors & Exceptions > Excludin a jar file while buildinga war in maven.

Excludin a jar file while buildinga war in maven.

October 24, 2011

add a war plugin to the maven pom.xml file and exclude the jar file from it.

see sample below.

            <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1</version>
<configuration>
<packagingExcludes>WEB-INF/lib/geronimo-servlet_3.0_spec-1.0.jar</packagingExcludes>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>

Advertisements
Categories: Errors & Exceptions
%d bloggers like this: