You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ni...@arsoe-trelaze.com on 2003/09/23 15:26:28 UTC

Jar which includes other

I don't know if it is possible :

I have some sub project which produce jars. This jars are dependant each 
other. 
I want to define an other sub project who include the other projects jars 
to build one unique jar.

Nicolas

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Jar which includes other

Posted by Brent Hale <br...@eventronix.com>.
I don't  if this is the BEST way, but here's something I do that works.

    <postGoal name="jar:jar">
        <attainGoal name="mergejars"/>
    </postGoal>

    <goal
        name="mergejars"
        description="Merges the subproject's jar into this main one.">
       
        <!-- Use Ant's zip feature to merge the created jar with the 
schema jar -->
        <ant:zip destfile="${maven.build.dir}/combined.jar" 
duplicate="preserve">
            <zipgroupfileset dir="${maven.build.dir}" 
includes="${maven.final.name}.jar"/>
            <zipgroupfileset dir="qbxmlschema/target" includes="*.jar"/>
        </ant:zip>
       
        <!-- Rename the combined.jar as the real one. -->
        <move file="${maven.build.dir}/combined.jar" 
tofile="${maven.build.dir}/${maven.final.name}.jar"/>
    </goal>


This shows how to merge two jars into one. 

Brent



Nicolas.CHALUMEAU@arsoe-trelaze.com wrote:

>I don't know if it is possible :
>
>I have some sub project which produce jars. This jars are dependant each 
>other. 
>I want to define an other sub project who include the other projects jars 
>to build one unique jar.
>
>Nicolas
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>  
>

-- 
Brent Hale
Fishbowl Inventory
www.fishbowlinventory.com



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org