You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jesse Glick (JIRA)" <ji...@codehaus.org> on 2009/04/14 04:48:52 UTC
[jira] Created: (MCOMPILER-98) -sourcepath not passed to javac
-sourcepath not passed to javac
-------------------------------
Key: MCOMPILER-98
URL: http://jira.codehaus.org/browse/MCOMPILER-98
Project: Maven 2.x Compiler Plugin
Issue Type: Bug
Affects Versions: 2.0.2
Environment: Ubuntu 8.10, JDK 6.
Reporter: Jesse Glick
Priority: Critical
Attachments: maven-6647998-test.zip
JavacCompiler.java (actually in plexus-compiler-javac, but I cannot find the source project for this anywhere) has
List sourceLocations = config.getSourceLocations();
if ( sourceLocations != null && !sourceLocations.isEmpty() && ( sourceFiles.length == 0 ) )
{
args.add( "-sourcepath" );
args.add( getPathString( sourceLocations ) );
}
The sourceFiles.length == 0 clause should be deleted. The problem is that javac really does need to have -sourcepath even when you are passing an explicit list of *.java files; it is necessary for 269-compliant annotation processors:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6647998
Following is a patch which
1. Fixes diagnostics to print compiler arguments even for unforked mode. (javac is still run with a command line when unforked, so there is no reason to omit this valuable diagnostic info.)
2. Hacks maven-compiler-plugin to work around the bug in plexus-compiler-javac and pass -sourcepath. Obviously a fix to p-c-j would be preferable.
When applied to m-c-p 2.0.2 it allows the test case to build.
--
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-98) -sourcepath not passed to javac
Posted by "Jesse Glick (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MCOMPILER-98?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=211485#action_211485 ]
Jesse Glick commented on MCOMPILER-98:
--------------------------------------
Unfortunately just adding src/main/resources to -sourcepath does not suffice, due to a bug in javac:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6929404
(link may take a few days to work)
> -sourcepath not passed to javac
> -------------------------------
>
> Key: MCOMPILER-98
> URL: http://jira.codehaus.org/browse/MCOMPILER-98
> Project: Maven 2.x Compiler Plugin
> Issue Type: Bug
> Affects Versions: 2.0.2
> Environment: Ubuntu 8.10, JDK 6.
> Reporter: Jesse Glick
> Priority: Critical
> Attachments: maven-6647998-test.zip, MCOMPILER-98.diff
>
>
> JavacCompiler.java (actually in plexus-compiler-javac, but I cannot find the source project for this anywhere) has
> List sourceLocations = config.getSourceLocations();
> if ( sourceLocations != null && !sourceLocations.isEmpty() && ( sourceFiles.length == 0 ) )
> {
> args.add( "-sourcepath" );
> args.add( getPathString( sourceLocations ) );
> }
> The sourceFiles.length == 0 clause should be deleted. The problem is that javac really does need to have -sourcepath even when you are passing an explicit list of *.java files; it is necessary for 269-compliant annotation processors:
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6647998
> Following is a patch which
> 1. Fixes diagnostics to print compiler arguments even for unforked mode. (javac is still run with a command line when unforked, so there is no reason to omit this valuable diagnostic info.)
> 2. Hacks maven-compiler-plugin to work around the bug in plexus-compiler-javac and pass -sourcepath. Obviously a fix to p-c-j would be preferable.
> When applied to m-c-p 2.0.2 it allows the test case to build.
--
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] Closed: (MCOMPILER-98) -sourcepath not passed to javac
Posted by "Milos Kleint (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MCOMPILER-98?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Milos Kleint closed MCOMPILER-98.
---------------------------------
Resolution: Fixed
Fix Version/s: 2.2
I've opened the MCOMPILER-122 for the resources usecase. closing this one as the generic -sourcepath case is fixed.
> -sourcepath not passed to javac
> -------------------------------
>
> Key: MCOMPILER-98
> URL: http://jira.codehaus.org/browse/MCOMPILER-98
> Project: Maven 2.x Compiler Plugin
> Issue Type: Bug
> Affects Versions: 2.0.2
> Environment: Ubuntu 8.10, JDK 6.
> Reporter: Jesse Glick
> Assignee: Milos Kleint
> Priority: Critical
> Fix For: 2.2
>
> Attachments: maven-6647998-test.zip, MCOMPILER-98.diff
>
>
> JavacCompiler.java (actually in plexus-compiler-javac, but I cannot find the source project for this anywhere) has
> List sourceLocations = config.getSourceLocations();
> if ( sourceLocations != null && !sourceLocations.isEmpty() && ( sourceFiles.length == 0 ) )
> {
> args.add( "-sourcepath" );
> args.add( getPathString( sourceLocations ) );
> }
> The sourceFiles.length == 0 clause should be deleted. The problem is that javac really does need to have -sourcepath even when you are passing an explicit list of *.java files; it is necessary for 269-compliant annotation processors:
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6647998
> Following is a patch which
> 1. Fixes diagnostics to print compiler arguments even for unforked mode. (javac is still run with a command line when unforked, so there is no reason to omit this valuable diagnostic info.)
> 2. Hacks maven-compiler-plugin to work around the bug in plexus-compiler-javac and pass -sourcepath. Obviously a fix to p-c-j would be preferable.
> When applied to m-c-p 2.0.2 it allows the test case to build.
--
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-98) -sourcepath not passed to javac
Posted by "Milos Kleint (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MCOMPILER-98?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=207436#action_207436 ]
Milos Kleint commented on MCOMPILER-98:
---------------------------------------
http://svn.apache.org/viewvc?rev=900690&view=rev
http://fisheye.codehaus.org/changelog/plexus/?cs=8590
the compiler plugin's trunk still references the 1.6 version of the javac compiler plugin.
> -sourcepath not passed to javac
> -------------------------------
>
> Key: MCOMPILER-98
> URL: http://jira.codehaus.org/browse/MCOMPILER-98
> Project: Maven 2.x Compiler Plugin
> Issue Type: Bug
> Affects Versions: 2.0.2
> Environment: Ubuntu 8.10, JDK 6.
> Reporter: Jesse Glick
> Priority: Critical
> Attachments: maven-6647998-test.zip, MCOMPILER-98.diff
>
>
> JavacCompiler.java (actually in plexus-compiler-javac, but I cannot find the source project for this anywhere) has
> List sourceLocations = config.getSourceLocations();
> if ( sourceLocations != null && !sourceLocations.isEmpty() && ( sourceFiles.length == 0 ) )
> {
> args.add( "-sourcepath" );
> args.add( getPathString( sourceLocations ) );
> }
> The sourceFiles.length == 0 clause should be deleted. The problem is that javac really does need to have -sourcepath even when you are passing an explicit list of *.java files; it is necessary for 269-compliant annotation processors:
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6647998
> Following is a patch which
> 1. Fixes diagnostics to print compiler arguments even for unforked mode. (javac is still run with a command line when unforked, so there is no reason to omit this valuable diagnostic info.)
> 2. Hacks maven-compiler-plugin to work around the bug in plexus-compiler-javac and pass -sourcepath. Obviously a fix to p-c-j would be preferable.
> When applied to m-c-p 2.0.2 it allows the test case to build.
--
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-98) -sourcepath not passed to javac
Posted by "Jesse Glick (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MCOMPILER-98?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=172853#action_172853 ]
Jesse Glick commented on MCOMPILER-98:
--------------------------------------
Workaround seems to be:
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArguments>
<sourcepath>${project.basedir}/src/main/java</sourcepath>
</compilerArguments>
</configuration>
</plugin>
</plugins>
</build>
> -sourcepath not passed to javac
> -------------------------------
>
> Key: MCOMPILER-98
> URL: http://jira.codehaus.org/browse/MCOMPILER-98
> Project: Maven 2.x Compiler Plugin
> Issue Type: Bug
> Affects Versions: 2.0.2
> Environment: Ubuntu 8.10, JDK 6.
> Reporter: Jesse Glick
> Priority: Critical
> Attachments: maven-6647998-test.zip, MCOMPILER-98.diff
>
>
> JavacCompiler.java (actually in plexus-compiler-javac, but I cannot find the source project for this anywhere) has
> List sourceLocations = config.getSourceLocations();
> if ( sourceLocations != null && !sourceLocations.isEmpty() && ( sourceFiles.length == 0 ) )
> {
> args.add( "-sourcepath" );
> args.add( getPathString( sourceLocations ) );
> }
> The sourceFiles.length == 0 clause should be deleted. The problem is that javac really does need to have -sourcepath even when you are passing an explicit list of *.java files; it is necessary for 269-compliant annotation processors:
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6647998
> Following is a patch which
> 1. Fixes diagnostics to print compiler arguments even for unforked mode. (javac is still run with a command line when unforked, so there is no reason to omit this valuable diagnostic info.)
> 2. Hacks maven-compiler-plugin to work around the bug in plexus-compiler-javac and pass -sourcepath. Obviously a fix to p-c-j would be preferable.
> When applied to m-c-p 2.0.2 it allows the test case to build.
--
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] Issue Comment Edited: (MCOMPILER-98) -sourcepath not passed
to javac
Posted by "Jesse Glick (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MCOMPILER-98?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=172851#action_172851 ]
Jesse Glick edited comment on MCOMPILER-98 at 1/20/10 7:26 PM:
---------------------------------------------------------------
MCOMPILER-97 has to be worked around in test case.
was (Author: jglick):
#97 has to be worked around in test case.
> -sourcepath not passed to javac
> -------------------------------
>
> Key: MCOMPILER-98
> URL: http://jira.codehaus.org/browse/MCOMPILER-98
> Project: Maven 2.x Compiler Plugin
> Issue Type: Bug
> Affects Versions: 2.0.2
> Environment: Ubuntu 8.10, JDK 6.
> Reporter: Jesse Glick
> Priority: Critical
> Attachments: maven-6647998-test.zip, MCOMPILER-98.diff
>
>
> JavacCompiler.java (actually in plexus-compiler-javac, but I cannot find the source project for this anywhere) has
> List sourceLocations = config.getSourceLocations();
> if ( sourceLocations != null && !sourceLocations.isEmpty() && ( sourceFiles.length == 0 ) )
> {
> args.add( "-sourcepath" );
> args.add( getPathString( sourceLocations ) );
> }
> The sourceFiles.length == 0 clause should be deleted. The problem is that javac really does need to have -sourcepath even when you are passing an explicit list of *.java files; it is necessary for 269-compliant annotation processors:
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6647998
> Following is a patch which
> 1. Fixes diagnostics to print compiler arguments even for unforked mode. (javac is still run with a command line when unforked, so there is no reason to omit this valuable diagnostic info.)
> 2. Hacks maven-compiler-plugin to work around the bug in plexus-compiler-javac and pass -sourcepath. Obviously a fix to p-c-j would be preferable.
> When applied to m-c-p 2.0.2 it allows the test case to build.
--
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] Issue Comment Edited: (MCOMPILER-98) -sourcepath not passed
to javac
Posted by "Jesse Glick (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MCOMPILER-98?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=172850#action_172850 ]
Jesse Glick edited comment on MCOMPILER-98 at 1/20/10 7:26 PM:
---------------------------------------------------------------
Even if this were fixed, the expected output from the test case would be invisible unless MCOMPILER-66 were fixed too.
was (Author: jglick):
Even if this were fixed, the expected output from the test case would be invisible unless #66 were fixed too.
> -sourcepath not passed to javac
> -------------------------------
>
> Key: MCOMPILER-98
> URL: http://jira.codehaus.org/browse/MCOMPILER-98
> Project: Maven 2.x Compiler Plugin
> Issue Type: Bug
> Affects Versions: 2.0.2
> Environment: Ubuntu 8.10, JDK 6.
> Reporter: Jesse Glick
> Priority: Critical
> Attachments: maven-6647998-test.zip, MCOMPILER-98.diff
>
>
> JavacCompiler.java (actually in plexus-compiler-javac, but I cannot find the source project for this anywhere) has
> List sourceLocations = config.getSourceLocations();
> if ( sourceLocations != null && !sourceLocations.isEmpty() && ( sourceFiles.length == 0 ) )
> {
> args.add( "-sourcepath" );
> args.add( getPathString( sourceLocations ) );
> }
> The sourceFiles.length == 0 clause should be deleted. The problem is that javac really does need to have -sourcepath even when you are passing an explicit list of *.java files; it is necessary for 269-compliant annotation processors:
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6647998
> Following is a patch which
> 1. Fixes diagnostics to print compiler arguments even for unforked mode. (javac is still run with a command line when unforked, so there is no reason to omit this valuable diagnostic info.)
> 2. Hacks maven-compiler-plugin to work around the bug in plexus-compiler-javac and pass -sourcepath. Obviously a fix to p-c-j would be preferable.
> When applied to m-c-p 2.0.2 it allows the test case to build.
--
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-98) -sourcepath not passed to javac
Posted by "Jesse Glick (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MCOMPILER-98?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=209675#action_209675 ]
Jesse Glick commented on MCOMPILER-98:
--------------------------------------
Note that for annotation processors which load non-Java resources from the sourcepath, the above fix will not suffice since it only includes Java sources. Untested workaround:
<compilerArguments>
<sourcepath>${project.basedir}/src/main/java:${project.basedir}/src/main/resources</sourcepath>
</compilerArguments>
> -sourcepath not passed to javac
> -------------------------------
>
> Key: MCOMPILER-98
> URL: http://jira.codehaus.org/browse/MCOMPILER-98
> Project: Maven 2.x Compiler Plugin
> Issue Type: Bug
> Affects Versions: 2.0.2
> Environment: Ubuntu 8.10, JDK 6.
> Reporter: Jesse Glick
> Priority: Critical
> Attachments: maven-6647998-test.zip, MCOMPILER-98.diff
>
>
> JavacCompiler.java (actually in plexus-compiler-javac, but I cannot find the source project for this anywhere) has
> List sourceLocations = config.getSourceLocations();
> if ( sourceLocations != null && !sourceLocations.isEmpty() && ( sourceFiles.length == 0 ) )
> {
> args.add( "-sourcepath" );
> args.add( getPathString( sourceLocations ) );
> }
> The sourceFiles.length == 0 clause should be deleted. The problem is that javac really does need to have -sourcepath even when you are passing an explicit list of *.java files; it is necessary for 269-compliant annotation processors:
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6647998
> Following is a patch which
> 1. Fixes diagnostics to print compiler arguments even for unforked mode. (javac is still run with a command line when unforked, so there is no reason to omit this valuable diagnostic info.)
> 2. Hacks maven-compiler-plugin to work around the bug in plexus-compiler-javac and pass -sourcepath. Obviously a fix to p-c-j would be preferable.
> When applied to m-c-p 2.0.2 it allows the test case to build.
--
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] Updated: (MCOMPILER-98) -sourcepath not passed to javac
Posted by "Jesse Glick (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MCOMPILER-98?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jesse Glick updated MCOMPILER-98:
---------------------------------
Attachment: MCOMPILER-98.diff
Patch incl. better diagnostics and hotfix.
> -sourcepath not passed to javac
> -------------------------------
>
> Key: MCOMPILER-98
> URL: http://jira.codehaus.org/browse/MCOMPILER-98
> Project: Maven 2.x Compiler Plugin
> Issue Type: Bug
> Affects Versions: 2.0.2
> Environment: Ubuntu 8.10, JDK 6.
> Reporter: Jesse Glick
> Priority: Critical
> Attachments: maven-6647998-test.zip, MCOMPILER-98.diff
>
>
> JavacCompiler.java (actually in plexus-compiler-javac, but I cannot find the source project for this anywhere) has
> List sourceLocations = config.getSourceLocations();
> if ( sourceLocations != null && !sourceLocations.isEmpty() && ( sourceFiles.length == 0 ) )
> {
> args.add( "-sourcepath" );
> args.add( getPathString( sourceLocations ) );
> }
> The sourceFiles.length == 0 clause should be deleted. The problem is that javac really does need to have -sourcepath even when you are passing an explicit list of *.java files; it is necessary for 269-compliant annotation processors:
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6647998
> Following is a patch which
> 1. Fixes diagnostics to print compiler arguments even for unforked mode. (javac is still run with a command line when unforked, so there is no reason to omit this valuable diagnostic info.)
> 2. Hacks maven-compiler-plugin to work around the bug in plexus-compiler-javac and pass -sourcepath. Obviously a fix to p-c-j would be preferable.
> When applied to m-c-p 2.0.2 it allows the test case to build.
--
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