gnodet-bot commented on code in PR #13928:
URL: https://github.com/apache/maven/pull/13928#discussion_r4524257682
##########
impl/maven-testing/src/main/java/org/apache/maven/testing/plugin/MojoExtension.java:
##########
@@ -698,17 +690,38 @@ protected String[] mojoCoordinates(String goal) throws
Exception {
return goal.split(":");
} else {
Path pluginPom = Paths.get(getPluginBasedir(), "pom.xml");
- Xpp3Dom pluginPomDom;
+ org.apache.maven.api.model.Model pomModel;
try (Reader reader = Files.newBufferedReader(pluginPom)) {
- pluginPomDom = Xpp3DomBuilder.build(reader);
+ pomModel = new MavenStaxReader().read(reader);
}
- String artifactId = pluginPomDom.getChild("artifactId").getValue();
- String groupId = interpolate(pluginPom, pluginPomDom,
resolveFromRootThenParent(pluginPomDom, "groupId"));
- String version = interpolate(pluginPom, pluginPomDom,
resolveFromRootThenParent(pluginPomDom, "version"));
+ String artifactId = pomModel.getArtifactId();
+ String groupId = resolveGroupId(pomModel);
+ String rawVersion = resolveVersion(pomModel);
Review Comment:
The old code wrapped `groupId` in `interpolate()` for property expansion.
This new call skips interpolation — if a plugin POM's `groupId` is a property
reference (e.g. `${project.groupId}`), it will be returned unexpanded. Consider
applying `interpolateModel()` here as `version` already does.
##########
impl/maven-core/src/main/java/org/apache/maven/plugin/internal/MojoExpressionEvaluator.java:
##########
@@ -24,17 +24,22 @@
* Evaluates mojo parameter expressions and aligns paths to the project base
directory.
* Used by {@link V4MojoConfigurator} to resolve plugin parameter values.
*/
-interface MojoExpressionEvaluator {
+public interface MojoExpressionEvaluator {
Review Comment:
Missing `@since 4.2.0` on the class-level Javadoc. This interface was
promoted from package-private to public API in this PR; the `@since` tag should
be added so users know when it became available.
`MojoExpressionEvaluationException` has it; the interface should too.
--
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]