maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laird Nelson <>
Subject Re: Unpacking jars into target/classes
Date Thu, 21 Mar 2013 02:40:33 GMT
On Sat, Mar 2, 2013 at 12:32 PM, Joachim Durchholz <> wrote:

> I have two jars from an external source and need to merge their contents
> into the target/classes tree until the process-classes phase.
> I'm not sure what plugin(s) can be used to achieve this effect.

Offhand I would say you can use the maven-dependency-plugin's unpack goal
(documented here:

It is perfectly legal to bind the unpack goal to the (say) process-classes
phase twice, with different executions.

So you could do something like this (I'm typing from memory; sure to make
syntax mistakes; hope you get the idea):

      <id>Unpack the first jar into ${}</id>
        <!-- here is where the magic happens -->
      <id>Unpack the second jar into ${}</id>
        <!-- here is where more magic happens -->

I do something very much like this in my JPA pseudo-archetype (

In your case, where you cannot or will not install the artifacts into your
local Maven repository/cache--a totally legitimate state of affairs, I
know; anyone who has worked in a large company has faced this--you would
make sure to declare a dependency in <scope>system</scope>:



This would be the first dependency unpacked in the stanza I showed above.

I hope this helps you out.



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