You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "pigelvy (via GitHub)" <gi...@apache.org> on 2025/03/27 10:02:08 UTC
[I] Interpolation of Windows environment variables [maven-mvnd]
pigelvy opened a new issue, #1302:
URL: https://github.com/apache/maven-mvnd/issues/1302
### 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 POM 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] ------------------------------------------------------------------------
```
--
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: issues-unsubscribe@maven.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Interpolation of Windows environment variables [maven-mvnd]
Posted by "pigelvy (via GitHub)" <gi...@apache.org>.
pigelvy commented on issue #1302:
URL: https://github.com/apache/maven-mvnd/issues/1302#issuecomment-2826575652
Isn't it weird how environment variables are handled? I could not find any doc about that. Did I miss it?
I can't help but think that maybe a sort of lookup strategy such as [SmallRyeConfig](https://smallrye.io/smallrye-config/3.12.3/config/environment-variables) would be an improvement...
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Interpolation of Windows environment variables [maven-mvnd]
Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on issue #1302:
URL: https://github.com/apache/maven-mvnd/issues/1302#issuecomment-2824325748
While at this, can you try same thing with 2-rc-3?
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Interpolation of Windows environment variables [maven-mvnd]
Posted by "pigelvy (via GitHub)" <gi...@apache.org>.
pigelvy commented on issue #1302:
URL: https://github.com/apache/maven-mvnd/issues/1302#issuecomment-2757460917
**About my execution environment**
```
D:\temp\mvnd_test>mvn --version
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: D:\bin\apache\maven\CURRENT
Java version: 21.0.5, vendor: Azul Systems, Inc., runtime: c:\program files\zulu\zulu-21.0.5
Default locale: fr_FR, platform encoding: UTF-8
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"
```
```
D:\temp\mvnd_test>mvnd --version
Apache Maven Daemon (mvnd) 1.0.2 windows-amd64 native client (cccc1ec8a5b741c62b29f9fb04d37b1678a029bb)
Terminal: org.jline.terminal.impl.jni.win.NativeWinSysTerminal
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: C:\Users\T0043287\MyApp\apache\mvnd\1.0.2\mvn
Java version: 21.0.5, vendor: Azul Systems, Inc., runtime: C:\Program Files\Zulu\zulu-21.0.5
Default locale: fr_FR, platform encoding: UTF-8
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"
```
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Interpolation of Windows environment variables [maven-mvnd]
Posted by "pigelvy (via GitHub)" <gi...@apache.org>.
pigelvy commented on issue #1302:
URL: https://github.com/apache/maven-mvnd/issues/1302#issuecomment-2824309836
**About my execution environment**
```
D:\temp\mvnd_test>mvn --version
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: D:\bin\apache\maven\CURRENT
Java version: 21.0.5, vendor: Azul Systems, Inc., runtime: c:\program files\zulu\zulu-21.0.5
Default locale: fr_FR, platform encoding: UTF-8
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"
```
```
D:\temp\mvnd_test>mvnd --version
Apache Maven Daemon (mvnd) 1.0.2 windows-amd64 native client (cccc1ec8a5b741c62b29f9fb04d37b1678a029bb)
Terminal: org.jline.terminal.impl.jni.win.NativeWinSysTerminal
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: D:\bin\apache\mvnd\1.0.2\mvn
Java version: 21.0.5, vendor: Azul Systems, Inc., runtime: C:\Program Files\Zulu\zulu-21.0.5
Default locale: fr_FR, platform encoding: UTF-8
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"
```
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Interpolation of Windows environment variables [maven-mvnd]
Posted by "pigelvy (via GitHub)" <gi...@apache.org>.
pigelvy commented on issue #1302:
URL: https://github.com/apache/maven-mvnd/issues/1302#issuecomment-2826571970
With version `2.0.0-rc-3`, both `mvn` and `mvnd` now interpolate correctly `${env.WINDIR}`. I guess the incoherence I noticed with `1.0.2` no longer exists.
For the sake of it, I also tried with the Windows system property `SystemRoot` because it has both lowercase and uppercase characters. It looks like only the full-uppercase syntax is interpolated.
- `pom.xml`
```
<project root="true">
<modelVersion>4.1.0</modelVersion>
<groupId>org.apache.mvnd</groupId>
<artifactId>mvnd-env-interpolation-issue</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>Echo env variables</id>
<phase>clean</phase>
<goals><goal>exec</goal></goals>
<configuration>
<executable>echo</executable>
<arguments>
<argument>windir=${env.windir},</argument>
<argument>WINDIR=${env.WINDIR},</argument>
<argument>SystemRoot=${env.SystemRoot},</argument>
<argument>SYSTEMROOT=${env.SYSTEMROOT}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
```
- `mvnd`
```
D:\bin\apache\mvnd\2.0.0-rc-3>.\bin\mvnd -f D:\temp\mvnd_test\pom.xml clean
[INFO] Processing build on daemon 4ea687af
[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 ]-----------------------------------------------------
[WARNING] Version not locked for default bindings plugins [maven-clean-plugin], you should define versions in pluginManagement section of your pom.xml or parent
[INFO]
[INFO] --- exec:3.5.0:exec (Echo env variables) @ mvnd-env-interpolation-issue ---
[INFO]
[INFO] --- clean:3.4.0:clean (default-clean) @ mvnd-env-interpolation-issue ---
[INFO] Deleting D:\temp\mvnd_test\target
[INFO] ----------------------------------------------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ----------------------------------------------------------------------------------------------------------------
[INFO] Total time: 0.257 s (Wall Clock)
[INFO] Finished at: 2025-04-24T08:25:54+02:00
[INFO] ----------------------------------------------------------------------------------------------------------------
[INFO] [stdout] windir=$env.windir, WINDIR=C:\WINDOWS, SystemRoot=$env.SystemRoot, SYSTEMROOT=C:\WINDOWS
```
- `mvn`
```
D:\bin\apache\mvnd\2.0.0-rc-3>.\mvn\bin\mvn -f D:\temp\mvnd_test\pom.xml 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 ]-----------------------------------------------------
[WARNING] Version not locked for default bindings plugins [maven-clean-plugin], you should define versions in pluginManagement section of your pom.xml or parent
[INFO]
[INFO] --- exec:3.5.0:exec (Echo env variables) @ mvnd-env-interpolation-issue ---
[INFO]
[INFO] --- clean:3.4.0:clean (default-clean) @ mvnd-env-interpolation-issue ---
[INFO] Deleting D:\temp\mvnd_test\target
[INFO] ----------------------------------------------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ----------------------------------------------------------------------------------------------------------------
[INFO] Total time: 0.765 s
[INFO] Finished at: 2025-04-24T08:26:26+02:00
[INFO] ----------------------------------------------------------------------------------------------------------------
[INFO] [stdout] windir=$env.windir, WINDIR=C:\WINDOWS, SystemRoot=$env.SystemRoot, SYSTEMROOT=C:\WINDOWS
```
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org