You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Magnanao, Hector" <he...@sap.com> on 2015/09/01 22:29:41 UTC

maven jar versus ant jar

I was finally able to build my snapshot jar using maven after going thru all the missing dependencies.  But what I noticed is that the maven jar is much larger than my ant jar.  Can anybody tell me why this is so ?  Should they be different in sizes after  converting the build to maven ? what should I be looking for causes of differences  ?

Hector Magnanao Jr.
SCM Analyst

Fieldglass, Inc.
O: (331) 702-6142
M: (773) 474-3051
Hector.magnanao@sap.com
www.fieldglass.com

Fieldglass is now part of SAP

This email contains confidential information.  If you are not the intended recipient, do not read, distribute or reproduce this transmission (including any attachments). If you have received this email in error, please notify the sender by email reply.


Re: maven jar versus ant jar

Posted by Wayne Fay <wa...@gmail.com>.
Greg T. sent you this reply a few days back when you asked this
question previously:

> jar tvf abc.jar

That is (still) the answer to your question.

Wayne

On Tue, Sep 1, 2015 at 3:29 PM, Magnanao, Hector
<he...@sap.com> wrote:
> I was finally able to build my snapshot jar using maven after going thru all the missing dependencies.  But what I noticed is that the maven jar is much larger than my ant jar.  Can anybody tell me why this is so ?  Should they be different in sizes after  converting the build to maven ? what should I be looking for causes of differences  ?
>
> Hector Magnanao Jr.
> SCM Analyst
>
> Fieldglass, Inc.
> O: (331) 702-6142
> M: (773) 474-3051
> Hector.magnanao@sap.com
> www.fieldglass.com
>
> Fieldglass is now part of SAP
>
> This email contains confidential information.  If you are not the intended recipient, do not read, distribute or reproduce this transmission (including any attachments). If you have received this email in error, please notify the sender by email reply.
>

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


RE: maven jar versus ant jar

Posted by "Magnanao, Hector" <he...@sap.com>.
Hi Greg,

I was able to resolve the problem here with assistance from a developer.  The jar was being packaged because it was being placed under my resources folder.  So to fix it, I had to put an exclude clause in my pom file.  Answering your questions below, I installed it using mvn install and the jar I'm installing is a java jar.  I needed to install the jar locally in order for my compile to work.  I couldn't find the jar in any maven repository so I installed it locally.  Here is the solution that worked for me.  When I changed my pom file to do an exclude, I did a mvn clean and the rebuild and now my jar is much smaller than before.

<resources>
    <resource>
	    <directory>src/resources</directory>
        <excludes>
            <exclude>**/resources/aspose.pdf-3.2.jdk16.jar</exclude>
        </excludes>
    </resource>
 </resources>

Thanks,
Hector

-----Original Message-----
From: Greg Trasuk [mailto:trasukg@stratuscom.com] 
Sent: Wednesday, September 02, 2015 10:17 AM
To: Maven Users List
Subject: Re: maven jar versus ant jar

Hi Hector:

Could you describe in very precise terms how you “installed it locally”?  That might help us understand the problem.  And perhaps you’ve already mentioned it, but what kind of jar file are you actually building?  What does it get installed into?

Cheers,

Greg Trasuk

