Skip to content

Commit

Permalink
Inherit Global Settings and User Settings
Browse files Browse the repository at this point in the history
  • Loading branch information
nhojpatrick committed Jul 27, 2020
1 parent 14a282f commit 4189dfd
Showing 1 changed file with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1159,10 +1159,32 @@ private CommandResult executeCommand(final Commandline cmd,
cmd.clearArgs();
cmd.addArguments(args);

final String globalSettingsFileArgLine = String.format("-gs %s", this.mavenSession.getRequest()
.getGlobalSettingsFile()
.getAbsolutePath());

final String userSettingsFileArgLine = String.format("-s %s", this.mavenSession.getRequest()
.getUserSettingsFile()
.getAbsolutePath());

final StringBuilder argLineStr = new StringBuilder();

if (StringUtils.isNotBlank(argStr)) {
cmd.createArg().setLine(argStr);
argLineStr.append(globalSettingsFileArgLine);
argLineStr.append(userSettingsFileArgLine);

} else {
if (!argStr.contains("-gs")) {
argLineStr.append(globalSettingsFileArgLine);
}
if (!argStr.contains("-s")) {
argLineStr.append(userSettingsFileArgLine);
}
argLineStr.append(argStr);
}

cmd.createArg().setLine(argLineStr.toString());

final StringBufferStreamConsumer out = new StringBufferStreamConsumer(
verbose);

Expand Down

0 comments on commit 4189dfd

Please sign in to comment.