maven-help-plugin
maven-help-plugin copied to clipboard
[MPH-182] mvn help:evaluate does not evaluate java.version correctly
Matt smith opened MPH-182 and commented
Steps to reproduce:
- Create a Java project with Maven.
- Set a new property called
java.versionand set the value to a different value from your installed JDK. - Run mvn help:evaluate and use the expression
${java.version} - The Java version that will be output will be your JDK version, not the property value.
Ideal behaviour:
- Value that is output is the value that is within the
java.versionproperty.
Workaround:
- Set another property (e.g.
something) to the value${java.version} - Run mvn help:evaluate and use the expression
${something} - The correct property value will be output.
Attachments:
- Screenshot 2021-10-08 at 11.19.07.png (13.05 kB)
- Screenshot 2021-10-08 at 11.19.38.png (33.13 kB)
2 votes, 3 watchers
Michael Osipov commented
I think this is rooted in the expression evaluator in Maven Core. It goes through a stacked design of sources: org.apache.maven.project.interpolation.AbstractStringBasedModelInterpolator.createValueSources(Model, File, ProjectBuilderConfiguration)
Miroslav Zaťko commented
in my case, on ubuntu, plugin shows "complete" value of java internal property "java.version" like "17.0.8.1" resp. "11.0.20.1" resp. "1.8.0_382" not just "17" as on screenshot