> On Sep 2, 2015, at 10:37 AM, Magnanao, Hector <he...@sap.com> wrote:
> 
> I've done "mvn clean" several times and built again.  It still keeps getting packaged in my jar.  The only difference with this dependency is that I installed it locally.  My pom just declares it as a dependency.  Do I need to clean up my .m2 directory to start fresh ?
> 
> -----Original Message-----
> From: Wayne Fay [mailto:waynefay@gmail.com] 
> Sent: Tuesday, September 01, 2015 5:31 PM
> To: Maven Users List
> Subject: Re: maven jar versus ant jar
> 
> Try "mvn clean" first to be sure you didn't accidentally put the
> contents of that jar file in target/ and forget about it. Then build
> again.
> 
> If it is still large and includes those files, there must be something
> in your pom file that is causing it to occur. Very hard to debug your
> build without seeing these details.
> 
> Wayne
> 
> On Tue, Sep 1, 2015 at 4:41 PM, Magnanao, Hector
> <he...@sap.com> wrote:
>> I found out why my maven jar is much bigger. It looks like it's including a dependency jar inside the SNAPSHOT jar.  I installed this jar locally so I can compile but now it's being included in the build itself.  So how do I exclude it when I do a mvn package ?
>> 
>> -----Original Message-----
>> From: Tobias Hochgürtel [mailto:tobias.hochguertel@googlemail.com]
>> Sent: Tuesday, September 01, 2015 3:35 PM
>> To: Maven Users List
>> Subject: Re: maven jar versus ant jar
>> 
>> You can unpack the jar files to see what they include. This should help
>> you to find out what they makes fat or slimmer as the other one.
>> 
>> HTH
>> Tobias
>> 
>> Am 01.09.2015 um 22:29 schrieb Magnanao, Hector:
>>> I was finally able to build my snapshot jar using maven after going thru all the missing dependencies.  But what I noticed is that the maven jar is much larger than my ant jar.  Can anybody tell me why this is so ?  Should they be different in sizes after  converting the build to maven ? what should I be looking for causes of differences  ?
>>> 
>>> Hector Magnanao Jr.
>>> SCM Analyst
>>> 
>>> Fieldglass, Inc.
>>> O: (331) 702-6142
>>> M: (773) 474-3051
>>> Hector.magnanao@sap.com
>>> www.fieldglass.com
>>> 
>>> Fieldglass is now part of SAP
>>> 
>>> This email contains confidential information.  If you are not the intended recipient, do not read, distribute or reproduce this transmission (including any attachments). If you have received this email in error, please notify the sender by email reply.
>>> 
>>> 
>> 
>> --
>> Tobias Hochgürtel
>> 
>> 
>> 
>> Tobias Hochgürtel
>> Alt-Stralau 15
>> 10245 Berlin
>> 
>> Tel. 03029 0493-39
>> Fax  03026 9488-22
>> E-Mail: tobias.hochguertel@googlemail.com
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


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


Re: maven jar versus ant jar

Posted by Greg Trasuk <tr...@stratuscom.com>.
Hi Hector:

Could you describe in very precise terms how you “installed it locally”?  That might help us understand the problem.  And perhaps you’ve already mentioned it, but what kind of jar file are you actually building?  What does it get installed into?

Cheers,

Greg Trasuk

> On Sep 2, 2015, at 10:37 AM, Magnanao, Hector <he...@sap.com> wrote:
> 
> I've done "mvn clean" several times and built again.  It still keeps getting packaged in my jar.  The only difference with this dependency is that I installed it locally.  My pom just declares it as a dependency.  Do I need to clean up my .m2 directory to start fresh ?
> 
> -----Original Message-----
> From: Wayne Fay [mailto:waynefay@gmail.com] 
> Sent: Tuesday, September 01, 2015 5:31 PM
> To: Maven Users List
> Subject: Re: maven jar versus ant jar
> 
> Try "mvn clean" first to be sure you didn't accidentally put the
> contents of that jar file in target/ and forget about it. Then build
> again.
> 
> If it is still large and includes those files, there must be something
> in your pom file that is causing it to occur. Very hard to debug your
> build without seeing these details.
> 
> Wayne
> 
> On Tue, Sep 1, 2015 at 4:41 PM, Magnanao, Hector
> <he...@sap.com> wrote:
>> I found out why my maven jar is much bigger. It looks like it's including a dependency jar inside the SNAPSHOT jar.  I installed this jar locally so I can compile but now it's being included in the build itself.  So how do I exclude it when I do a mvn package ?
>> 
>> -----Original Message-----
>> From: Tobias Hochgürtel [mailto:tobias.hochguertel@googlemail.com]
>> Sent: Tuesday, September 01, 2015 3:35 PM
>> To: Maven Users List
>> Subject: Re: maven jar versus ant jar
>> 
>> You can unpack the jar files to see what they include. This should help
>> you to find out what they makes fat or slimmer as the other one.
>> 
>> HTH
>> Tobias
>> 
>> Am 01.09.2015 um 22:29 schrieb Magnanao, Hector:
>>> I was finally able to build my snapshot jar using maven after going thru all the missing dependencies.  But what I noticed is that the maven jar is much larger than my ant jar.  Can anybody tell me why this is so ?  Should they be different in sizes after  converting the build to maven ? what should I be looking for causes of differences  ?
>>> 
>>> Hector Magnanao Jr.
>>> SCM Analyst
>>> 
>>> Fieldglass, Inc.
>>> O: (331) 702-6142
>>> M: (773) 474-3051
>>> Hector.magnanao@sap.com
>>> www.fieldglass.com
>>> 
>>> Fieldglass is now part of SAP
>>> 
>>> This email contains confidential information.  If you are not the intended recipient, do not read, distribute or reproduce this transmission (including any attachments). If you have received this email in error, please notify the sender by email reply.
>>> 
>>> 
>> 
>> --
>> Tobias Hochgürtel
>> 
>> 
>> 
>> Tobias Hochgürtel
>> Alt-Stralau 15
>> 10245 Berlin
>> 
>> Tel. 03029 0493-39
>> Fax  03026 9488-22
>> E-Mail: tobias.hochguertel@googlemail.com
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


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


RE: maven jar versus ant jar

Posted by "Magnanao, Hector" <he...@sap.com>.
I've done "mvn clean" several times and built again.  It still keeps getting packaged in my jar.  The only difference with this dependency is that I installed it locally.  My pom just declares it as a dependency.  Do I need to clean up my .m2 directory to start fresh ?

-----Original Message-----
From: Wayne Fay [mailto:waynefay@gmail.com] 
Sent: Tuesday, September 01, 2015 5:31 PM
To: Maven Users List
Subject: Re: maven jar versus ant jar

Try "mvn clean" first to be sure you didn't accidentally put the
contents of that jar file in target/ and forget about it. Then build
again.

If it is still large and includes those files, there must be something
in your pom file that is causing it to occur. Very hard to debug your
build without seeing these details.

Wayne

On Tue, Sep 1, 2015 at 4:41 PM, Magnanao, Hector
<he...@sap.com> wrote:
> I found out why my maven jar is much bigger. It looks like it's including a dependency jar inside the SNAPSHOT jar.  I installed this jar locally so I can compile but now it's being included in the build itself.  So how do I exclude it when I do a mvn package ?
>
> -----Original Message-----
> From: Tobias Hochgürtel [mailto:tobias.hochguertel@googlemail.com]
> Sent: Tuesday, September 01, 2015 3:35 PM
> To: Maven Users List
> Subject: Re: maven jar versus ant jar
>
> You can unpack the jar files to see what they include. This should help
> you to find out what they makes fat or slimmer as the other one.
>
> HTH
> Tobias
>
> Am 01.09.2015 um 22:29 schrieb Magnanao, Hector:
>> I was finally able to build my snapshot jar using maven after going thru all the missing dependencies.  But what I noticed is that the maven jar is much larger than my ant jar.  Can anybody tell me why this is so ?  Should they be different in sizes after  converting the build to maven ? what should I be looking for causes of differences  ?
>>
>> Hector Magnanao Jr.
>> SCM Analyst
>>
>> Fieldglass, Inc.
>> O: (331) 702-6142
>> M: (773) 474-3051
>> Hector.magnanao@sap.com
>> www.fieldglass.com
>>
>> Fieldglass is now part of SAP
>>
>> This email contains confidential information.  If you are not the intended recipient, do not read, distribute or reproduce this transmission (including any attachments). If you have received this email in error, please notify the sender by email reply.
>>
>>
>
> --
> Tobias Hochgürtel
>
>
>
> Tobias Hochgürtel
> Alt-Stralau 15
> 10245 Berlin
>
> Tel. 03029 0493-39
> Fax  03026 9488-22
> E-Mail: tobias.hochguertel@googlemail.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

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


