I came across the same problem and ended up writing a custom goal (actually a 
simple plugin because it's used in more then 1 project) which I run as preGoal 
to the standard java:jar-resources. It simply unjars the dependencies having 
the "jar.bundle" property set to true and then the jar goal picks up the 
classes and include them all in a standard jar. Note that this should only be 
used internally and you should only be tagging YOUR OWN jars to be included... 
Here's the goal I have, as you might see, it is "inspired" by the war plugin 
and the war.bundle property:

  <goal name="prepareBundle">
    <j:forEach var="lib" items="${pom.artifacts}">
      <j:set var="dep" value="${lib.dependency}"/>     
      <j:if test="${dep.getProperty('jar.bundle')=='true'}">
         <j:if test="${dep.type =='jar'}"> 
           <unjar dest="${maven.build.dest}" src="${lib.path}"/>  
         </j:if> 
      </j:if>  
    </j:forEach>            
  </goal>

Steve Molloy

-----Original Message-----
From: Brett Porter [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 18, 2004 3:55 AM
To: Maven Users List
Subject: Re: Grouping related projects

this is definitely the right approach, but be aware uberjar is a JAR
of JARs, not jar of all classes. if you want a JAR of all classes,
that's something you will need to aggregate yourself at this point.

Cheers,
Brett


On Thu, 18 Nov 2004 09:50:07 +0100,
[EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Use the multiproject with a directory structure like
> /root
>         /common-prj1
>         /common-prj2
>         ...
>         /common-all
> 
> common-prj* are maven.multiproject.type=jar
> common-all   is maven.multiproject.type=uberjar and have all the
> common-prj* in his dependancies
> 
> On the root dir using maven multiproject:install will build
> common-prj*.jar and the common-all.jar who contains all the common-prj*
> classes
> 
> Nicolas,
> 
> "Duncan Krebs" <[EMAIL PROTECTED]>
> 18/11/2004 03:34
> Veuillez r�pondre � "Maven Users List"
> 
>         Pour :  "Maven UserList" <[EMAIL PROTECTED]>
>         cc :
>         Objet : Grouping related projects
> 
> 
> 
> 
> Hi,
> I'm breaking my development down into really small maven projects and I'm
> trying to figure out what the options are if I want to group them
> together. For example, say I have 5 separate projects that all start with
> mycompany.commons that I'd like to distribute as one final versioned jar
> but also want to maintain their own separate versions. Would this mean
> creating a maven project to represent that jar? If that's the case then
> would the five separate project folders be sub directories of the project
> that represents the jar? Or am I totally out of it? thanks. - Duncan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to