Create the jar and then put it under src/test/resources/my.jar and then refer to that my.jar in your testcase. It seems like an awful lot of trouble to dynamically create this test artifact, when you could just create it once and then add it to your repository. Yes, adding jars to your scm is generally bad, but this seems like a perfect exception.
On Thu, Aug 18, 2016 at 9:36 PM, Christopher <[email protected]> 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. > > We could create a mini project and use maven-invoker-plugin to package it, > but that's a lot of overhead (configuration and processing time) for a very > small test jar containing a single file (used to test a classloader). > > We've also considered just using maven-exec-plugin to execute the jar > command-line tool, but that's tricky to get right, accounting for > JAVA_HOME, toolchains, etc. > > Any suggestions, or is maven-invoker-plugin the best option? > > I think the maven-assembly-plugin might be able to do it, and it has an > <attach>false</attach> option, but I've never used it like this before. If > that's the best option, does anybody have any examples of that kind of > thing? > > Thanks. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
