You are viewing a plain text version of this content. The canonical link for it is here.
Posted to m2-dev@maven.apache.org by ji...@codehaus.org on 2005/01/04 17:40:53 UTC
[jira] Created: (MNG-104) m2 should compile java code with debug info by default
Message:
A new issue has been created in JIRA.
---------------------------------------------------------------------
View the issue:
http://jira.codehaus.org/browse/MNG-104
Here is an overview of the issue:
---------------------------------------------------------------------
Key: MNG-104
Summary: m2 should compile java code with debug info by default
Type: Bug
Status: Unassigned
Priority: Major
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: m2
Assignee:
Reporter: Eugene Kuleshov
Created: Tue, 4 Jan 2005 11:40 AM
Updated: Tue, 4 Jan 2005 11:40 AM
Description:
Currently it is not possible to debug any snapshots that has been build with m2 because there is no debug information. Please add -g option to javac call and optionally make possible to turn debug info off.
Here is the patch for m2 bootstrap:
Index: JavacCompiler.java
===================================================================
RCS file: /home/cvspublic/maven-components/maven-mboot2/src/main/java/compile/JavacCompiler.java,v
retrieving revision 1.1
diff -u -r1.1 JavacCompiler.java
--- JavacCompiler.java 5 Dec 2004 04:12:24 -0000 1.1
+++ JavacCompiler.java 4 Jan 2005 16:28:53 -0000
@@ -44,19 +44,21 @@
String[] sources = getSourceFiles( sourceDirectories );
- int j = 5;
+ int j = 6;
String[] args = new String[sources.length + j];
- args[0] = "-d";
+ args[0] = "-g";
- args[1] = destinationDir.getAbsolutePath();
+ args[1] = "-d";
- args[2] = "-nowarn";
+ args[2] = destinationDir.getAbsolutePath();
- args[3] = "-classpath";
+ args[3] = "-nowarn";
- args[4] = getClasspathString( classpathElements );
+ args[4] = "-classpath";
+
+ args[5] = getClasspathString( classpathElements );
for ( int i = 0; i < sources.length; i++ )
{
---------------------------------------------------------------------
JIRA INFORMATION:
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
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Updated: (MNG-104) m2 should compile java code with debug info by default
Posted by ji...@codehaus.org.
The following issue has been updated:
Updater: Mauro Botelho (mailto:codehaus@e-botelho.com)
Date: Mon, 10 Jan 2005 9:41 PM
Changes:
Attachment changed to build.patch
---------------------------------------------------------------------
For a full history of the issue, see:
http://jira.codehaus.org/browse/MNG-104?page=history
---------------------------------------------------------------------
View the issue:
http://jira.codehaus.org/browse/MNG-104
Here is an overview of the issue:
---------------------------------------------------------------------
Key: MNG-104
Summary: m2 should compile java code with debug info by default
Type: Bug
Status: Unassigned
Priority: Major
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: m2
Assignee:
Reporter: Eugene Kuleshov
Created: Tue, 4 Jan 2005 11:40 AM
Updated: Mon, 10 Jan 2005 9:41 PM
Description:
Currently it is not possible to debug any snapshots that has been build with m2 because there is no debug information. Please add -g option to javac call and optionally make possible to turn debug info off.
Here is the patch for m2 bootstrap:
Index: JavacCompiler.java
===================================================================
RCS file: /home/cvspublic/maven-components/maven-mboot2/src/main/java/compile/JavacCompiler.java,v
retrieving revision 1.1
diff -u -r1.1 JavacCompiler.java
--- JavacCompiler.java 5 Dec 2004 04:12:24 -0000 1.1
+++ JavacCompiler.java 4 Jan 2005 16:28:53 -0000
@@ -44,19 +44,21 @@
String[] sources = getSourceFiles( sourceDirectories );
- int j = 5;
+ int j = 6;
String[] args = new String[sources.length + j];
- args[0] = "-d";
+ args[0] = "-g";
- args[1] = destinationDir.getAbsolutePath();
+ args[1] = "-d";
- args[2] = "-nowarn";
+ args[2] = destinationDir.getAbsolutePath();
- args[3] = "-classpath";
+ args[3] = "-nowarn";
- args[4] = getClasspathString( classpathElements );
+ args[4] = "-classpath";
+
+ args[5] = getClasspathString( classpathElements );
for ( int i = 0; i < sources.length; i++ )
{
---------------------------------------------------------------------
JIRA INFORMATION:
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
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Updated: (MNG-104) m2 should compile java code with debug info by default
Posted by ji...@codehaus.org.
The following issue has been updated:
Updater: Mauro Botelho (mailto:codehaus@e-botelho.com)
Date: Mon, 10 Jan 2005 9:41 PM
Changes:
Attachment changed to JavacCompiler.patch
---------------------------------------------------------------------
For a full history of the issue, see:
http://jira.codehaus.org/browse/MNG-104?page=history
---------------------------------------------------------------------
View the issue:
http://jira.codehaus.org/browse/MNG-104
Here is an overview of the issue:
---------------------------------------------------------------------
Key: MNG-104
Summary: m2 should compile java code with debug info by default
Type: Bug
Status: Unassigned
Priority: Major
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: m2
Assignee:
Reporter: Eugene Kuleshov
Created: Tue, 4 Jan 2005 11:40 AM
Updated: Mon, 10 Jan 2005 9:41 PM
Description:
Currently it is not possible to debug any snapshots that has been build with m2 because there is no debug information. Please add -g option to javac call and optionally make possible to turn debug info off.
Here is the patch for m2 bootstrap:
Index: JavacCompiler.java
===================================================================
RCS file: /home/cvspublic/maven-components/maven-mboot2/src/main/java/compile/JavacCompiler.java,v
retrieving revision 1.1
diff -u -r1.1 JavacCompiler.java
--- JavacCompiler.java 5 Dec 2004 04:12:24 -0000 1.1
+++ JavacCompiler.java 4 Jan 2005 16:28:53 -0000
@@ -44,19 +44,21 @@
String[] sources = getSourceFiles( sourceDirectories );
- int j = 5;
+ int j = 6;
String[] args = new String[sources.length + j];
- args[0] = "-d";
+ args[0] = "-g";
- args[1] = destinationDir.getAbsolutePath();
+ args[1] = "-d";
- args[2] = "-nowarn";
+ args[2] = destinationDir.getAbsolutePath();
- args[3] = "-classpath";
+ args[3] = "-nowarn";
- args[4] = getClasspathString( classpathElements );
+ args[4] = "-classpath";
+
+ args[5] = getClasspathString( classpathElements );
for ( int i = 0; i < sources.length; i++ )
{
---------------------------------------------------------------------
JIRA INFORMATION:
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
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Updated: (MNG-104) m2 should compile java code with debug info by default
Posted by ji...@codehaus.org.
The following issue has been updated:
Updater: Mauro Botelho (mailto:codehaus@e-botelho.com)
Date: Mon, 10 Jan 2005 9:42 PM
Changes:
Attachment changed to testcompilermojo.patch
---------------------------------------------------------------------
For a full history of the issue, see:
http://jira.codehaus.org/browse/MNG-104?page=history
---------------------------------------------------------------------
View the issue:
http://jira.codehaus.org/browse/MNG-104
Here is an overview of the issue:
---------------------------------------------------------------------
Key: MNG-104
Summary: m2 should compile java code with debug info by default
Type: Bug
Status: Unassigned
Priority: Major
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: m2
Assignee:
Reporter: Eugene Kuleshov
Created: Tue, 4 Jan 2005 11:40 AM
Updated: Mon, 10 Jan 2005 9:42 PM
Description:
Currently it is not possible to debug any snapshots that has been build with m2 because there is no debug information. Please add -g option to javac call and optionally make possible to turn debug info off.
Here is the patch for m2 bootstrap:
Index: JavacCompiler.java
===================================================================
RCS file: /home/cvspublic/maven-components/maven-mboot2/src/main/java/compile/JavacCompiler.java,v
retrieving revision 1.1
diff -u -r1.1 JavacCompiler.java
--- JavacCompiler.java 5 Dec 2004 04:12:24 -0000 1.1
+++ JavacCompiler.java 4 Jan 2005 16:28:53 -0000
@@ -44,19 +44,21 @@
String[] sources = getSourceFiles( sourceDirectories );
- int j = 5;
+ int j = 6;
String[] args = new String[sources.length + j];
- args[0] = "-d";
+ args[0] = "-g";
- args[1] = destinationDir.getAbsolutePath();
+ args[1] = "-d";
- args[2] = "-nowarn";
+ args[2] = destinationDir.getAbsolutePath();
- args[3] = "-classpath";
+ args[3] = "-nowarn";
- args[4] = getClasspathString( classpathElements );
+ args[4] = "-classpath";
+
+ args[5] = getClasspathString( classpathElements );
for ( int i = 0; i < sources.length; i++ )
{
---------------------------------------------------------------------
JIRA INFORMATION:
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
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Commented: (MNG-104) m2 should compile java code with debug info by default
Posted by ji...@codehaus.org.
The following comment has been added to this issue:
Author: Mauro Botelho
Created: Sun, 9 Jan 2005 9:40 PM
Body:
Carlos patched this issue, but left some holes like the bootstrapper not checking the debug option and the TestCompilerMojo missing a parameter description. Here are the patches to fix those holes:
Index: JavacCompiler.java
===================================================================
RCS file: /home/cvspublic/maven-components/maven-mboot2/src/main/java/compile/JavacCompiler.java,v
retrieving revision 1.2
diff -u -r1.2 JavacCompiler.java
--- JavacCompiler.java 9 Jan 2005 22:38:43 -0000 1.2
+++ JavacCompiler.java 10 Jan 2005 02:27:53 -0000
@@ -59,12 +59,17 @@
List args = new ArrayList( sources.length + 5 + compilerOptions.size() * 2 );
+ if (config.isDebug())
+ {
+ args.add( "-g" );
+ }
+
args.add( "-d" );
args.add( destinationDir.getAbsolutePath() );
args.add( "-nowarn" );
-
+
args.add( "-classpath" );
args.add( getClasspathString( config.getClasspathEntries() ) );
@@ -76,14 +81,16 @@
Map.Entry entry = (Map.Entry) it.next();
args.add( entry.getKey() );
if ( (entry.getValue() != null) )
+ {
args.add( entry.getValue() );
+ }
}
for ( int i = 0; i < sources.length; i++ )
{
args.add( sources[i] );
}
-
+
IsolatedClassLoader cl = new IsolatedClassLoader();
File toolsJar = new File( System.getProperty( "java.home" ), "../lib/tools.jar" );
Index: TestCompilerMojo.java
===================================================================
RCS file: /home/cvspublic/maven-components/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/TestCompilerMojo.java,v
retrieving revision 1.4
diff -u -r1.4 TestCompilerMojo.java
--- TestCompilerMojo.java 16 Jun 2004 02:51:37 -0000 1.4
+++ TestCompilerMojo.java 10 Jan 2005 02:28:45 -0000
@@ -1,5 +1,6 @@
package org.apache.maven.plugin;
+
import org.codehaus.plexus.compiler.Compiler;
import org.codehaus.plexus.compiler.CompilerError;
import org.codehaus.plexus.compiler.javac.JavacCompiler;
@@ -22,6 +23,7 @@
* validator=""
* expression="#project.build.unitTestSourceDirectory"
* description=""
+ *
* @parameter
* name="outputDirectory"
* type="String"
@@ -29,6 +31,7 @@
* validator=""
* expression="#project.build.testOutput"
* description=""
+ *
* @parameter
* name="classpathElements"
* type="String[]"
@@ -36,6 +39,14 @@
* validator=""
* expression="#project.classpathElements"
* description=""
+ *
+ * @parameter
+ * name="debug"
+ * type="String"
+ * required="false"
+ * validator=""
+ * expression="#maven.compiler.debug"
+ * description="Whether to include debugging information in the compiled class files; the default value is false"
*
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id: TestCompilerMojo.java,v 1.4 2004/06/16 02:51:37 jvanzyl Exp $
---------------------------------------------------------------------
View this comment:
http://jira.codehaus.org/browse/MNG-104?page=comments#action_28790
---------------------------------------------------------------------
View the issue:
http://jira.codehaus.org/browse/MNG-104
Here is an overview of the issue:
---------------------------------------------------------------------
Key: MNG-104
Summary: m2 should compile java code with debug info by default
Type: Bug
Status: Unassigned
Priority: Major
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: m2
Assignee:
Reporter: Eugene Kuleshov
Created: Tue, 4 Jan 2005 11:40 AM
Updated: Sun, 9 Jan 2005 9:40 PM
Description:
Currently it is not possible to debug any snapshots that has been build with m2 because there is no debug information. Please add -g option to javac call and optionally make possible to turn debug info off.
Here is the patch for m2 bootstrap:
Index: JavacCompiler.java
===================================================================
RCS file: /home/cvspublic/maven-components/maven-mboot2/src/main/java/compile/JavacCompiler.java,v
retrieving revision 1.1
diff -u -r1.1 JavacCompiler.java
--- JavacCompiler.java 5 Dec 2004 04:12:24 -0000 1.1
+++ JavacCompiler.java 4 Jan 2005 16:28:53 -0000
@@ -44,19 +44,21 @@
String[] sources = getSourceFiles( sourceDirectories );
- int j = 5;
+ int j = 6;
String[] args = new String[sources.length + j];
- args[0] = "-d";
+ args[0] = "-g";
- args[1] = destinationDir.getAbsolutePath();
+ args[1] = "-d";
- args[2] = "-nowarn";
+ args[2] = destinationDir.getAbsolutePath();
- args[3] = "-classpath";
+ args[3] = "-nowarn";
- args[4] = getClasspathString( classpathElements );
+ args[4] = "-classpath";
+
+ args[5] = getClasspathString( classpathElements );
for ( int i = 0; i < sources.length; i++ )
{
---------------------------------------------------------------------
JIRA INFORMATION:
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
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira