Hi Nick,
Nick Stolwijk 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.
Well, since the default includes the pom, the jar is not empty.
> 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>
Configure the archiver to skip the Maven descriptor:
================== %< ==================
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
================== %< ==================
Cheers,
Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]