Issue
How can I exclude the lib
folder using maven? I don't want these resources to be copied when packaging and building war file.
The following does not work:
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<packagingExcludes>${basedir}/src/main/webapp/WEB-INF/lib/**</packagingExcludes>
</configuration>
</plugin>
Example path:
../lib/my/path/to/lib.jar
Running mvn package
will include all files from the lib folder.
Solution
Try following from Creating Skinny WARs:
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<!-- In version 2.1-alpha-1, this was incorrectly named warSourceExcludes -->
<packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
Answered By - Sumit Singh
Answer Checked By - Mildred Charles (JavaFixing Admin)