You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "David M. Lloyd (JIRA)" <ji...@codehaus.org> on 2013/06/14 05:21:03 UTC

[jira] (MCOMPILER-203) Allow compiler-plugin to specify annotation processor dependencies

    [ https://jira.codehaus.org/browse/MCOMPILER-203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=326725#comment-326725 ] 

David M. Lloyd commented on MCOMPILER-203:
------------------------------------------

My other personality filed this (probably more verbose and useful) summary on a duplicate bug just today:

{quote}
Currently, the compiler plugin searches for annotation processors on the compile class path using the default search algorithm. This can be problematic when having annotation processor JARs or their dependencies on the compile classpath adversely affects compilation behavior, sometimes even making compilation impossible.

It should be possible to alternatively explicitly give a list of artifacts to pass in to the compiler as the annotation processor path. This would correspond to the standard "-processorpath" option. When given in this way, these artifacts (and their transitive dependencies) would have an isolated class loader which could "see" classes on the compile class path but not be "seen" by classes on the compile class path.

This list would be defined in the compiler plugin configuration section as a list of artifacts with optional nested exclusions and that sort of thing (no scope though, as annotation processing is only applicable to compilation). I imagine that these artifacts would behave largely similarly to normal dependencies (i.e. subject to <dependencyManagement> sections), and any dependencies which are already on the compile class path would be chosen from the compile class loader rather than being duplicated in the processor class loader.
{quote}

                
> Allow compiler-plugin to specify annotation processor dependencies
> ------------------------------------------------------------------
>
>                 Key: MCOMPILER-203
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-203
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.3.2
>         Environment: Java 6+
>            Reporter: David M. Lloyd
>
> Right now the status quo for annotation processor artifacts requires one of two actions:
> # Use an external plugin for annotation processing
> # Put the annotation processor in as a dependency with {{provided}} scope
> The former is suboptimal because the external plugins are clunky and ill-supported, and inflexible/hard to use.  The latter is suboptimal because it is often the case that you do not want to leak annotation processor classes on to the application class path.
> It should be possible to add annotation processor dependency artifacts to the compiler plugin configuration such that they are recognized by the annotation processing search algorithm of the compiler, but they do not actually appear on the compilation class path.  Ideally they would also be isolated from one another (dependency graphs and all), but that's more of a "nice to have".

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