Re: maven jar versus ant jar

Posted by Wayne Fay <wa...@gmail.com>.
Try "mvn clean" first to be sure you didn't accidentally put the
contents of that jar file in target/ and forget about it. Then build
again.

If it is still large and includes those files, there must be something
in your pom file that is causing it to occur. Very hard to debug your
build without seeing these details.

Wayne

On Tue, Sep 1, 2015 at 4:41 PM, Magnanao, Hector
<he...@sap.com> wrote:
> I found out why my maven jar is much bigger. It looks like it's including a dependency jar inside the SNAPSHOT jar.  I installed this jar locally so I can compile but now it's being included in the build itself.  So how do I exclude it when I do a mvn package ?
>
> -----Original Message-----
> From: Tobias Hochgürtel [mailto:tobias.hochguertel@googlemail.com]
> Sent: Tuesday, September 01, 2015 3:35 PM
> To: Maven Users List
> Subject: Re: maven jar versus ant jar
>
> You can unpack the jar files to see what they include. This should help
> you to find out what they makes fat or slimmer as the other one.
>
> HTH
> Tobias
>
> Am 01.09.2015 um 22:29 schrieb Magnanao, Hector:
>> I was finally able to build my snapshot jar using maven after going thru all the missing dependencies.  But what I noticed is that the maven jar is much larger than my ant jar.  Can anybody tell me why this is so ?  Should they be different in sizes after  converting the build to maven ? what should I be looking for causes of differences  ?
>>
>> Hector Magnanao Jr.
>> SCM Analyst
>>
>> Fieldglass, Inc.
>> O: (331) 702-6142
>> M: (773) 474-3051
>> Hector.magnanao@sap.com
>> www.fieldglass.com
>>
>> Fieldglass is now part of SAP
>>
>> This email contains confidential information.  If you are not the intended recipient, do not read, distribute or reproduce this transmission (including any attachments). If you have received this email in error, please notify the sender by email reply.
>>
>>
>
> --
> Tobias Hochgürtel
>
>
>
> Tobias Hochgürtel
> Alt-Stralau 15
> 10245 Berlin
>
> Tel. 03029 0493-39
> Fax  03026 9488-22
> E-Mail: tobias.hochguertel@googlemail.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

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


Re: maven jar versus ant jar

Posted by Ron Wheeler <rw...@artifact-software.com>.
Putting "provided" scope on a dependency tells Maven that you need the 
dependency at compile time but do not need it in the jar since you are 
going to provide the dependency on the classpath yourself.

Very common when you are building a webapp and you have a bunch of jars 
already loaded into the servlet container (tomcat for example) and you 
don't need it in every webapp war file as well.

Ron

