apache / apache/maven-help-plugin

[MPH-182] mvn help:evaluate does not evaluate java.version correctly

Open
#310 3 comments 0 reactions 0 assignees View on GitHub
bug priority:minor
Dominant language
Java
Stars
29
Forks
42
Avg merge
1d 12h
Merged PRs (30d)
6

Description

**[Matt smith](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=harmelodic)** opened **[MPH-182](https://issues.apache.org/jira/browse/MPH-182?redirect=false)** and commented

Steps to reproduce:
1. Create a Java project with Maven.
2. Set a new property called `java.version` and set the value to a different value from your installed JDK.
3. Run mvn help:evaluate and use the expression `${java.version}`
4. 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.version` property.

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](https://issues.apache.org/jira/secure/attachment/13034696/Screenshot+2021-10-08+at+11.19.07.png) (_13.05 kB_)
- [Screenshot 2021-10-08 at 11.19.38.png](https://issues.apache.org/jira/secure/attachment/13034695/Screenshot+2021-10-08+at+11.19.38.png) (_33.13 kB_)

2 votes, 3 watchers

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with a Maven project, a custom java.version property, and mvn help:evaluate using ${java.version}. Then inspect the help:evaluate implementation and its tests to trace property resolution; done means the command outputs the project property rather than the installed JDK version.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.