I'm trying to exclude a complete folder to be embedded within a JAR. I found the following directive which works like a charm :
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/unwantedJars/**</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
So, when running mvn clean install
, no problem, I get a JAR without the unwanted folder.
However, I have several projects which needs to include this directive (together with other common configuration), so I'm using a parent POM project. Everything is working well, apart the above directive. As soon as I move this exclude part to the parent POM definition, it doesn't work anymore.
Strange thing is that if I compare the effective POM of the 2 configuration, they're strictly identical!
What's the difference between having this directive on the POM of the current project or in the parent POM?