You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Grzegorz Solecki (JIRA)" <ji...@codehaus.org> on 2010/02/05 23:30:55 UTC

[jira] Created: (MCOMPILER-114) Setting the debug option to false still compiles the code with line numbers resulting in increased class file.

Setting the debug option to false still compiles the code with line numbers resulting in increased class file.
--------------------------------------------------------------------------------------------------------------

                 Key: MCOMPILER-114
                 URL: http://jira.codehaus.org/browse/MCOMPILER-114
             Project: Maven 2.x Compiler Plugin
          Issue Type: Bug
    Affects Versions: 2.1
         Environment: Windows XP Professional Version 5.1.2600 Service Pack 3 Build 2600, Dell OptiPlex GX280, Total Physical Memory 4,096.00 MB



            Reporter: Grzegorz Solecki
         Attachments: TestApp.zip

Given the following example:
{code:title=Bar.java|borderStyle=solid}
public class Main {
   public static void main(String[] args) {
      for (StackTraceElement stackTraceElement : Thread.currentThread().getStackTrace())
         System.out.println(stackTraceElement);
   }
}
{code} 
and pom.xml
{code: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/maven-v4_0_0.xsd">

   <modelVersion>4.0.0</modelVersion>
   <groupId>com.greg</groupId>
   <artifactId>TestApp</artifactId>
   <version>1</version>
   <build>
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
               <debug>none</debug>
               <source>1.5</source>
               <target>1.5</target>
            </configuration>
         </plugin>
      </plugins>
   </build>
</project>
{code} 

after compiling and running we get:

{panel:title=cmd}
{noformat}
{TestApp}\target\classes>dir Main.class
05/02/2010  XX:XX               564 Main.class

{TestApp}\target\classes>java -cp . Main
java.lang.Thread.dumpThreads(Native Method)
java.lang.Thread.getStackTrace(Thread.java:1383)
Main.main(Main.java:3)
{noformat} 
{panel}

*NOTE !!!: the number of line (Main.java:3) has been shown*

However when you compile the same java code using the javac we get:
{panel:title=cmd}
{noformat}
{TestApp}\src\main\java>javac -g:none -source 1.5 -target 1.5 Main.java

{TestApp}\src\main\java>dir Main.class
05/02/2010  XX:XX               477 Main.class

{TestApp}\src\main\java>java -cp . Main
java.lang.Thread.dumpThreads(Native Method)
java.lang.Thread.getStackTrace(Thread.java:1383)
Main.main(Unknown Source){noformat} 
{panel}

*NOTE !!!: the number of line has not been shown*

Please find the whole sample project in Eclipse that uses m2eclipse plugin, that is configured for using external maven 2.2.1

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-114) Setting the debug option to false still compiles the code with line numbers resulting in increased class file.

Posted by "Stephen Bannasch (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=242305#action_242305 ] 

Stephen Bannasch commented on MCOMPILER-114:
--------------------------------------------

Ahh ... also setting the debuglevel=none parameter is the solution:

_The examples below refer to a jar I am building: mw.jar with a nominal size of 7.2 MB_

{noformat}
mvn -Dmaven.compiler.debug=true -Dmaven.compiler.debuglevel=none
{noformat}

results in an mw.jar that is just 5.4 MB.

So ... the logic is:

During a regular mvn compile maven.compiler.debug is true and the debug resources are added... so far so good, that makes stacktraces useful.

{noformat}
mw.jar => 7.2 MB
{noformat}

Setting maven.compiler.debug to false makes the compiled code smaller ... but some debug stuff is still there:

{noformat}
mw.jar => 6.3 MB
{noformat}

Setting maven.compiler.debuglevel to 'none' results in the smallest code size:

{noformat}
mw.jar => 5.4 MB
{noformat}

But only if maven.compiler.debug is also set to true!  If maven.compiler.debug is false and  maven.compiler.debuglevel is none:

