[
https://jira.codehaus.org/browse/MCOMPILER-98?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Herve Boutemy updated MCOMPILER-98:
-----------------------------------
Description:
JavacCompiler.java (actually in plexus-compiler-javac, but I cannot find the
source project for this anywhere) has
{code:java} List sourceLocations = config.getSourceLocations();
if ( sourceLocations != null && !sourceLocations.isEmpty() && (
sourceFiles.length == 0 ) )
{
args.add( "-sourcepath" );
args.add( getPathString( sourceLocations ) );
}{code}
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.
was:
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.
> -sourcepath not passed to javac
> -------------------------------
>
> Key: MCOMPILER-98
> URL: https://jira.codehaus.org/browse/MCOMPILER-98
> Project: Maven 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
> {code:java} List sourceLocations = config.getSourceLocations();
> if ( sourceLocations != null && !sourceLocations.isEmpty() && (
> sourceFiles.length == 0 ) )
> {
> args.add( "-sourcepath" );
> args.add( getPathString( sourceLocations ) );
> }{code}
> 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 was sent by Atlassian JIRA
(v6.1.6#6162)