You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by aalok singhvi <aa...@gmail.com> on 2015/11/01 22:34:13 UTC

Class size

Hello,
I have a basic question...

If i compile a simple hello world java program using javac in ant i get a
different size as compared to class compiled with maven plugin.
My java source and target it 1.6.

What is the reason. Can anyone help me with this. I will really appreciate
your help.

Thanks

-- 
Aalok Singhvi

RE: AW: Class size

Posted by Martin Gainty <mg...@hotmail.com>.
   <!-- classSize 221 when debug = false -->    <!-- classSize 312 when debug = true -->    <!-- classSize 312 when no debug parameter specified in configuration -->    <plugins>      <plugin>    	<groupId>org.apache.maven.plugins</groupId>    	<artifactId>maven-compiler-plugin</artifactId>    	<version>3.2</version>    	<configuration>    	 <source>1.8</source>    	 <target>1.8</target>    	</configuration>      </plugin>    </plugins>  </build>
apparently maven-compiler-plugin debug default is 'true'M-

From: mgainty@hotmail.com
To: user@ant.apache.org
Subject: RE: AW: Class size
Date: Wed, 4 Nov 2015 09:44:59 -0500





is there a way to disable debug with maven


> From: apache@materne.de
> To: user@ant.apache.org
> Subject: AW: Class size
> Date: Wed, 4 Nov 2015 08:34:37 +0100
> 
> I did an example and could see that behaviour.
> 
> build.xml
> ---------
> <project>
>   <mkdir dir="target/ant-classes"/>
>   <javac srcdir="src/main/java" destdir="target/ant-classes" includeantruntime="false" />
> </project>
> 
> 
> src/main/java/MyClass.java
> --------------------------
> public class MyClass {}
> 
> 
> pom.xml
> -------
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>de.materne.ant</groupId>
>   <artifactId>class-size</artifactId>
>   <version>1.0.0-SNAPSHOT</version>
> </project>
> 
> 
> Class-Size:
> Ant  : 122 Byte
> Maven: 246 Byte
> 
> 
> When adding 'debug="on"' to Ant's <javac> it produces also a 246 Byte class file.
> 
> 
> Jan
> 
> 
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Jan Matèrne (jhm) [mailto:apache@materne.de]
> > Gesendet: Dienstag, 3. November 2015 17:36
> > An: 'Ant Users List'
> > Betreff: AW: Class size
> > 
> > Next idea is using different compile flags, e.g. debug.
> > 
> > Jan
> > 
> > > -----Ursprüngliche Nachricht-----
> > > Von: aalok singhvi [mailto:aaloksinghvi@gmail.com]
> > > Gesendet: Dienstag, 3. November 2015 12:17
> > > An: Ant Users List
> > > Betreff: Re: Class size
> > >
> > > Yes...both are using same JDK.
> > >
> > > On Tue, Nov 3, 2015 at 6:16 AM, Jan Matèrne (jhm) <ap...@materne.de>
> > > wrote:
> > >
> > > > Are you sure that Maven and Ant are using the same JDK?
> > > >
> > > > Jan
> > > >
> > > > > -----Ursprüngliche Nachricht-----
> > > > > Von: aalok singhvi [mailto:aaloksinghvi@gmail.com]
> > > > > Gesendet: Sonntag, 1. November 2015 22:34
> > > > > An: Maven Users List; Ant Users List
> > > > > Betreff: Class size
> > > > >
> > > > > Hello,
> > > > > I have a basic question...
> > > > >
> > > > > If i compile a simple hello world java program using javac in ant
> > > > > i get a different size as compared to class compiled with maven
> > > plugin.
> > > > > My java source and target it 1.6.
> > > > >
> > > > > What is the reason. Can anyone help me with this. I will really
> > > > > appreciate your help.
> > > > >
> > > > > Thanks
> > > > >
> > > > > --
> > > > > Aalok Singhvi
> > > >
> > > >
> > > > -------------------------------------------------------------------
> > -
> > > > - To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For
> > > additional
> > > > commands, e-mail: user-help@ant.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > Aalok Singhvi
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional
> > commands, e-mail: user-help@ant.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
 		 	   		   		 	   		  

Re: AW: Class size

Posted by aalok singhvi <aa...@gmail.com>.
Yes.....

<groupId>org...mave</groupid>
<artifactId>maven.compiler.plugin<artifactid>
<version>2.6</version>
<configuration>
   <source>
   <target>
   <debug>false</debug>

