Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Not A Bug
-
Affects Version/s: 2.3.2
-
Fix Version/s: None
-
Labels:None
-
Environment:HideWindows 7 Professional
Apache Maven 3.0.3 (r1075438; 2011-02-28 23:01:09+0530)
Maven home: E:\Maven
Java version: 1.6.0_23, vendor: Sun Microsystems Inc.
Java home: C:\Program Files (x86)\Java\jdk1.6.0_23\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"ShowWindows 7 Professional Apache Maven 3.0.3 (r1075438; 2011-02-28 23:01:09+0530) Maven home: E:\Maven Java version: 1.6.0_23, vendor: Sun Microsystems Inc. Java home: C:\Program Files (x86)\Java\jdk1.6.0_23\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
-
Number of attachments :
Description
I tried to using option
<proc>only</proce>
with the maven compiler plugin, but it try to compile the source code and generate the .class files.
Below is the sample
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <proc>only</proc> <annotationProcessors> <annotationProcessor>com.annotation.processor.AnnotationProcessor</annotationProcessor> </annotationProcessors> </configuration> </plugin> </plugins> </build>
here i mentioned
<proc>only</proc>
. i.e. it should not compile the code and should do the annotation processing only ( I also cross check this behavior with javac tool of Java 1.6 update 23), but while invoking command
mvn -e -X clean compile
, it compile the source code. which is not inline with specification .
Here is output of command.
command window output
[DEBUG] Source roots: [DEBUG] E:\.......\src\main\java [DEBUG] Command line options: [DEBUG] -d E:\......\target\classes -classpath E:\......\target\classes;C:\Users\......\.m2\repository\com\test\annotationProcessor\0.0.1-SNAPSHOT\annotationProcessor-0.0.1-SNAPSHOT.jar;C:\Users\......\.m2\repository\com\test\annotation\0.0.1-SNAPSHOT\annotation-0.0.1-SNAPSHOT.jar; -sourcepath E:\......\src\main\java; E:\......\src\main\java\com\test\AnnotationUser.java -g -nowarn -target 1.5 -source 1.5 [WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent! [INFO] Compiling 1 source file to E:\......\target\classes [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.976s [INFO] Finished at: Wed Apr 04 10:42:47 IST 2012 [INFO] Final Memory: 5M/15M [INFO] ------------------------------------------------------------------------
Please update the output log too while doing only annotation processing.
According to http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#proc this is only available for JDK 1.6+ sources.
You have to add the following to the configuration: