hboutemy commented on code in PR #236:
URL:
https://github.com/apache/maven-plugin-tools/pull/236#discussion_r1382637654
##########
maven-plugin-tools-annotations/src/site/apt/index.apt:
##########
@@ -94,27 +94,42 @@ public class MyMojo
hint = "..." )
private MyComponent component;
+ // pseudo-parameters (marked read-only) permitting injection of Maven
build context objects
// sample objects taken from Maven API through
PluginParameterExpressionEvaluator
+ //
https://maven.apache.org/ref/current/maven-core/apidocs/org/apache/maven/plugin/PluginParameterExpressionEvaluator.html
+ // plugins targetting Maven 3.2.5+ (after MNG-5695) should not use these
pseudo-parameters any more,
+ // but @Component and Maven APIs to get better compiler-time checks
- @Parameter( defaultValue = "${session}", readonly = true )
+ // @Parameter( defaultValue = "${session}", readonly = true )
+ @Component // since Maven 3.2.5, thanks to MNG-5695
Review Comment:
reading git blame on
https://github.com/apache/maven-plugin-tools/blob/master/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor.java#L791
, I see that in the past, we (I :) ) implemented in plugin-tools a hack to
replace `@Component` with an expression in the plugin descriptor:
https://issues.apache.org/jira/browse/MPLUGIN-204
I don't remember when this was done, if it was before Maven 3.2.5 MNG-5695,
but with Maven 3.2.5, this hack is not useful for `MavenSession`,
`MavenProject` nor `MojoExecution`: it remains useful for a few other types...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]