On 01/09/2015 5:41 PM, Magnanao, Hector wrote:
> I found out why my maven jar is much bigger. It looks like it's including a dependency jar inside the SNAPSHOT jar.  I installed this jar locally so I can compile but now it's being included in the build itself.  So how do I exclude it when I do a mvn package ?
>
> -----Original Message-----
> From: Tobias Hochgürtel [mailto:tobias.hochguertel@googlemail.com]
> Sent: Tuesday, September 01, 2015 3:35 PM
> To: Maven Users List
> Subject: Re: maven jar versus ant jar
>
> You can unpack the jar files to see what they include. This should help
> you to find out what they makes fat or slimmer as the other one.
>
> HTH
> Tobias
>
> Am 01.09.2015 um 22:29 schrieb Magnanao, Hector:
>> I was finally able to build my snapshot jar using maven after going thru all the missing dependencies.  But what I noticed is that the maven jar is much larger than my ant jar.  Can anybody tell me why this is so ?  Should they be different in sizes after  converting the build to maven ? what should I be looking for causes of differences  ?
>>
>> Hector Magnanao Jr.
>> SCM Analyst
>>
>> Fieldglass, Inc.
>> O: (331) 702-6142
>> M: (773) 474-3051
>> Hector.magnanao@sap.com
>> www.fieldglass.com
>>
>> Fieldglass is now part of SAP
>>
>> This email contains confidential information.  If you are not the intended recipient, do not read, distribute or reproduce this transmission (including any attachments). If you have received this email in error, please notify the sender by email reply.
>>
>>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


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


RE: maven jar versus ant jar

Posted by "Magnanao, Hector" <he...@sap.com>.
I found out why my maven jar is much bigger. It looks like it's including a dependency jar inside the SNAPSHOT jar.  I installed this jar locally so I can compile but now it's being included in the build itself.  So how do I exclude it when I do a mvn package ?

-----Original Message-----
From: Tobias Hochgürtel [mailto:tobias.hochguertel@googlemail.com] 
Sent: Tuesday, September 01, 2015 3:35 PM
To: Maven Users List
Subject: Re: maven jar versus ant jar

You can unpack the jar files to see what they include. This should help
you to find out what they makes fat or slimmer as the other one.

HTH
Tobias

Am 01.09.2015 um 22:29 schrieb Magnanao, Hector:
> I was finally able to build my snapshot jar using maven after going thru all the missing dependencies.  But what I noticed is that the maven jar is much larger than my ant jar.  Can anybody tell me why this is so ?  Should they be different in sizes after  converting the build to maven ? what should I be looking for causes of differences  ?
>
> Hector Magnanao Jr.
> SCM Analyst
>
> Fieldglass, Inc.
> O: (331) 702-6142
> M: (773) 474-3051
> Hector.magnanao@sap.com
> www.fieldglass.com
>
> Fieldglass is now part of SAP
>
> This email contains confidential information.  If you are not the intended recipient, do not read, distribute or reproduce this transmission (including any attachments). If you have received this email in error, please notify the sender by email reply.
>
>

-- 
Tobias Hochgürtel



Tobias Hochgürtel
Alt-Stralau 15
10245 Berlin

Tel. 03029 0493-39
Fax  03026 9488-22
E-Mail: tobias.hochguertel@googlemail.com


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


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


Re: maven jar versus ant jar

Posted by Tobias Hochgürtel <to...@googlemail.com>.
You can unpack the jar files to see what they include. This should help
you to find out what they makes fat or slimmer as the other one.

HTH
Tobias

Am 01.09.2015 um 22:29 schrieb Magnanao, Hector:
> I was finally able to build my snapshot jar using maven after going thru all the missing dependencies.  But what I noticed is that the maven jar is much larger than my ant jar.  Can anybody tell me why this is so ?  Should they be different in sizes after  converting the build to maven ? what should I be looking for causes of differences  ?
>
> Hector Magnanao Jr.
> SCM Analyst
>
> Fieldglass, Inc.
> O: (331) 702-6142
> M: (773) 474-3051
> Hector.magnanao@sap.com
> www.fieldglass.com
>
> Fieldglass is now part of SAP
>
> This email contains confidential information.  If you are not the intended recipient, do not read, distribute or reproduce this transmission (including any attachments). If you have received this email in error, please notify the sender by email reply.
>
>

-- 
Tobias Hochgürtel



Tobias Hochgürtel
Alt-Stralau 15
10245 Berlin

Tel. 03029 0493-39
Fax  03026 9488-22
E-Mail: tobias.hochguertel@googlemail.com


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