{noformat}
mw.jar => 6.3 MB
{noformat}

http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#debuglevel

{quote}
  Keyword list to be appended to the -g command-line switch.
  Legal values are none or a comma-separated list of the
  following keywords: lines, vars, and source. If debuglevel is
  not specified, by default, nothing will be appended to -g. If
  debug is not turned on, this attribute will be ignored.
{quote}

Maven is special ...


> Setting the debug option to false still compiles the code with line numbers resulting in increased class file.
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-114
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-114
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Windows XP Professional Version 5.1.2600 Service Pack 3 Build 2600, Dell OptiPlex GX280, Total Physical Memory 4,096.00 MB
>            Reporter: Grzegorz Solecki
>         Attachments: TestApp.zip
>
>
> Given the following example:
> {code:title=Bar.java|borderStyle=solid}
> public class Main {
>    public static void main(String[] args) {
>       for (StackTraceElement stackTraceElement : Thread.currentThread().getStackTrace())
>          System.out.println(stackTraceElement);
>    }
> }
> {code} 
> and pom.xml
> {code: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/maven-v4_0_0.xsd">
>    <modelVersion>4.0.0</modelVersion>
>    <groupId>com.greg</groupId>
>    <artifactId>TestApp</artifactId>
>    <version>1</version>
>    <build>
>       <plugins>
>          <plugin>
>             <groupId>org.apache.maven.plugins</groupId>
>             <artifactId>maven-compiler-plugin</artifactId>
>             <configuration>
>                <debug>none</debug>
>                <source>1.5</source>
>                <target>1.5</target>
>             </configuration>
>          </plugin>
>       </plugins>
>    </build>
> </project>
> {code} 
> after compiling and running we get:
> {panel:title=cmd}
> {noformat}
> {TestApp}\target\classes>dir Main.class
> 05/02/2010  XX:XX               564 Main.class
> {TestApp}\target\classes>java -cp . Main
> java.lang.Thread.dumpThreads(Native Method)
> java.lang.Thread.getStackTrace(Thread.java:1383)
> Main.main(Main.java:3)
> {noformat} 
> {panel}
> *NOTE !!!: the number of line (Main.java:3) has been shown*
> However when you compile the same java code using the javac we get:
> {panel:title=cmd}
> {noformat}
> {TestApp}\src\main\java>javac -g:none -source 1.5 -target 1.5 Main.java
> {TestApp}\src\main\java>dir Main.class
> 05/02/2010  XX:XX               477 Main.class
> {TestApp}\src\main\java>java -cp . Main
> java.lang.Thread.dumpThreads(Native Method)
> java.lang.Thread.getStackTrace(Thread.java:1383)
> Main.main(Unknown Source){noformat} 
> {panel}
> *NOTE !!!: the number of line has not been shown*
> Please find the whole sample project in Eclipse that uses m2eclipse plugin, that is configured for using external maven 2.2.1

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-114) Setting the debug option to false still compiles the code with line numbers resulting in increased class file.

Posted by "Stephen Bannasch (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=243746#action_243746 ] 

Stephen Bannasch commented on MCOMPILER-114:
--------------------------------------------

David, Which versions of the compiler plugin are you using?

I was using v2.3.2 in my tests above.

{code}
...
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>2.3.2</version>
{code}

> Setting the debug option to false still compiles the code with line numbers resulting in increased class file.
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-114
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-114
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Windows XP Professional Version 5.1.2600 Service Pack 3 Build 2600, Dell OptiPlex GX280, Total Physical Memory 4,096.00 MB
>            Reporter: Grzegorz Solecki
>         Attachments: TestApp.zip
>
>
> Given the following example:
> {code:title=Bar.java|borderStyle=solid}
> public class Main {
>    public static void main(String[] args) {
>       for (StackTraceElement stackTraceElement : Thread.currentThread().getStackTrace())
>          System.out.println(stackTraceElement);
>    }
> }
> {code} 
> and pom.xml
> {code: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/maven-v4_0_0.xsd">
>    <modelVersion>4.0.0</modelVersion>
>    <groupId>com.greg</groupId>
>    <artifactId>TestApp</artifactId>
>    <version>1</version>
>    <build>
>       <plugins>
>          <plugin>
>             <groupId>org.apache.maven.plugins</groupId>
>             <artifactId>maven-compiler-plugin</artifactId>
>             <configuration>
>                <debug>none</debug>
>                <source>1.5</source>
>                <target>1.5</target>
>             </configuration>
>          </plugin>
>       </plugins>
>    </build>
> </project>
> {code} 
> after compiling and running we get:
> {panel:title=cmd}
> {noformat}
> {TestApp}\target\classes>dir Main.class
> 05/02/2010  XX:XX               564 Main.class
> {TestApp}\target\classes>java -cp . Main
> java.lang.Thread.dumpThreads(Native Method)
> java.lang.Thread.getStackTrace(Thread.java:1383)
> Main.main(Main.java:3)
> {noformat} 
> {panel}
> *NOTE !!!: the number of line (Main.java:3) has been shown*
> However when you compile the same java code using the javac we get:
> {panel:title=cmd}
> {noformat}
> {TestApp}\src\main\java>javac -g:none -source 1.5 -target 1.5 Main.java
> {TestApp}\src\main\java>dir Main.class
> 05/02/2010  XX:XX               477 Main.class
> {TestApp}\src\main\java>java -cp . Main
> java.lang.Thread.dumpThreads(Native Method)
> java.lang.Thread.getStackTrace(Thread.java:1383)
> Main.main(Unknown Source){noformat} 
> {panel}
> *NOTE !!!: the number of line has not been shown*
> Please find the whole sample project in Eclipse that uses m2eclipse plugin, that is configured for using external maven 2.2.1

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-114) Setting the debug option to false still compiles the code with line numbers resulting in increased class file.

Posted by "Stephen Bannasch (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=242303#action_242303 ] 

Stephen Bannasch commented on MCOMPILER-114:
--------------------------------------------

The forensics on the maven-generated version of the class files above was generated with v2.0.2 of the compiler plugin.

In that example (where there was a partial reduction in compiled class size) I was passing in the debug=false parameter on the command line:

{noformat}
$ mvn clean; mvn -Dmaven.compiler.debug=true
{noformat}

I just tried with v2.3.2 of the compiler plugin and running the same command from a shell now produces compiled code with *all* the additional debug resources.

Setting {{<compilerArgument>-g:none</compilerArgument>}} still results in compilation without adding debug resources when using v2.3.2 of the compiler plugin


