spacer
  • Maven 2.x Compiler Plugin
  • MCOMPILER-98

-sourcepath not passed to javac

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: spacer Bug
  • Status: spacer Closed
  • Priority: spacer Critical
  • Resolution: Fixed
  • Affects Version/s: 2.0.2
  • Fix Version/s: 2.2
  • Labels:
    None
  • Environment:
    Ubuntu 8.10, JDK 6.
  • Testcase included:
    yes
  • Patch Submitted:
    Yes
  • Number of attachments :
    2

Description

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:

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.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    spacer
    maven-6647998-test.zip
    13/Apr/09 9:47 PM
    8 kB
    Jesse Glick
    1. spacer
      maven-6647998-test/.../pom.xml 0.9 kB
    2. spacer
      maven-6647998-test/.../Proc.java 1 kB
    3. spacer
      maven-6647998-test/.../javax.annotation.processing.Processor 0.0 kB
    4. spacer
      maven-6647998-test/.../pom.xml 0.8 kB
    5. spacer
      maven-6647998-test/.../X.java 0.1 kB
    6. spacer
      maven-6647998-test/.../info 0.0 kB
    7. spacer
      maven-6647998-test/pom.xml 0.9 kB
    Download Zip
    Show
    "> spacer
    maven-6647998-test.zip
    13/Apr/09 9:47 PM
    8 kB
    Jesse Glick
  2. spacer
    MCOMPILER-98.diff
    13/Apr/09 9:52 PM
    3 kB
    Jesse Glick

Issue Links

depends upon

spacer MCOMPILER-66 Compiler swallows messages from annotation processors

  • spacer
  • spacer

spacer MCOMPILER-97 META-INF/services/javax.annotation.processing.Processor copied before compilation and causes error

  • spacer
  • spacer

spacer MCOMPILER-122 -sourcepath shall include resources

  • spacer
  • spacer
is depended upon by

spacer MCOMPILER-75 Add apt support for Java 6

  • spacer
  • spacer

Activity

Ascending order - Click to sort in descending order
    All Comments Work Log History Activity
Hide
Permalink
Jesse Glick added a comment -

269 support in general would require this to be fixed.

Show
Jesse Glick added a comment - 269 support in general would require this to be fixed.
Hide
Permalink
Jesse Glick added a comment - - edited

Even if this were fixed, the expected output from the test