You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Heinrich Götzger <go...@gmx.de> on 2013/11/21 17:01:39 UTC

create a jar-file with content of other jars

Hi,

this might have been discussed somewhere else already, but I couldn't 
find it yet, so here is my problem:

There are some jar-Files from third party (non-maven-source) which I'd 
like to put/merge into a sinlge jar. The content of those 
third-party-jars has to be extracted (unpacked). The target of this 
project goes in a local nexus-repository for later use from other projects.

And I'd like to avoid to put every single jar a dependency into nexus.

The question now is:
How would the file-structure be for this project, where to put those jars?
And how would I get these jars unpacked and repacked into one single jar 
as target of this project?

Thanks for helping or pointing to a solution.

Cheers

Heinrich

-- 
Before printing this e-mail, think about our environmental responsibility.


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


Re: create a jar-file with content of other jars

Posted by Cemo <ce...@gmail.com>.
On 21 November 2013 18:01, Heinrich Götzger <go...@gmx.de> wrote:

> Hi,
>
> this might have been discussed somewhere else already, but I couldn't find
> it yet, so here is my problem:
>
> There are some jar-Files from third party (non-maven-source) which I'd
> like to put/merge into a sinlge jar. The content of those third-party-jars
> has to be extracted (unpacked). The target of this project goes in a local
> nexus-repository for later use from other projects.
>
> And I'd like to avoid to put every single jar a dependency into nexus.
>
> The question now is:
> How would the file-structure be for this project, where to put those jars?
> And how would I get these jars unpacked and repacked into one single jar
> as target of this project?
>
> Thanks for helping or pointing to a solution.
>
> Cheers
>

Hi,

You can use maven shade plugin for this purpose. Please note that shade
plugin is very powerful and can do more than what you want.

Example:

http://maven.apache.org/plugins/maven-shade-plugin/examples/includes-excludes.html

Re: create a jar-file with content of other jars

Posted by Stephen Connolly <st...@gmail.com>.
For a single purpose one time deal like this, there is no shame in putting
the jars in src/ and just using an ant task to unzip them into
target/classes

On Thursday, 21 November 2013, Heinrich Götzger wrote:

> Hi,
>
> this might have been discussed somewhere else already, but I couldn't find
> it yet, so here is my problem:
>
> There are some jar-Files from third party (non-maven-source) which I'd
> like to put/merge into a sinlge jar. The content of those third-party-jars
> has to be extracted (unpacked). The target of this project goes in a local
> nexus-repository for later use from other projects.
>
> And I'd like to avoid to put every single jar a dependency into nexus.
>
> The question now is:
> How would the file-structure be for this project, where to put those jars?
> And how would I get these jars unpacked and repacked into one single jar
> as target of this project?
>
> Thanks for helping or pointing to a solution.
>
> Cheers
>
> Heinrich
>
> --
> Before printing this e-mail, think about our environmental responsibility.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

-- 
Sent from my phone

RE: create a jar-file with content of other jars

Posted by Martin Gainty <mg...@hotmail.com>.
take a look at maven-shade-plugin building "uber jar"

     <configuration>
              <filters>
                <filter>
                  <artifact>GroupId:ArtifactId</artifact>
                  <includes>
                    <include>GroupPackageName/ArtifactName/**</include>

..

 

http://maven.apache.org/plugins/maven-shade-plugin/examples/includes-excludes.html


HTH,
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

  


> Date: Thu, 21 Nov 2013 17:01:39 +0100
> From: goetzger@gmx.de
> To: users@maven.apache.org
> Subject: create a jar-file with content of other jars
> 
> Hi,
> 
> this might have been discussed somewhere else already, but I couldn't 
> find it yet, so here is my problem:
> 
> There are some jar-Files from third party (non-maven-source) which I'd 
> like to put/merge into a sinlge jar. The content of those 
> third-party-jars has to be extracted (unpacked). The target of this 
> project goes in a local nexus-repository for later use from other projects.
> 
> And I'd like to avoid to put every single jar a dependency into nexus.
> 
> The question now is:
> How would the file-structure be for this project, where to put those jars?
> And how would I get these jars unpacked and repacked into one single jar 
> as target of this project?
> 
> Thanks for helping or pointing to a solution.
> 
> Cheers
> 
> Heinrich
> 
> -- 
> Before printing this e-mail, think about our environmental responsibility.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>