-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-Uppercase Environment Variables duplicated with an Uppercase version #328
Comments
👍 this is breaking our build in which maven calls msbuild, and then msbuild tries to insert the env vars into a case-insensitive set which then errors out for a duplicate :-(. The error comes out something like: |
There is a fairly simple fix to
Second, remove any keys that already exist, case-insensitive fashion:
I shall endeavor to submit a patch |
Hmmmm, the simple fix doesn't actually work for MSBuild, which seems to want to re-add all of the env vars in their "natural" case, and this leads to the collision and error reported in https://developercommunity.visualstudio.com/t/Build-Error:-MSB6001-in-Maven-Build/10527486?sort=newest The real problem is that CommandLineUtils.getSystemEnvVars() is UPPERCASING all of the env vars, and this confuses MSBuild when it sees the MixedCase equivalents. |
Maybe simply use |
Yeah, the problem is that CommandLineUtils intentionally UPPERCASES on
Windows, but this is a mistake
…On Fri, May 10, 2024, 09:46 Slawomir Jaranowski ***@***.***> wrote:
Maybe simply use System.getenv instead of magic from CommandLineUtils
will be the best ...
I don't have access to windows in order to check it
—
Reply to this email directly, view it on GitHub
<#328 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADKXHCLZYYALEZNWQZUXDVLZBTTVZAVCNFSM55UTBTR2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMJQGQ4DGNBRGUYQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I don't know why it is doing in this way .... such implementations from plexus-utils / maven-shared-utils .... are used in many place and I see only in exec-m-p it is a problem The question is that env name should be uppercased on windows at all, or should be used as is ... |
Whilst attempting to run cmd.exe to execute a batch file, where within we unset an environment variable, I found that the exec-maven-plugin duplicates any non-uppercased environment variables with an uppercased one. Example:
Running "mvn validate" shows:
We can workaround the problem as shown, by unsetting the variable twice, or unsetting it first in the POM and then unsetting it again once in the batch file, but I don't think the variables should be duplicated in the first place.
The text was updated successfully, but these errors were encountered: