You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jürgen (JIRA)" <ji...@codehaus.org> on 2010/09/10 03:10:32 UTC

[jira] Created: (MCOMPILER-134) add support for jdk 6 javac -processorpath parameter

add support for jdk 6 javac -processorpath parameter
----------------------------------------------------

                 Key: MCOMPILER-134
                 URL: http://jira.codehaus.org/browse/MCOMPILER-134
             Project: Maven 2.x Compiler Plugin
          Issue Type: New Feature
    Affects Versions: 2.3.2
            Reporter: Jürgen
            Priority: Minor
         Attachments: maven-compiler-plugin-2.3.3-SNAPSHOT.jar, ProcCompilerMojo.java

add support for annotation processing javac option -processorpath
cf. http://download.oracle.com/javase/6/docs/technotes/tools/windows/javac.html#processing

while not supported, annotation processor classes have to be supplied via compile classpath.

annotation processor dependencies (e.g. database, xml processing, ...) might not be wanted as project dependencies or event be in conflict with them.

as a workaround I have attached new ProcCompilerMojo, where I tried to implement processorpath support
1) via a new configuration option: dependency resolution is done with bits of code I copied from other maven classes like ProjectBuilder, ...
{code}
<configuration>
	<proc>only</proc>
	<processorpath>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-jdk14</artifactId>
			<version>1.5.6</version>
		</dependency>
		<dependency>
			<groupId>com.example</groupId>
			<artifactId>annoproc</artifactId>
			<version>1.0.0</version>
		</dependency>
	</processorpath>
</configuration>
{code}

2) (unused) via plugin dependencies: I basically make use of ProcCompilerMojo classloader urls. This variant is quite "dirty". it adds unnecessary maven plugin jars to annotation processor classpath and unnecessary annotation processor jars to compiler-plugin classpath



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] (MCOMPILER-134) add support for jdk 6 javac -processorpath parameter

Posted by "Jesse Glick (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=292571#comment-292571 ] 

Jesse Glick commented on MCOMPILER-134:
---------------------------------------

Ideally you could define a {{<dependency>}} with {{<scope>processor</scope>}}, but Maven core seems to hardcode permitted scopes. The next best thing would be to the ability to specify dependency-like artifacts in the compiler plugin configuration.
                
> add support for jdk 6 javac -processorpath parameter
> ----------------------------------------------------
>
>                 Key: MCOMPILER-134
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-134
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.3.2
>            Reporter: Jürgen
>            Priority: Minor
>         Attachments: maven-compiler-plugin-2.3.3-SNAPSHOT.jar, maven-compiler-plugin-2.3.3-SNAPSHOT.jar, ProcCompilerMojo.java
>
>
> add support for annotation processing javac option -processorpath
> cf. http://download.oracle.com/javase/6/docs/technotes/tools/windows/javac.html#processing
> while not supported, annotation processor classes have to be supplied via compile classpath.
> annotation processor dependencies (e.g. database, xml processing, ...) might not be wanted as project dependencies or event be in conflict with them.
> as a workaround I have attached new ProcCompilerMojo, where I tried to implement processorpath support
> 1) via a new configuration option: dependency resolution is done with bits of code I copied from other maven classes like ProjectBuilder, ...
> {code}
> <configuration>
> 	<proc>only</proc>
> 	<processorpath>
> 		<dependency>
> 			<groupId>org.slf4j</groupId>
> 			<artifactId>slf4j-jdk14</artifactId>
> 			<version>1.5.6</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>com.example</groupId>
> 			<artifactId>annoproc</artifactId>
> 			<version>1.0.0</version>
> 		</dependency>
> 	</processorpath>
> </configuration>
> {code}
> 2) (unused) via plugin dependencies: I basically make use of ProcCompilerMojo classloader urls. This variant is quite "dirty". it adds unnecessary maven plugin jars to annotation processor classpath and unnecessary annotation processor jars to compiler-plugin classpath

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Updated: (MCOMPILER-134) add support for jdk 6 javac -processorpath parameter

Posted by "Jürgen (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCOMPILER-134?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jürgen updated MCOMPILER-134:
-----------------------------

    Attachment: maven-compiler-plugin-2.3.3-SNAPSHOT.jar

first upload might have been corrupted ?

> add support for jdk 6 javac -processorpath parameter
> ----------------------------------------------------
>
>                 Key: MCOMPILER-134
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-134
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.3.2
>            Reporter: Jürgen
>            Priority: Minor
>         Attachments: maven-compiler-plugin-2.3.3-SNAPSHOT.jar, maven-compiler-plugin-2.3.3-SNAPSHOT.jar, ProcCompilerMojo.java
>
>
> add support for annotation processing javac option -processorpath
> cf. http://download.oracle.com/javase/6/docs/technotes/tools/windows/javac.html#processing
> while not supported, annotation processor classes have to be supplied via compile classpath.
> annotation processor dependencies (e.g. database, xml processing, ...) might not be wanted as project dependencies or event be in conflict with them.
> as a workaround I have attached new ProcCompilerMojo, where I tried to implement processorpath support
> 1) via a new configuration option: dependency resolution is done with bits of code I copied from other maven classes like ProjectBuilder, ...
> {code}
> <configuration>
> 	<proc>only</proc>
> 	<processorpath>
> 		<dependency>
> 			<groupId>org.slf4j</groupId>
> 			<artifactId>slf4j-jdk14</artifactId>
> 			<version>1.5.6</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>com.example</groupId>
> 			<artifactId>annoproc</artifactId>
> 			<version>1.0.0</version>
> 		</dependency>
> 	</processorpath>
> </configuration>
> {code}
> 2) (unused) via plugin dependencies: I basically make use of ProcCompilerMojo classloader urls. This variant is quite "dirty". it adds unnecessary maven plugin jars to annotation processor classpath and unnecessary annotation processor jars to compiler-plugin classpath

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira