Maven Compiler Plugin
  1. Maven Compiler Plugin
  2. MCOMPILER-168

Maven try to compile the source code (generate the .class files)even while proc only option is set which is not inline with Javac specification

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Not A Bug
    • Affects Version/s: 2.3.2
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
    • Number of attachments :
      0

      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.

        Activity

        Hide
        Robert Scholte added a comment -

        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:

        <source>1.6</source>
        <target>1.6</target>
        
        Show
        Robert Scholte added a comment - 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: <source> 1.6 </source> <target> 1.6 </target>

          People

          • Assignee:
            Unassigned
            Reporter:
            Parmendra Tyagi
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: