-
Notifications
You must be signed in to change notification settings - Fork 94
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
Do not get UPPERCASE env vars #427
base: master
Are you sure you want to change the base?
Conversation
@slawekjaranowski thanks I made that change |
// https://github.com/mojohaus/exec-maven-plugin/issues/328 | ||
// It is not enough to avoid duplicates; we must preserve the case found in the "natural" environment. | ||
// https://developercommunity.visualstudio.com/t/Build-Error:-MSB6001-in-Maven-Build/10527486?sort=newest | ||
Map<String, String> enviro = System.getenv(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be a copy here, getenv
can return unmodifiable map
please rebuild project with JDK 11+ to see errors from spotless |
Please also look at: we can have a duplicate keys like |
Thera is also User can provide env values with different format |
@wheezil How's work going? |
Hi I am on vacation for a while, will get back to this in about a month
…On Tue, May 21, 2024, 21:17 Slawomir Jaranowski ***@***.***> wrote:
@wheezil <https://github.com/wheezil> How's work going?
—
Reply to this email directly, view it on GitHub
<#427 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADKXHCJKTCLGWU4AR6VBRJTZDOMVTAVCNFSM6AAAAABHRIE3RGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRTGI4DKNRVGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
We hit this issue when we updated MSBuild to latest VS2022.
The problem original appears to be simply that maven-exec-plugin was adding both
EnvironmentVariable
and its twin that differs only by case
ENVIRONMENTVARIABLE
which was indeed a problem. However, simply removing the duplicates didn't work, because MSBuild is "special". Apparently, if you have an env var like
OneDrive
and maven-exec-plugin turns that into ONEDRIVE for the launched process environment block, MSBuild somehow finds the original env var definitions (in the registry?) and attempts to add them. It doesn't detect the duplicate that differs only in case until it is too late and it errors out as described in this MS bug reportThe answer is trivially simple -- don't UPPERCASE the env vars