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

Stuart McCulloch commented on MNG-5520:
---------------------------------------

IIRC those Java5 annotations are only used by the maven-plugin-plugin to 
generate META-INF/maven/plugin.xml and are not used by the core Maven runtime, 
in which case a retention policy of CLASS is ok:

        http://svn.apache.org/viewvc?view=revision&revision=1338003

The main benefit of using them is that if you extend a Maven plugin then the 
maven-plugin-plugin can see the Java5 annotations retained in the class file, 
whereas javadoc annotations are only in the source.

See http://jira.codehaus.org/browse/MPLUGIN-56 for the original use-case
                
> RuntimePolicy is incorrect for org.apache.maven.plugins.annotations.Parameter
> -----------------------------------------------------------------------------
>
>                 Key: MNG-5520
>                 URL: https://jira.codehaus.org/browse/MNG-5520
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Plugin API
>    Affects Versions: 3.0.4
>         Environment: JDK 1.7
> MAVN 3.0.5
>            Reporter: Martin Gainty
>            Priority: Minor
>         Attachments: RobertPatrickAnnotationsTest.zip
>
>
> looks like we need to hire you to check our code..(provided you work for free)
> package org.apache.maven.plugins.annotations;
> import java.lang.annotation.RetentionPolicy;
> @Documented
> @Retention( RetentionPolicy.CLASS )
> @Target( { ElementType.FIELD } )
> @Inherited
> public @interface Parameter
> RetentionPolicy parameters:
> CLASS 
> Annotations are to be recorded in the class file by the compiler but need NOT 
> be retained by the VM at run time.
>  
> RUNTIME 
> Annotations are to be recorded in the class file by the compiler and  
> RETAINED by the VM at run time, so they may be read reflectively.
>  
> SOURCE 
> Annotations are to be discarded by the compiler. 

--
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

Reply via email to