Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0.2
-
Fix Version/s: 2.2
-
Labels:None
-
Number of attachments :
Description
Apt (Annotation Processing Tool) was merged into javac in Java 6. The compiler plugin should support this new functionality, which means supporting the following new arguments:
-proc:{none,only} Control whether annotation processing and/or compilation is done.
-processor <class1>[,<class2>,<class3>...]Names of the annotation processors to run; bypasses default discovery process
-processorpath <path> Specify where to find annotation processors
-s <directory> Specify where to place generated source files
-implicit:{none,class} Specify whether or not to generate class files for implicitly referenced files
-Akey[=value] Options to pass to annotation processors
Note that this should supersede the Apt Maven Plugin at Mojo by encompassing all of its functionality:
http://mojo.codehaus.org/apt-maven-plugin/index.html
Issue Links
- depends upon
-
MCOMPILER-98
-sourcepath not passed to javac
-
-
MCOMPILER-167
Incorrect default for generatedTestSourcesDirectory
-
- is related to
-
MOJO-1137
Support JSR 269 annotation processors
-
-
MCOMPILER-134
add support for jdk 6 javac -processorpath parameter
-
I think the correct behavior would be to pass something like
-s $
{project.basedir}/target/generated-sources/annotation-processing
by default whenever a 269-capable javac is detected.
Part of Maven's appeal is doing the right thing without being told. Since it knows where generated sources ought to be placed in the project structure, it should tell javac that. As usual it could be permitted to override this directory if you had a particular reason to do so.
Note that passing -processorpath or -processor is unnecessary if (1) processors are defined in JARs in your project's classpath, (2) they are registered ServiceLoader-style. In such a case they are all run automatically.