> Setting the debug option to false still compiles the code with line numbers resulting in increased class file.
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-114
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-114
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Windows XP Professional Version 5.1.2600 Service Pack 3 Build 2600, Dell OptiPlex GX280, Total Physical Memory 4,096.00 MB
>            Reporter: Grzegorz Solecki
>         Attachments: TestApp.zip
>
>
> Given the following example:
> {code:title=Bar.java|borderStyle=solid}
> public class Main {
>    public static void main(String[] args) {
>       for (StackTraceElement stackTraceElement : Thread.currentThread().getStackTrace())
>          System.out.println(stackTraceElement);
>    }
> }
> {code} 
> and pom.xml
> {code: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/maven-v4_0_0.xsd">
>    <modelVersion>4.0.0</modelVersion>
>    <groupId>com.greg</groupId>
>    <artifactId>TestApp</artifactId>
>    <version>1</version>
>    <build>
>       <plugins>
>          <plugin>
>             <groupId>org.apache.maven.plugins</groupId>
>             <artifactId>maven-compiler-plugin</artifactId>
>             <configuration>
>                <debug>none</debug>
>                <source>1.5</source>
>                <target>1.5</target>
>             </configuration>
>          </plugin>
>       </plugins>
>    </build>
> </project>
> {code} 
> after compiling and running we get:
> {panel:title=cmd}
> {noformat}
> {TestApp}\target\classes>dir Main.class
> 05/02/2010  XX:XX               564 Main.class
> {TestApp}\target\classes>java -cp . Main
> java.lang.Thread.dumpThreads(Native Method)
> java.lang.Thread.getStackTrace(Thread.java:1383)
> Main.main(Main.java:3)
> {noformat} 
> {panel}
> *NOTE !!!: the number of line (Main.java:3) has been shown*
> However when you compile the same java code using the javac we get:
> {panel:title=cmd}
> {noformat}
> {TestApp}\src\main\java>javac -g:none -source 1.5 -target 1.5 Main.java
> {TestApp}\src\main\java>dir Main.class
> 05/02/2010  XX:XX               477 Main.class
> {TestApp}\src\main\java>java -cp . Main
> java.lang.Thread.dumpThreads(Native Method)
> java.lang.Thread.getStackTrace(Thread.java:1383)
> Main.main(Unknown Source){noformat} 
> {panel}
> *NOTE !!!: the number of line has not been shown*
> Please find the whole sample project in Eclipse that uses m2eclipse plugin, that is configured for using external maven 2.2.1

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-114) Setting the debug option to false still compiles the code with line numbers resulting in increased class file.

Posted by "Stephen Bannasch (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=242301#action_242301 ] 

Stephen Bannasch commented on MCOMPILER-114:
--------------------------------------------

When I compile with {{-Dmaven.compiler.debug=true}} I *do* get a reduction in size however compiled code is still 10-20% larger than that compiled by either ant with debug=false or javac with the '-g:none' option.

Here's a closer look at the same class extracted from jars created with maven and ant using debug-false:

{code}
$ javap -l -verbose -c org/concord/mw2d/ActionStateEvent
{code}

The maven-generated class had three constants not in the ant-generated class:

{noformat}
const #12 = Asciz	LineNumberTable;
const #16 = Asciz	SourceFile;
const #17 = Asciz	ActionStateEvent.java;
{noformat}

In addition each method in the class had a LineNumberTable like this:

{code}
LineNumberTable:
 line 30: 0
 line 31: 5
 line 32: 10
 line 33: 15
{code}

It seems the only way to get maven to compile without the debugging resources is to add 'g:none' as a compiler argument for javac ... and this doesn't work from the command line -- it only works if it is in the configuration element for the maven-compiler-plugin in the pom like this:

{code}
<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <configuration>
        <compilerArgument>-g:none</compilerArgument>
        <source>1.5</source>
        <target>1.5</target>
      </configuration>
    </plugin>
  </plugins>
</build>
{code}

If the compilerArgument to 'g:none' is not set in the pom I can't get any variation of the following command line arguments to compile without some debugging info.

with or without:

{noformat}
maven.compiler.debug=false
{noformat}

with or without any of the following:

{noformat}
maven.compiler.compilerArgument=g:none
maven.compiler.compilerArgument='g:none'
maven.compiler.compilerArguments=g:none
maven.compiler.compilerArgument='g:none'
{noformat}

But I'd like the default to include debugging resources and to be able to easily optionally package without the debug resources -- the easiest way would be able to pass in a command line argument ...


> Setting the debug option to false still compiles the code with line numbers resulting in increased class file.
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-114
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-114
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Windows XP Professional Version 5.1.2600 Service Pack 3 Build 2600, Dell OptiPlex GX280, Total Physical Memory 4,096.00 MB
>            Reporter: Grzegorz Solecki
>         Attachments: TestApp.zip
>
>
> Given the following example:
> {code:title=Bar.java|borderStyle=solid}
> public class Main {
>    public static void main(String[] args) {
>       for (StackTraceElement stackTraceElement : Thread.currentThread().getStackTrace())
>          System.out.println(stackTraceElement);
>    }
> }
> {code} 
> and pom.xml
> {code: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/maven-v4_0_0.xsd">
>    <modelVersion>4.0.0</modelVersion>
>    <groupId>com.greg</groupId>
>    <artifactId>TestApp</artifactId>
>    <version>1</version>
>    <build>
>       <plugins>
>          <plugin>
>             <groupId>org.apache.maven.plugins</groupId>
>             <artifactId>maven-compiler-plugin</artifactId>
>             <configuration>
>                <debug>none</debug>
>                <source>1.5</source>
>                <target>1.5</target>
>             </configuration>
>          </plugin>
>       </plugins>
>    </build>
> </project>
> {code} 
> after compiling and running we get:
> {panel:title=cmd}
> {noformat}
> {TestApp}\target\classes>dir Main.class
> 05/02/2010  XX:XX               564 Main.class
> {TestApp}\target\classes>java -cp . Main
> java.lang.Thread.dumpThreads(Native Method)
> java.lang.Thread.getStackTrace(Thread.java:1383)
> Main.main(Main.java:3)
> {noformat} 
> {panel}
> *NOTE !!!: the number of line (Main.java:3) has been shown*
> However when you compile the same java code using the javac we get:
> {panel:title=cmd}
> {noformat}
> {TestApp}\src\main\java>javac -g:none -source 1.5 -target 1.5 Main.java
> {TestApp}\src\main\java>dir Main.class
> 05/02/2010  XX:XX               477 Main.class
> {TestApp}\src\main\java>java -cp . Main
> java.lang.Thread.dumpThreads(Native Method)
> java.lang.Thread.getStackTrace(Thread.java:1383)
> Main.main(Unknown Source){noformat} 
> {panel}
> *NOTE !!!: the number of line has not been shown*
> Please find the whole sample project in Eclipse that uses m2eclipse plugin, that is configured for using external maven 2.2.1

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-114) Setting the debug option to false still compiles the code with line numbers resulting in increased class file.

Posted by "David H Vree (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=243670#action_243670 ] 

David H Vree commented on MCOMPILER-114:
----------------------------------------

I just tried the debug=true, debuglevel=none approach.  As near as I can tell the line number table is STILL in the class file.

> Setting the debug option to false still compiles the code with line numbers resulting in increased class file.
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-114
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-114
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Windows XP Professional Version 5.1.2600 Service Pack 3 Build 2600, Dell OptiPlex GX280, Total Physical Memory 4,096.00 MB
>            Reporter: Grzegorz Solecki
>         Attachments: TestApp.zip
>
>
> Given the following example:
> {code:title=Bar.java|borderStyle=solid}
> public class Main {
>    public static void main(String[] args) {
>       for (StackTraceElement stackTraceElement : Thread.currentThread().getStackTrace())
>          System.out.println(stackTraceElement);
>    }
> }
> {code} 
> and pom.xml
> {code: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/maven-v4_0_0.xsd">
>    <modelVersion>4.0.0</modelVersion>
>    <groupId>com.greg</groupId>
>    <artifactId>TestApp</artifactId>
>    <version>1</version>
>    <build>
>       <plugins>
>          <plugin>
>             <groupId>org.apache.maven.plugins</groupId>
>             <artifactId>maven-compiler-plugin</artifactId>
>             <configuration>
>                <debug>none</debug>
>                <source>1.5</source>
>                <target>1.5</target>
>             </configuration>
>          </plugin>
>       </plugins>
>    </build>
> </project>
> {code} 
> after compiling and running we get:
> {panel:title=cmd}
> {noformat}
> {TestApp}\target\classes>dir Main.class
> 05/02/2010  XX:XX               564 Main.class
> {TestApp}\target\classes>java -cp . Main
> java.lang.Thread.dumpThreads(Native Method)
> java.lang.Thread.getStackTrace(Thread.java:1383)
> Main.main(Main.java:3)
> {noformat} 
> {panel}
> *NOTE !!!: the number of line (Main.java:3) has been shown*
> However when you compile the same java code using the javac we get:
> {panel:title=cmd}
> {noformat}
> {TestApp}\src\main\java>javac -g:none -source 1.5 -target 1.5 Main.java
> {TestApp}\src\main\java>dir Main.class
> 05/02/2010  XX:XX               477 Main.class
> {TestApp}\src\main\java>java -cp . Main
> java.lang.Thread.dumpThreads(Native Method)
> java.lang.Thread.getStackTrace(Thread.java:1383)
> Main.main(Unknown Source){noformat} 
> {panel}
> *NOTE !!!: the number of line has not been shown*
> Please find the whole sample project in Eclipse that uses m2eclipse plugin, that is configured for using external maven 2.2.1

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-114) Setting the debug option to false still compiles the code with line numbers resulting in increased class file.

