Skip to content
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

Merged
merged 5 commits into from
Aug 5, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/main/java/org/codehaus/mojo/exec/ExecMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -476,13 +476,11 @@ public void execute() throws MojoExecutionException {
}

private Map<String, String> handleSystemEnvVariables() throws MojoExecutionException {

Map<String, String> enviro = new HashMap<>();
Properties systemEnvVars = CommandLineUtils.getSystemEnvVars();
for (Map.Entry<?, ?> entry : systemEnvVars.entrySet()) {
enviro.put((String) entry.getKey(), (String) entry.getValue());
}

// Avoid creating env vars that differ only in case on Windows.
// 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();
slawekjaranowski marked this conversation as resolved.
Show resolved Hide resolved
if (environmentVariables != null) {
enviro.putAll(environmentVariables);
}
Expand Down
Loading