maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher <>
Subject Create test jar during build without attaching
Date Fri, 19 Aug 2016 01:36:46 GMT
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


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message