Maven Jar Plugin - Testjar: includes together with skipIfEmpty
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: maven-jar-plugin test-jar true **/*Builder.class 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
Re: Maven Jar Plugin - Testjar: includes together with skipIfEmpty
Hi, I think I faced something similar, some time ago, but not absolutely sure, here is what I remember: 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 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: > > > maven-jar-plugin > > > > test-jar > > > true > > **/*Builder.class > > > > > > > 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 > >
Re: Maven Jar Plugin - Testjar: includes together with skipIfEmpty
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: > > > maven-jar-plugin > > > > test-jar > > > true > > **/*Builder.class > > > > > Configure the archiver to skip the Maven descriptor: == %< == false == %< == Cheers, Jörg - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org