mojohaus / exec-maven-plugin

Exec Maven Plugin
https://www.mojohaus.org/exec-maven-plugin/
Apache License 2.0
163 stars 96 forks source link

Do not get UPPERCASE env vars #427

Open wheezil opened 1 month ago

wheezil commented 1 month ago

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 report The answer is trivially simple -- don't UPPERCASE the env vars

wheezil commented 1 month ago

@slawekjaranowski thanks I made that change

slawekjaranowski commented 1 month ago

please rebuild project with JDK 11+ to see errors from spotless

slawekjaranowski commented 1 month ago

Please also look at: https://github.com/mojohaus/exec-maven-plugin/pull/427/files#diff-08636831c593bb3e17c86b9287a93a740b26c44a780252ddd4bf1537faddf3ebR496-R501

we can have a duplicate keys like Path and PATH

slawekjaranowski commented 1 month ago

Thera is also environmentVariables parameters https://www.mojohaus.org/exec-maven-plugin/exec-mojo.html#environmentVariables

User can provide env values with different format

slawekjaranowski commented 1 month ago

@wheezil How's work going?

wheezil commented 1 month ago

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 https://github.com/mojohaus/exec-maven-plugin/pull/427#issuecomment-2123285652, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKXHCJKTCLGWU4AR6VBRJTZDOMVTAVCNFSM6AAAAABHRIE3RGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRTGI4DKNRVGI . You are receiving this because you were mentioned.Message ID: @.***>