</configuration>

On Wed, Nov 4, 2015 at 9:44 AM, Martin Gainty <mg...@hotmail.com> wrote:

>
> is there a way to disable debug with maven
>
>
> > From: apache@materne.de
> > To: user@ant.apache.org
> > Subject: AW: Class size
> > Date: Wed, 4 Nov 2015 08:34:37 +0100
> >
> > I did an example and could see that behaviour.
> >
> > build.xml
> > ---------
> > <project>
> >   <mkdir dir="target/ant-classes"/>
> >   <javac srcdir="src/main/java" destdir="target/ant-classes"
> includeantruntime="false" />
> > </project>
> >
> >
> > src/main/java/MyClass.java
> > --------------------------
> > public class MyClass {}
> >
> >
> > pom.xml
> > -------
> > <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"
> > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
> >   <modelVersion>4.0.0</modelVersion>
> >   <groupId>de.materne.ant</groupId>
> >   <artifactId>class-size</artifactId>
> >   <version>1.0.0-SNAPSHOT</version>
> > </project>
> >
> >
> > Class-Size:
> > Ant  : 122 Byte
> > Maven: 246 Byte
> >
> >
> > When adding 'debug="on"' to Ant's <javac> it produces also a 246 Byte
> class file.
> >
> >
> > Jan
> >
> >
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Jan Matèrne (jhm) [mailto:apache@materne.de]
> > > Gesendet: Dienstag, 3. November 2015 17:36
> > > An: 'Ant Users List'
> > > Betreff: AW: Class size
> > >
> > > Next idea is using different compile flags, e.g. debug.
> > >
> > > Jan
> > >
> > > > -----Ursprüngliche Nachricht-----
> > > > Von: aalok singhvi [mailto:aaloksinghvi@gmail.com]
> > > > Gesendet: Dienstag, 3. November 2015 12:17
> > > > An: Ant Users List
> > > > Betreff: Re: Class size
> > > >
> > > > Yes...both are using same JDK.
> > > >
> > > > On Tue, Nov 3, 2015 at 6:16 AM, Jan Matèrne (jhm) <apache@materne.de
> >
> > > > wrote:
> > > >
> > > > > Are you sure that Maven and Ant are using the same JDK?
> > > > >
> > > > > Jan
> > > > >
> > > > > > -----Ursprüngliche Nachricht-----
> > > > > > Von: aalok singhvi [mailto:aaloksinghvi@gmail.com]
> > > > > > Gesendet: Sonntag, 1. November 2015 22:34
> > > > > > An: Maven Users List; Ant Users List
> > > > > > Betreff: Class size
> > > > > >
> > > > > > Hello,
> > > > > > I have a basic question...
> > > > > >
> > > > > > If i compile a simple hello world java program using javac in ant
> > > > > > i get a different size as compared to class compiled with maven
> > > > plugin.
> > > > > > My java source and target it 1.6.
> > > > > >
> > > > > > What is the reason. Can anyone help me with this. I will really
> > > > > > appreciate your help.
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > --
> > > > > > Aalok Singhvi
> > > > >
> > > > >
> > > > > -------------------------------------------------------------------
> > > -
> > > > > - To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For
> > > > additional
> > > > > commands, e-mail: user-help@ant.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Aalok Singhvi
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional
> > > commands, e-mail: user-help@ant.apache.org
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
>
>



-- 
Aalok Singhvi

RE: AW: Class size

Posted by Martin Gainty <mg...@hotmail.com>.
is there a way to disable debug with maven


