maven-jar-plugin includes vs excludes

Posted by Chris Williams on Stack Overflow See other posts from Stack Overflow or by Chris Williams
Published on 2010-03-15T18:45:21Z Indexed on 2010/03/15 18:49 UTC
Read the original article Hit count: 495

Filed under:
|
|

I've got an existing pom file that includes a maven-jar-plugin section. It runs for the test-jar goal and is currently excluding a few directories:

<excludes>
     <exclude>...</exclude>
     <exclude>...</exclude>
     <exclude>somedir/**</exclude>
 </excludes>

I need to include a file in the somedir directory but leave out the rest of the files in the somedir directory. I've read that includes have precedence over excludes so I added something like the following (there was no includes section before):

<includes>
    <include>somedir/somefile.xml</include>
</includes>

This ends up creating a jar file for test with only a few files in it (just the stuff in META-INF). The file that I included is not in the jar either. What I'd expect is a jar that is identical to the jar that was created before my includes change with the one additional file.

What am I missing here?

© Stack Overflow or respective owner

Related posts about maven-2

Related posts about Xml