Skip to content

Commit 462bd11

Browse files
[MSHARED-1014] Make Commandline.addSystemEnvironment public and deprecated
MavenInvoker still use it.
1 parent b60e8a2 commit 462bd11

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/org/apache/maven/shared/utils/cli/Commandline.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,13 @@ public void addEnvironment(String name, String value) {
183183

184184
/**
185185
* Add system environment variables.
186+
*
187+
* @deprecated please use {@link #setShellEnvironmentInherited(boolean)}
186188
*/
187-
private void addSystemEnvironment() {
189+
@Deprecated
190+
public void addSystemEnvironment() {}
191+
192+
private void copySystemEnvironment() {
188193
Properties systemEnvVars = CommandLineUtils.getSystemEnvVars();
189194

190195
for (Object o : systemEnvVars.keySet()) {
@@ -202,7 +207,7 @@ private void addSystemEnvironment() {
202207
*/
203208
public String[] getEnvironmentVariables() {
204209
if (isShellEnvironmentInherited()) {
205-
addSystemEnvironment();
210+
copySystemEnvironment();
206211
}
207212

208213
List<String> environmentVars = new ArrayList<>();

0 commit comments

Comments
 (0)