> From: apache@materne.de
> To: user@ant.apache.org
> Subject: AW: Class size
> Date: Wed, 4 Nov 2015 08:34:37 +0100
> 
> I did an example and could see that behaviour.
> 
> build.xml
> ---------
> <project>
>   <mkdir dir="target/ant-classes"/>
>   <javac srcdir="src/main/java" destdir="target/ant-classes" includeantruntime="false" />
> </project>
> 
> 
> src/main/java/MyClass.java
> --------------------------
> public class MyClass {}
> 
> 
> pom.xml
> -------
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>de.materne.ant</groupId>
>   <artifactId>class-size</artifactId>
>   <version>1.0.0-SNAPSHOT</version>
> </project>
> 
> 
> Class-Size:
> Ant  : 122 Byte
> Maven: 246 Byte
> 
> 
> When adding 'debug="on"' to Ant's <javac> it produces also a 246 Byte class file.
> 
> 
> Jan
> 
> 
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Jan Matèrne (jhm) [mailto:apache@materne.de]
> > Gesendet: Dienstag, 3. November 2015 17:36
> > An: 'Ant Users List'
> > Betreff: AW: Class size
> > 
> > Next idea is using different compile flags, e.g. debug.
> > 
> > Jan
> > 
> > > -----Ursprüngliche Nachricht-----
> > > Von: aalok singhvi [mailto:aaloksinghvi@gmail.com]
> > > Gesendet: Dienstag, 3. November 2015 12:17
> > > An: Ant Users List
> > > Betreff: Re: Class size
> > >
> > > Yes...both are using same JDK.
> > >
> > > On Tue, Nov 3, 2015 at 6:16 AM, Jan Matèrne (jhm) <ap...@materne.de>
> > > wrote:
> > >
> > > > Are you sure that Maven and Ant are using the same JDK?
> > > >
> > > > Jan
> > > >
> > > > > -----Ursprüngliche Nachricht-----
> > > > > Von: aalok singhvi [mailto:aaloksinghvi@gmail.com]
> > > > > Gesendet: Sonntag, 1. November 2015 22:34
> > > > > An: Maven Users List; Ant Users List
> > > > > Betreff: Class size
> > > > >
> > > > > Hello,
> > > > > I have a basic question...
> > > > >
> > > > > If i compile a simple hello world java program using javac in ant
> > > > > i get a different size as compared to class compiled with maven
> > > plugin.
> > > > > My java source and target it 1.6.
> > > > >
> > > > > What is the reason. Can anyone help me with this. I will really
> > > > > appreciate your help.
> > > > >
> > > > > Thanks
> > > > >
> > > > > --
> > > > > Aalok Singhvi
> > > >
> > > >
> > > > -------------------------------------------------------------------
> > -
> > > > - To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For
> > > additional
> > > > commands, e-mail: user-help@ant.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > Aalok Singhvi
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional
> > commands, e-mail: user-help@ant.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
 		 	   		  

AW: Class size

Posted by "Jan Matèrne (jhm)" <ap...@materne.de>.
I did an example and could see that behaviour.

build.xml
---------
<project>
  <mkdir dir="target/ant-classes"/>
  <javac srcdir="src/main/java" destdir="target/ant-classes" includeantruntime="false" />
</project>


src/main/java/MyClass.java
--------------------------
public class MyClass {}


pom.xml
-------
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>de.materne.ant</groupId>
  <artifactId>class-size</artifactId>
  <version>1.0.0-SNAPSHOT</version>
</project>


Class-Size:
Ant  : 122 Byte
Maven: 246 Byte


When adding 'debug="on"' to Ant's <javac> it produces also a 246 Byte class file.


Jan



> -----Ursprüngliche Nachricht-----
> Von: Jan Matèrne (jhm) [mailto:apache@materne.de]
> Gesendet: Dienstag, 3. November 2015 17:36
> An: 'Ant Users List'
> Betreff: AW: Class size
> 
> Next idea is using different compile flags, e.g. debug.
> 
> Jan
> 
> > -----Ursprüngliche Nachricht-----
> > Von: aalok singhvi [mailto:aaloksinghvi@gmail.com]
> > Gesendet: Dienstag, 3. November 2015 12:17
> > An: Ant Users List
> > Betreff: Re: Class size
> >
> > Yes...both are using same JDK.
> >
> > On Tue, Nov 3, 2015 at 6:16 AM, Jan Matèrne (jhm) <ap...@materne.de>
> > wrote:
> >
> > > Are you sure that Maven and Ant are using the same JDK?
> > >
> > > Jan
> > >
> > > > -----Ursprüngliche Nachricht-----
> > > > Von: aalok singhvi [mailto:aaloksinghvi@gmail.com]
> > > > Gesendet: Sonntag, 1. November 2015 22:34
> > > > An: Maven Users List; Ant Users List
> > > > Betreff: Class size
> > > >
> > > > Hello,
> > > > I have a basic question...
> > > >
> > > > If i compile a simple hello world java program using javac in ant
> > > > i get a different size as compared to class compiled with maven
> > plugin.
> > > > My java source and target it 1.6.
> > > >
> > > > What is the reason. Can anyone help me with this. I will really
> > > > appreciate your help.
> > > >
> > > > Thanks
> > > >
> > > > --
> > > > Aalok Singhvi
> > >
> > >
> > > -------------------------------------------------------------------
> -
> > > - To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For
> > additional
> > > commands, e-mail: user-help@ant.apache.org
> > >
> > >
> >
> >
> > --
> > Aalok Singhvi
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional
> commands, e-mail: user-help@ant.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


