Hi,

I think I faced something similar, some time ago, but not absolutely sure,
here is what I remember:

<skipIfEmpty> works by testing if directory is present,  so if
src/test/java is present (no matter if empty or not)
jar will be created.

hope it helps
tonio





On Mon, Apr 28, 2014 at 6:12 AM, Nick Stolwijk <nick.stolw...@gmail.com>wrote:

> Hi Folks,
>
> I found a little curiosity in the maven jar plugin.
>
> if you specify includes and the skipIfEmpty property a jar is still
> created and attached while it only has a pom file in it. I would have
> expected that the creation of the jar was skipped if no files where
> selected by my includes property.
>
> My usecase: I only want to generate the tests jar when there are
> builders in the module, so other modules can use those builders in
> their tests. I don't want to package all tests, to prevent developers
> to create dependencies on these tests.
>
> My configuration:
>
>             <plugin>
>                 <artifactId>maven-jar-plugin</artifactId>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>test-jar</goal>
>                         </goals>
>                         <configuration>
>                             <skipIfEmpty>true</skipIfEmpty>
>                             <includes>
>                                 <include>**/*Builder.class</include>
>                             </includes>
>                         </configuration>
>                     </execution>
>                 </executions>
>             </plugin>
>
> With regards,
>
> Nick Stolwijk
>
> ~~~ Try to leave this world a little better than you found it and,
> when your turn comes to die, you can die happy in feeling that at any
> rate you have not wasted your time but have done your best ~~~
>
> Lord Baden-Powell
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

Reply via email to