You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Karl Heinz Marbaise <kh...@gmx.de> on 2008/09/08 10:34:57 UTC

Creating a jar/zip with dependencies

Hi there,

i have a project which has the following structure:

parent
  +--- Module A (depends on C and D)
  +--- Module B
  +--- Module C
  +--- Module D


Module A has of course other dependencies too....

Now coming to my problem:

I would like to create a zip/jar which comprises of the Module A-jar
and of it's dependencies (Module C and D) and of course of their
external dependencies (e.g. Log4j.jar, spring-2.5.4.jar,
commons-collections, xstream etc.)
Those dependencies have been defined in Module A, C and D.

If i do a mvn package in module A i only get a jar file which comprises
of the Classes in Module A without any dependencies....

I would like to create that zip/jar as a result of the package (for
delivery)

Does someone has an idea or a hint about that ?


Kind regards
Karl Heinz Marbaise
-- 
SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
Hauptstrasse 177                         USt.IdNr: DE191347579
52146 Würselen                           http://www.soebes.de

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


Re: Creating a jar/zip with dependencies

Posted by Mick Knutson <mi...@gmail.com>.
You can create this with the assembly-plugin
---
Thank You…

Mick Knutson
BASE Logic, inc.
(415) 354-4215

Website: http://baselogic.com
Blog: http://baselogic.com/blog
BLiNC Magazine: http://blincmagazine.com
Linked IN: http://linkedin.com/in/mickknutson
DJ Mick: http://djmick.com
MySpace: http://myspace.com/mickknutson
Vacation Rental: http://tahoe.baselogic.com



On Mon, Sep 8, 2008 at 1:34 AM, Karl Heinz Marbaise <kh...@gmx.de>wrote:

> Hi there,
>
> i have a project which has the following structure:
>
> parent
>  +--- Module A (depends on C and D)
>  +--- Module B
>  +--- Module C
>  +--- Module D
>
>
> Module A has of course other dependencies too....
>
> Now coming to my problem:
>
> I would like to create a zip/jar which comprises of the Module A-jar
> and of it's dependencies (Module C and D) and of course of their
> external dependencies (e.g. Log4j.jar, spring-2.5.4.jar,
> commons-collections, xstream etc.)
> Those dependencies have been defined in Module A, C and D.
>
> If i do a mvn package in module A i only get a jar file which comprises
> of the Classes in Module A without any dependencies....
>
> I would like to create that zip/jar as a result of the package (for
> delivery)
>
> Does someone has an idea or a hint about that ?
>
>
> Kind regards
> Karl Heinz Marbaise
> --
> SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
> Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
> Hauptstrasse 177                         USt.IdNr: DE191347579
> 52146 Würselen                           http://www.soebes.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Creating a jar/zip with dependencies

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi Olivier,

first of all, many thanks for the hints...
> I had the same kind of need.
> You should try Maven Assembly Plugin :
> http://maven.apache.org/plugins/maven-assembly-plugin/
> Or maybe Maven Shade Plugin :
> http://maven.apache.org/plugins/maven-shade-plugin/
I have taken a deep look into the documentation of the assembly plugin
and found what i need:

http://maven.apache.org/plugin/maven-assembly-plugin/descriptor-refs.html

There i found the jar-with-dependencies and changed this a little bit
and got exactly what i tried to....

Many thanks.
Kind regards
Karl Heinz Marbaise
-- 
SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
Hauptstrasse 177                         USt.IdNr: DE191347579
52146 Würselen                           http://www.soebes.de

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


Re: Creating a jar/zip with dependencies

Posted by Olivier THIERRY <ol...@gmail.com>.
I had the same kind of need.
You should try Maven Assembly Plugin :
http://maven.apache.org/plugins/maven-assembly-plugin/
Or maybe Maven Shade Plugin :
http://maven.apache.org/plugins/maven-shade-plugin/

2008/9/8 Karl Heinz Marbaise <kh...@gmx.de>

> Hi there,
>
> i have a project which has the following structure:
>
> parent
>  +--- Module A (depends on C and D)
>  +--- Module B
>  +--- Module C
>  +--- Module D
>
>
> Module A has of course other dependencies too....
>
> Now coming to my problem:
>
> I would like to create a zip/jar which comprises of the Module A-jar
> and of it's dependencies (Module C and D) and of course of their
> external dependencies (e.g. Log4j.jar, spring-2.5.4.jar,
> commons-collections, xstream etc.)
> Those dependencies have been defined in Module A, C and D.
>
> If i do a mvn package in module A i only get a jar file which comprises
> of the Classes in Module A without any dependencies....
>
> I would like to create that zip/jar as a result of the package (for
> delivery)
>
> Does someone has an idea or a hint about that ?
>
>
> Kind regards
> Karl Heinz Marbaise
> --
> SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
> Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
> Hauptstrasse 177                         USt.IdNr: DE191347579
> 52146 Würselen                           http://www.soebes.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Seules 2 choses sont infinies : l'univers et la bêtise humaine ; et encore
pour l'univers, je ne suis pas sûr … (Einstein)