AW: Class size

Posted by "Jan Matèrne (jhm)" <ap...@materne.de>.
Next idea is using different compile flags, e.g. debug.

Jan

> -----Ursprüngliche Nachricht-----
> Von: aalok singhvi [mailto:aaloksinghvi@gmail.com]
> Gesendet: Dienstag, 3. November 2015 12:17
> An: Ant Users List
> Betreff: Re: Class size
> 
> Yes...both are using same JDK.
> 
> On Tue, Nov 3, 2015 at 6:16 AM, Jan Matèrne (jhm) <ap...@materne.de>
> wrote:
> 
> > Are you sure that Maven and Ant are using the same JDK?
> >
> > Jan
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: aalok singhvi [mailto:aaloksinghvi@gmail.com]
> > > Gesendet: Sonntag, 1. November 2015 22:34
> > > An: Maven Users List; Ant Users List
> > > Betreff: Class size
> > >
> > > Hello,
> > > I have a basic question...
> > >
> > > If i compile a simple hello world java program using javac in ant i
> > > get a different size as compared to class compiled with maven
> plugin.
> > > My java source and target it 1.6.
> > >
> > > What is the reason. Can anyone help me with this. I will really
> > > appreciate your help.
> > >
> > > Thanks
> > >
> > > --
> > > Aalok Singhvi
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For
> additional
> > commands, e-mail: user-help@ant.apache.org
> >
> >
> 
> 
> --
> Aalok Singhvi


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Class size

Posted by aalok singhvi <aa...@gmail.com>.
Yes...both are using same JDK.

On Tue, Nov 3, 2015 at 6:16 AM, Jan Matèrne (jhm) <ap...@materne.de> wrote:

> Are you sure that Maven and Ant are using the same JDK?
>
> Jan
>
> > -----Ursprüngliche Nachricht-----
> > Von: aalok singhvi [mailto:aaloksinghvi@gmail.com]
> > Gesendet: Sonntag, 1. November 2015 22:34
> > An: Maven Users List; Ant Users List
> > Betreff: Class size
> >
> > Hello,
> > I have a basic question...
> >
> > If i compile a simple hello world java program using javac in ant i get
> > a different size as compared to class compiled with maven plugin.
> > My java source and target it 1.6.
> >
> > What is the reason. Can anyone help me with this. I will really
> > appreciate your help.
> >
> > Thanks
> >
> > --
> > Aalok Singhvi
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


-- 
Aalok Singhvi

AW: Class size

Posted by "Jan Matèrne (jhm)" <ap...@materne.de>.
Are you sure that Maven and Ant are using the same JDK?

Jan

> -----Ursprüngliche Nachricht-----
> Von: aalok singhvi [mailto:aaloksinghvi@gmail.com]
> Gesendet: Sonntag, 1. November 2015 22:34
> An: Maven Users List; Ant Users List
> Betreff: Class size
> 
> Hello,
> I have a basic question...
> 
> If i compile a simple hello world java program using javac in ant i get
> a different size as compared to class compiled with maven plugin.
> My java source and target it 1.6.
> 
> What is the reason. Can anyone help me with this. I will really
> appreciate your help.
> 
> Thanks
> 
> --
> Aalok Singhvi


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Class size

Posted by Bernd Eckenfels <ec...@zusammenkunft.net>.
Am Sun, 1 Nov 2015 16:34:13 -0500
schrieb aalok singhvi <aa...@gmail.com>:

> Hello,
> I have a basic question...
> 
> If i compile a simple hello world java program using javac in ant i
> get a different size as compared to class compiled with maven plugin.
> My java source and target it 1.6.
> 
> What is the reason. Can anyone help me with this. I will really
> appreciate your help.

There are multiple compiler settings which can influence class size.
Including debug information (source file, line, local vars - defaults
to on in Maven and off on Ant) and I guess presence of some annoation
processors.

Are you using the same java version for compiling with Ant and Maven?
(and youare sure you do not use eclipse or jikes?
https://maven.apache.org/plugins/maven-compiler-plugin/non-javac-compilers.html)

Ithink you could dump the classes with "javap -l -c -s -p -verbose" to
see potential differences. How big of a difference do you see?

Gruss
Bernd

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