I am using the maven-war-plugin to build a .war file
I am using packagigExcludes and it is working fine for .jar files:
<packagingExcludes>WEB-INF/lib/jetty-*.ja
WEB-INF/../resources/log4j.properties,
WEB-INF/../resources/web.properties
</packagingExcludes>
But the properties files above are not getting exluded, I also tried:
src/main/resources/web.properties
This is a multi-module maven project, and I am building a .war file for this spring mvc maven project and I have to exclude these files but it isn't working.
Any pointers?
i just tried ... are you sure you're doing the configuration in the right place? my pom looks like this:
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.example</groupId>
<artifactId>example-parent</artifactId>
<version>0.1.4-SNAPSHOT</version>
</parent>
<artifactId>example-webapp</artifactId>
<packaging>war</packaging>
<url>http://maven.apache.org</url>
<dependencies>
[...]
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
</configuration>
</plugin>
</plugins>
<finalName>example-webapp</finalName>
</build>
</project>
----> EDIT
to exlude stuff from resource, you would have to do this:
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<packagingExcludes>
WEB-INF/classes/log4j.properties
</packagingExcludes>
</configuration>
</plugin>
Add this in pom.xml
</build>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>web.properties</exclude>
</excludes
</resource>
</resources>
</build>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With