0

I've the following structure in my src/main/resources:

resources
    |-config
         |-log4j
         |-app        

When building a war, Maven should exclude the app-Folder. I both tried packagingExcludes or excludes in the configuration of my War-Plugin. Seems to have no effect, doesn't matter what kind of path I'll use.

 <build>
        <finalName>${project.name}</finalName>
        <sourceDirectory>src/main/java</sourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <webResources>
                        <resource>
                            <directory>src/main/webapp/META-INF</directory>
                            <filtering>true</filtering>
                            <targetPath>META-INF</targetPath>
                        </resource>
                        <resource>
                            <directory>src/main/webapp/WEB-INF</directory>
                            <filtering>true</filtering>
                            <targetPath>WEB-INF</targetPath>
                        </resource>
                        <resource>
                            <directory>src/main/resources/config/log4j/${properties.path}/</directory>
                            <filtering>true</filtering>
                            <targetPath>WEB-INF/classes</targetPath>
                        </resource>
                    </webResources>
                    **<packagingExcludes>src/main/resources/config/app/**</packagingExcludes>**
                </configuration>
            </plugin>
    </build>

I also tried it described as here: maven2: excluding directory from WAR Did not work either...

Despite this, I use webResources for filtering my web.xml and context.xml this works smoothly.

Ultimately, I aim to not have the app-Folder from resources in my war. What am I missing? Thanks for any inputs!

Remo
  • 1,112
  • 2
  • 12
  • 25

0 Answers0