On Fri, Aug 19, 2016 at 1:38 PM Karl Heinz Marbaise <khmarba...@gmx.de> wrote:
> Hi, > > On 19/08/16 03:36, Christopher wrote: > > Hi Maven Users list, > > > > What's the best way to create a jar during a build without attaching it? > > > > Currently, our pom is configured to use the maven-jar-plugin to create > it, > > but that plugin attaches an artifact, which gets deployed. We don't want > > that. That doesn't seem to be configurable. > > Can you describe why you would like to create a jar which shouldn't be > deployed ? May be we can enhance maven-jar-plugin to support such a use > case? > The goal is to test a classloader during the integration-test phase. For the same reason that most people don't deploy the test-jar (or even create it), we don't want to deploy this jar. Another reason why we wouldn't want to deploy is that the contents of the jar might be dynamically generated, so that we can verify that the classloader is loading classes from this particular execution of the test, and isn't being loaded from somewhere else on the classpath. Deploying it to maven would be suitable for reuse, but we wouldn't want reuse in this case. The more I think about it, I think the maven-jar-plugin isn't necessarily appropriate for this. I think the maven-assembly-plugin is better suited to create the jar, and that does have an option to not attach.