I have:
Src / main / java / com.tuto
|
-Class1.java
-Class2.java
-Class3.java
My pom packs the war. Therefore, in my war in WEB-INF / classes / com / tuto I found 3 classes.
Now I want to exclude Class2.java
I tried
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1</version> <configuration> <excludes> <exclude>**/Class2.class</exclude> </excludes> </configuration> </plugin>
But it does not work.
How can i do this?
Okay, so, as Aaron says, this works:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1</version> <configuration> <packagingExcludes>**/Class2.class</packagingExcludes> </configuration> </plugin>
But...
Let's take the problem from the other side: I want to exclude everything except Class1 and Class3
So i tried
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1</version> <configuration> <packagingIncludes>**/Class1.class,**/Class3.class</packagingIncludes> </configuration> </plugin>
and this time it does not work.
source share