gnodet-bot commented on code in PR #13366:
URL: https://github.com/apache/maven/pull/13366#discussion_r4227898317


##########
api/maven-api-core/src/main/java/org/apache/maven/api/MojoExecution.java:
##########
@@ -31,30 +32,54 @@
  * An instance of this object is bound to the {@link 
org.apache.maven.api.di.MojoExecutionScoped}
  * and available as {@code mojoExecution} within {@link 
org.apache.maven.api.plugin.annotations.Parameter}
  * expressions.
+ * <p>
+ * Instances are immutable snapshots taken at the point when execution begins 
(after configuration
+ * merging, descriptor resolution, and lifecycle phase assignment are all 
complete).
  *
  * @since 4.0.0
  */
 @Experimental
+@Immutable
 public interface MojoExecution {
 
+    /** {@return the plugin that owns this execution} */
     @Nonnull
-    Plugin getPlugin();
+    Plugin plugin();

Review Comment:
   `getPlugin()` (and all other `getX()` bridge methods) were the only handles 
`ReflectionValueExtractor` could use to resolve `${mojo.plugin}`, 
`${mojo.goal}`, `${mojo.executionId}`, etc. — it only tries the 
`get`/`is`/`to`/`as` prefixes, never bare accessor names. Without the bridges, 
those `${mojo.*}` expressions silently return `null`. Consider keeping 
`default` deprecation bridges until `ReflectionValueExtractor` is updated to 
support noun-style methods, or fix the evaluator first.



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

Reply via email to