apache / apache/maven-mvnd

Interpolation of Windows environment variables

Open
#1,302 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
3.5k
Forks
250
Avg merge
16h 22m
Merged PRs (30d)
36

Description

### Affected version

1.0.2

### Bug description

I just noticed that, between `mvn` and `mvnd`, Windows environment variables are not interpolated the same way.

Let's use the environment variable `windir` for example.
- `mvn` interpolates correctly `${env.WINDIR}`
- `mvnd` interpolates correctly `${env.windir}`

I created a [test Maven project](https://github.com/user-attachments/files/19484018/pom.xm.txt) to experience the issue.

- Executions of `mvnd clean`
```
D:\temp\mvnd_test>mvnd clean
[INFO] Processing build on daemon c43021f1
[INFO] Scanning for projects...
[INFO] BuildTimeEventSpy is registered.
[INFO]
[INFO] Using the SmartBuilder implementation with a thread count of 15
[INFO]
[INFO] ------------< org.apache.mvnd:mvnd-env-interpolation-issue >------------
[INFO] Building mvnd-env-interpolation-issue 0.0.1-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- clean:3.2.0:clean (default-clean) @ mvnd-env-interpolation-issue ---
[INFO]
[INFO] --- exec:3.1.0:exec (Echo env variables) @ mvnd-env-interpolation-issue ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.139 s (Wall Clock)
[INFO] Finished at: 2025-03-27T10:55:38+01:00
[INFO] ------------------------------------------------------------------------
[INFO] [stdout] windir=C:\WINDOWS, WINDIR=$env.WINDIR
```
- Execution of `mvn clean`
```
D:\temp\mvnd_test>mvn clean
[INFO] Scanning for projects...
[INFO]
[INFO] ------------< org.apache.mvnd:mvnd-env-interpolation-issue >------------
[INFO] Building mvnd-env-interpolation-issue 0.0.1-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- clean:3.2.0:clean (default-clean) @ mvnd-env-interpolation-issue ---
[INFO]
[INFO] --- exec:3.1.0:exec (Echo env variables) @ mvnd-env-interpolation-issue ---
windir=$env.windir, WINDIR=C:\WINDOWS
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.516 s
[INFO] Finished at: 2025-03-27T10:53:35+01:00
[INFO] ------------------------------------------------------------------------
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the attached test Maven project (pom.xml) and reproduce the discrepancy by running `mvnd clean` and `mvn clean` on Windows. Compare how `${env.WINDIR}` and `${env.windir}` are interpolated; done means mvnd matches Maven's case handling for both references.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.