Running maven shade on a preexisting jar

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Running maven shade on a preexisting jar

Robert James
I have a jar that I need to shade - that is, change the name of many
of the internal classes (to avoid conflicts with another jar) except
for a few classes which remain exposed.  The jar is already built,
source is not at hand.  How can I use maven shade to shade that jar?

(Disclaimer: I'm a maven neophyte)

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running maven shade on a preexisting jar

james northrup
hi shade can possibly juxtapose jar deps diffrently from one build to the
next in my experience. if you think you are having collisions you should
probably do 2 things

1) use <exclude> on the older jar from the older <dependency> to avoid the
collision
2) see if proguard fixes what shade breaks, if shade stays broken after #1.
 it's pretty intense


On Mon, Jul 7, 2014 at 12:21 PM, Robert James <[hidden email]>
wrote:

> I have a jar that I need to shade - that is, change the name of many
> of the internal classes (to avoid conflicts with another jar) except
> for a few classes which remain exposed.  The jar is already built,
> source is not at hand.  How can I use maven shade to shade that jar?
>
> (Disclaimer: I'm a maven neophyte)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Jim Northrup  *  (408) 837-2270 *
Reply | Threaded
Open this post in threaded view
|

Re: Running maven shade on a preexisting jar

Robert James
How do I run Maven Shade on a standalone jar (ie with no sources to
build from)? Please realize that I'm a beginner to Maven.

On 7/7/14, james northrup <[hidden email]> wrote:

> hi shade can possibly juxtapose jar deps diffrently from one build to the
> next in my experience. if you think you are having collisions you should
> probably do 2 things
>
> 1) use <exclude> on the older jar from the older <dependency> to avoid the
> collision
> 2) see if proguard fixes what shade breaks, if shade stays broken after #1.
>  it's pretty intense
>
>
> On Mon, Jul 7, 2014 at 12:21 PM, Robert James <[hidden email]>
> wrote:
>
>> I have a jar that I need to shade - that is, change the name of many
>> of the internal classes (to avoid conflicts with another jar) except
>> for a few classes which remain exposed.  The jar is already built,
>> source is not at hand.  How can I use maven shade to shade that jar?
>>
>> (Disclaimer: I'm a maven neophyte)
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
> --
> Jim Northrup  *  (408) 837-2270 *
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running maven shade on a preexisting jar

Dan Tran
this is just guess

1. create  jar project with no source

2. hook up maven-dependency-plugin to unpack your jar into target/classes

3. hook up maven-shade-plugin to massage your target/classes


Good luck

-D



On Mon, Jul 7, 2014 at 2:15 PM, Robert James <[hidden email]> wrote:

> How do I run Maven Shade on a standalone jar (ie with no sources to
> build from)? Please realize that I'm a beginner to Maven.
>
> On 7/7/14, james northrup <[hidden email]> wrote:
> > hi shade can possibly juxtapose jar deps diffrently from one build to the
> > next in my experience. if you think you are having collisions you should
> > probably do 2 things
> >
> > 1) use <exclude> on the older jar from the older <dependency> to avoid
> the
> > collision
> > 2) see if proguard fixes what shade breaks, if shade stays broken after
> #1.
> >  it's pretty intense
> >
> >
> > On Mon, Jul 7, 2014 at 12:21 PM, Robert James <[hidden email]>
> > wrote:
> >
> >> I have a jar that I need to shade - that is, change the name of many
> >> of the internal classes (to avoid conflicts with another jar) except
> >> for a few classes which remain exposed.  The jar is already built,
> >> source is not at hand.  How can I use maven shade to shade that jar?
> >>
> >> (Disclaimer: I'm a maven neophyte)
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
> >
> >
> > --
> > Jim Northrup  *  (408) 837-2270 *
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Running maven shade on a preexisting jar

james northrup
In reply to this post by Robert James
shade is a uber jar plugin.  there are 3 uber jar plugins that matter,
shade, maven-assembly, and proguard.

for beginners:
all of them work more or less by merging a project into a  single new jar
just reading the pom dependencies.

maven assembly does the least work.  good for quick jobs

shade-plugin sometimes does a good job but imho if it works once you are
buying into a false sense of security and will be bitten as you grow a
project.

proguard is industrial strength and imho returns the best result for
investing in rtfm.

all of the above have a special configs to do parts and pieces.  a
beginner's mistake would be to pursue that course of action.  don't.  make
a simple uber-jar project with one output jar combined from all of the
input jars, and learn how to exclude collisions.

if you have  some proprietary jar with no source spend some time with jad
to make source and refactor your packages to do the above, "simple"
uber-jar


On Mon, Jul 7, 2014 at 2:15 PM, Robert James <[hidden email]> wrote:

> How do I run Maven Shade on a standalone jar (ie with no sources to
> build from)? Please realize that I'm a beginner to Maven.
>
> On 7/7/14, james northrup <[hidden email]> wrote:
> > hi shade can possibly juxtapose jar deps diffrently from one build to the
> > next in my experience. if you think you are having collisions you should
> > probably do 2 things
> >
> > 1) use <exclude> on the older jar from the older <dependency> to avoid
> the
> > collision
> > 2) see if proguard fixes what shade breaks, if shade stays broken after
> #1.
> >  it's pretty intense
> >
> >
> > On Mon, Jul 7, 2014 at 12:21 PM, Robert James <[hidden email]>
> > wrote:
> >
> >> I have a jar that I need to shade - that is, change the name of many
> >> of the internal classes (to avoid conflicts with another jar) except
> >> for a few classes which remain exposed.  The jar is already built,
> >> source is not at hand.  How can I use maven shade to shade that jar?
> >>
> >> (Disclaimer: I'm a maven neophyte)
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
> >
> >
> > --
> > Jim Northrup  *  (408) 837-2270 *
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Jim Northrup  *  (408) 837-2270 *
Reply | Threaded
Open this post in threaded view
|

RE: Running maven shade on a preexisting jar

mgainty


> From: [hidden email]
> Date: Mon, 7 Jul 2014 14:31:31 -0700
> Subject: Re: Running maven shade on a preexisting jar
> To: [hidden email]
>
> shade is a uber jar plugin.  there are 3 uber jar plugins that matter,
> shade, maven-assembly, and proguard.
>
> for beginners:
> all of them work more or less by merging a project into a  single new jar
> just reading the pom dependencies.
>
> maven assembly does the least work.  good for quick jobs
>
> shade-plugin sometimes does a good job but imho if it works once you are
> buying into a false sense of security and will be bitten as you grow a
> project.
>
> proguard is industrial strength and imho returns the best result for
> investing in rtfm.
>
> all of the above have a special configs to do parts and pieces.  a
> beginner's mistake would be to pursue that course of action.  don't.  make
> a simple uber-jar project with one output jar combined from all of the
> input jars, and learn how to exclude collisions.
>
> if you have  some proprietary jar with no source spend some time with jad
> to make source and refactor your packages to do the above, "simple"
> uber-jar
MG>James i had some difficulty locating Java Decompiler (JAD) ..can i assume this is JAD repository we should reference?
MG>http://varaneckas.com/jad/

>
>
> On Mon, Jul 7, 2014 at 2:15 PM, Robert James <[hidden email]> wrote:
>
> > How do I run Maven Shade on a standalone jar (ie with no sources to
> > build from)? Please realize that I'm a beginner to Maven.
> >
> > On 7/7/14, james northrup <[hidden email]> wrote:
> > > hi shade can possibly juxtapose jar deps diffrently from one build to the
> > > next in my experience. if you think you are having collisions you should
> > > probably do 2 things
> > >
> > > 1) use <exclude> on the older jar from the older <dependency> to avoid
> > the
> > > collision
> > > 2) see if proguard fixes what shade breaks, if shade stays broken after
> > #1.
> > >  it's pretty intense
> > >
> > >
> > > On Mon, Jul 7, 2014 at 12:21 PM, Robert James <[hidden email]>
> > > wrote:
> > >
> > >> I have a jar that I need to shade - that is, change the name of many
> > >> of the internal classes (to avoid conflicts with another jar) except
> > >> for a few classes which remain exposed.  The jar is already built,
> > >> source is not at hand.  How can I use maven shade to shade that jar?
> > >>
> > >> (Disclaimer: I'm a maven neophyte)
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: [hidden email]
> > >> For additional commands, e-mail: [hidden email]
> > >>
> > >>
> > >
> > >
> > > --
> > > Jim Northrup  *  (408) 837-2270 *
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
>
> --
> Jim Northrup  *  (408) 837-2270 *
     
Reply | Threaded
Open this post in threaded view
|

Re: Running maven shade on a preexisting jar

james northrup
MG: sure or
http://en.wikipedia.org/wiki/Java_Decompiler


On Mon, Jul 7, 2014 at 4:13 PM, Martin Gainty <[hidden email]> wrote:

>
>
> > From: [hidden email]
> > Date: Mon, 7 Jul 2014 14:31:31 -0700
> > Subject: Re: Running maven shade on a preexisting jar
> > To: [hidden email]
> >
> > shade is a uber jar plugin.  there are 3 uber jar plugins that matter,
> > shade, maven-assembly, and proguard.
> >
> > for beginners:
> > all of them work more or less by merging a project into a  single new jar
> > just reading the pom dependencies.
> >
> > maven assembly does the least work.  good for quick jobs
> >
> > shade-plugin sometimes does a good job but imho if it works once you are
> > buying into a false sense of security and will be bitten as you grow a
> > project.
> >
> > proguard is industrial strength and imho returns the best result for
> > investing in rtfm.
> >
> > all of the above have a special configs to do parts and pieces.  a
> > beginner's mistake would be to pursue that course of action.  don't.
>  make
> > a simple uber-jar project with one output jar combined from all of the
> > input jars, and learn how to exclude collisions.
> >
> > if you have  some proprietary jar with no source spend some time with jad
> > to make source and refactor your packages to do the above, "simple"
> > uber-jar
> MG>James i had some difficulty locating Java Decompiler (JAD) ..can i
> assume this is JAD repository we should reference?
> MG>http://varaneckas.com/jad/
> >
> >
> > On Mon, Jul 7, 2014 at 2:15 PM, Robert James <[hidden email]>
> wrote:
> >
> > > How do I run Maven Shade on a standalone jar (ie with no sources to
> > > build from)? Please realize that I'm a beginner to Maven.
> > >
> > > On 7/7/14, james northrup <[hidden email]> wrote:
> > > > hi shade can possibly juxtapose jar deps diffrently from one build
> to the
> > > > next in my experience. if you think you are having collisions you
> should
> > > > probably do 2 things
> > > >
> > > > 1) use <exclude> on the older jar from the older <dependency> to
> avoid
> > > the
> > > > collision
> > > > 2) see if proguard fixes what shade breaks, if shade stays broken
> after
> > > #1.
> > > >  it's pretty intense
> > > >
> > > >
> > > > On Mon, Jul 7, 2014 at 12:21 PM, Robert James <
> [hidden email]>
> > > > wrote:
> > > >
> > > >> I have a jar that I need to shade - that is, change the name of many
> > > >> of the internal classes (to avoid conflicts with another jar) except
> > > >> for a few classes which remain exposed.  The jar is already built,
> > > >> source is not at hand.  How can I use maven shade to shade that jar?
> > > >>
> > > >> (Disclaimer: I'm a maven neophyte)
> > > >>
> > > >>
> ---------------------------------------------------------------------
> > > >> To unsubscribe, e-mail: [hidden email]
> > > >> For additional commands, e-mail: [hidden email]
> > > >>
> > > >>
> > > >
> > > >
> > > > --
> > > > Jim Northrup  *  (408) 837-2270 *
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >
> >
> >
> > --
> > Jim Northrup  *  (408) 837-2270 *
>
>



--
Jim Northrup  *  (408) 837-2270 *
Reply | Threaded
Open this post in threaded view
|

Re: Running maven shade on a preexisting jar

Benson Margulies
Ignore the sales pitch and the unpacking complexity.

1. Make an ordinary new project with no source code.

2. List your jar as a dependency.

3. Configure shade. It can be configured to operate on dependencies.
On Jul 8, 2014 6:30 AM, "james northrup" <[hidden email]> wrote:

> MG: sure or
> http://en.wikipedia.org/wiki/Java_Decompiler
>
>
> On Mon, Jul 7, 2014 at 4:13 PM, Martin Gainty <[hidden email]> wrote:
>
> >
> >
> > > From: [hidden email]
> > > Date: Mon, 7 Jul 2014 14:31:31 -0700
> > > Subject: Re: Running maven shade on a preexisting jar
> > > To: [hidden email]
> > >
> > > shade is a uber jar plugin.  there are 3 uber jar plugins that matter,
> > > shade, maven-assembly, and proguard.
> > >
> > > for beginners:
> > > all of them work more or less by merging a project into a  single new
> jar
> > > just reading the pom dependencies.
> > >
> > > maven assembly does the least work.  good for quick jobs
> > >
> > > shade-plugin sometimes does a good job but imho if it works once you
> are
> > > buying into a false sense of security and will be bitten as you grow a
> > > project.
> > >
> > > proguard is industrial strength and imho returns the best result for
> > > investing in rtfm.
> > >
> > > all of the above have a special configs to do parts and pieces.  a
> > > beginner's mistake would be to pursue that course of action.  don't.
> >  make
> > > a simple uber-jar project with one output jar combined from all of the
> > > input jars, and learn how to exclude collisions.
> > >
> > > if you have  some proprietary jar with no source spend some time with
> jad
> > > to make source and refactor your packages to do the above, "simple"
> > > uber-jar
> > MG>James i had some difficulty locating Java Decompiler (JAD) ..can i
> > assume this is JAD repository we should reference?
> > MG>http://varaneckas.com/jad/
> > >
> > >
> > > On Mon, Jul 7, 2014 at 2:15 PM, Robert James <[hidden email]>
> > wrote:
> > >
> > > > How do I run Maven Shade on a standalone jar (ie with no sources to
> > > > build from)? Please realize that I'm a beginner to Maven.
> > > >
> > > > On 7/7/14, james northrup <[hidden email]> wrote:
> > > > > hi shade can possibly juxtapose jar deps diffrently from one build
> > to the
> > > > > next in my experience. if you think you are having collisions you
> > should
> > > > > probably do 2 things
> > > > >
> > > > > 1) use <exclude> on the older jar from the older <dependency> to
> > avoid
> > > > the
> > > > > collision
> > > > > 2) see if proguard fixes what shade breaks, if shade stays broken
> > after
> > > > #1.
> > > > >  it's pretty intense
> > > > >
> > > > >
> > > > > On Mon, Jul 7, 2014 at 12:21 PM, Robert James <
> > [hidden email]>
> > > > > wrote:
> > > > >
> > > > >> I have a jar that I need to shade - that is, change the name of
> many
> > > > >> of the internal classes (to avoid conflicts with another jar)
> except
> > > > >> for a few classes which remain exposed.  The jar is already built,
> > > > >> source is not at hand.  How can I use maven shade to shade that
> jar?
> > > > >>
> > > > >> (Disclaimer: I'm a maven neophyte)
> > > > >>
> > > > >>
> > ---------------------------------------------------------------------
> > > > >> To unsubscribe, e-mail: [hidden email]
> > > > >> For additional commands, e-mail: [hidden email]
> > > > >>
> > > > >>
> > > > >
> > > > >
> > > > > --
> > > > > Jim Northrup  *  (408) 837-2270 *
> > > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [hidden email]
> > > > For additional commands, e-mail: [hidden email]
> > > >
> > > >
> > >
> > >
> > > --
> > > Jim Northrup  *  (408) 837-2270 *
> >
> >
>
>
>
> --
> Jim Northrup  *  (408) 837-2270 *
>
Reply | Threaded
Open this post in threaded view
|

RE: Running maven shade on a preexisting jar

mgainty
will do

thanks Benson

M-


> Date: Tue, 8 Jul 2014 11:49:44 -0400
> Subject: Re: Running maven shade on a preexisting jar
> From: [hidden email]
> To: [hidden email]
>
> Ignore the sales pitch and the unpacking complexity.
>
> 1. Make an ordinary new project with no source code.
>
> 2. List your jar as a dependency.
>
> 3. Configure shade. It can be configured to operate on dependencies.
> On Jul 8, 2014 6:30 AM, "james northrup" <[hidden email]> wrote:
>
> > MG: sure or
> > http://en.wikipedia.org/wiki/Java_Decompiler
> >
> >
> > On Mon, Jul 7, 2014 at 4:13 PM, Martin Gainty <[hidden email]> wrote:
> >
> > >
> > >
> > > > From: [hidden email]
> > > > Date: Mon, 7 Jul 2014 14:31:31 -0700
> > > > Subject: Re: Running maven shade on a preexisting jar
> > > > To: [hidden email]
> > > >
> > > > shade is a uber jar plugin.  there are 3 uber jar plugins that matter,
> > > > shade, maven-assembly, and proguard.
> > > >
> > > > for beginners:
> > > > all of them work more or less by merging a project into a  single new
> > jar
> > > > just reading the pom dependencies.
> > > >
> > > > maven assembly does the least work.  good for quick jobs
> > > >
> > > > shade-plugin sometimes does a good job but imho if it works once you
> > are
> > > > buying into a false sense of security and will be bitten as you grow a
> > > > project.
> > > >
> > > > proguard is industrial strength and imho returns the best result for
> > > > investing in rtfm.
> > > >
> > > > all of the above have a special configs to do parts and pieces.  a
> > > > beginner's mistake would be to pursue that course of action.  don't.
> > >  make
> > > > a simple uber-jar project with one output jar combined from all of the
> > > > input jars, and learn how to exclude collisions.
> > > >
> > > > if you have  some proprietary jar with no source spend some time with
> > jad
> > > > to make source and refactor your packages to do the above, "simple"
> > > > uber-jar
> > > MG>James i had some difficulty locating Java Decompiler (JAD) ..can i
> > > assume this is JAD repository we should reference?
> > > MG>http://varaneckas.com/jad/
> > > >
> > > >
> > > > On Mon, Jul 7, 2014 at 2:15 PM, Robert James <[hidden email]>
> > > wrote:
> > > >
> > > > > How do I run Maven Shade on a standalone jar (ie with no sources to
> > > > > build from)? Please realize that I'm a beginner to Maven.
> > > > >
> > > > > On 7/7/14, james northrup <[hidden email]> wrote:
> > > > > > hi shade can possibly juxtapose jar deps diffrently from one build
> > > to the
> > > > > > next in my experience. if you think you are having collisions you
> > > should
> > > > > > probably do 2 things
> > > > > >
> > > > > > 1) use <exclude> on the older jar from the older <dependency> to
> > > avoid
> > > > > the
> > > > > > collision
> > > > > > 2) see if proguard fixes what shade breaks, if shade stays broken
> > > after
> > > > > #1.
> > > > > >  it's pretty intense
> > > > > >
> > > > > >
> > > > > > On Mon, Jul 7, 2014 at 12:21 PM, Robert James <
> > > [hidden email]>
> > > > > > wrote:
> > > > > >
> > > > > >> I have a jar that I need to shade - that is, change the name of
> > many
> > > > > >> of the internal classes (to avoid conflicts with another jar)
> > except
> > > > > >> for a few classes which remain exposed.  The jar is already built,
> > > > > >> source is not at hand.  How can I use maven shade to shade that
> > jar?
> > > > > >>
> > > > > >> (Disclaimer: I'm a maven neophyte)
> > > > > >>
> > > > > >>
> > > ---------------------------------------------------------------------
> > > > > >> To unsubscribe, e-mail: [hidden email]
> > > > > >> For additional commands, e-mail: [hidden email]
> > > > > >>
> > > > > >>
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Jim Northrup  *  (408) 837-2270 *
> > > > > >
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: [hidden email]
> > > > > For additional commands, e-mail: [hidden email]
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Jim Northrup  *  (408) 837-2270 *
> > >
> > >
> >
> >
> >
> > --
> > Jim Northrup  *  (408) 837-2270 *
> >