slachiewicz opened a new issue, #14007:
URL: https://github.com/apache/maven/issues/14007
Since #13636, a Maven 4 API mojo parameter whose type is not a scalar, path,
array, collection, map or record is always built with the type's no-arg
constructor. `V4MojoConfigurator` evaluates the expression, then discards the
result unless it is a String.
The released maven-compiler-plugin 4.0.0-beta-5 does not start on master
because of this:
```
Unable to configure 'projectArtifact' on
org.apache.maven.plugin.compiler.CompilerMojoFactory
Caused by: java.lang.NoSuchMethodException:
org.apache.maven.api.ProducedArtifact.<init>()
```
`projectArtifact` is a `ProducedArtifact` with the default
`${project.mainArtifact}`. The evaluator returns the artifact; `convert` calls
`evaluateNodeAsString` and then `instantiate(ProducedArtifact.class)`. The
Plexus configurator on 4.0.x assigns the evaluated object.
Expected: when the node has no children and the evaluated value is an
instance of the parameter type, assign it.
Found while porting plugins for #13302.
--
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]