Posted by "David H Vree (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=243780#action_243780 ] 

David H Vree commented on MCOMPILER-114:
----------------------------------------

@Stephen - I was using 2.0.2.  Apparently that is what Maven 2.2.1 uses by default.

When I switch to 2.3.2 I could replicate your behavior exactly.  Apparently v2.0.2 quietly ignores the <debuglevel> configuration option.

> Setting the debug option to false still compiles the code with line numbers resulting in increased class file.
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-114
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-114
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Windows XP Professional Version 5.1.2600 Service Pack 3 Build 2600, Dell OptiPlex GX280, Total Physical Memory 4,096.00 MB
>            Reporter: Grzegorz Solecki
>         Attachments: TestApp.zip
>
>
> Given the following example:
> {code:title=Bar.java|borderStyle=solid}
> public class Main {
>    public static void main(String[] args) {
>       for (StackTraceElement stackTraceElement : Thread.currentThread().getStackTrace())
>          System.out.println(stackTraceElement);
>    }
> }
> {code} 
> and pom.xml
> {code: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/maven-v4_0_0.xsd">
>    <modelVersion>4.0.0</modelVersion>
>    <groupId>com.greg</groupId>
>    <artifactId>TestApp</artifactId>
>    <version>1</version>
>    <build>
>       <plugins>
>          <plugin>
>             <groupId>org.apache.maven.plugins</groupId>
>             <artifactId>maven-compiler-plugin</artifactId>
>             <configuration>
>                <debug>none</debug>
>                <source>1.5</source>
>                <target>1.5</target>
>             </configuration>
>          </plugin>
>       </plugins>
>    </build>
> </project>
> {code} 
> after compiling and running we get:
> {panel:title=cmd}
> {noformat}
> {TestApp}\target\classes>dir Main.class
> 05/02/2010  XX:XX               564 Main.class
> {TestApp}\target\classes>java -cp . Main
> java.lang.Thread.dumpThreads(Native Method)
> java.lang.Thread.getStackTrace(Thread.java:1383)
> Main.main(Main.java:3)
> {noformat} 
> {panel}
> *NOTE !!!: the number of line (Main.java:3) has been shown*
> However when you compile the same java code using the javac we get:
> {panel:title=cmd}
> {noformat}
> {TestApp}\src\main\java>javac -g:none -source 1.5 -target 1.5 Main.java
> {TestApp}\src\main\java>dir Main.class
> 05/02/2010  XX:XX               477 Main.class
> {TestApp}\src\main\java>java -cp . Main
> java.lang.Thread.dumpThreads(Native Method)
> java.lang.Thread.getStackTrace(Thread.java:1383)
> Main.main(Unknown Source){noformat} 
> {panel}
> *NOTE !!!: the number of line has not been shown*
> Please find the whole sample project in Eclipse that uses m2eclipse plugin, that is configured for using external maven 2.2.1

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira