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 Sep 9, 2021
1 parent 5fa0496 commit 10185fb
Showing 1 changed file with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,28 @@ private void executeGitCommand(final String... args)
*/
private void executeMvnCommand(final String... args)
throws CommandLineException, MojoFailureException {
executeCommand(cmdMvn, true, argLine, args);

final List<String> argLines = new ArrayList<String>();

if (StringUtils.isBlank(this.argLine)
|| !this.argLine.contains("-gs")) {
argLines.add("-gs");
argLines.add(this.mavenSession.getRequest()
.getGlobalSettingsFile()
.getAbsolutePath());
}
if (StringUtils.isBlank(this.argLine)
|| !this.argLine.contains("-s")) {
argLines.add("-s");
argLines.add(this.mavenSession.getRequest()
.getUserSettingsFile()
.getAbsolutePath());
}
if (StringUtils.isNotBlank(this.argLine)) {
argLines.add(this.argLine);
}

executeCommand(cmdMvn, true, StringUtils.join(argLines.toArray(), " "), args);
}

/**
Expand Down

0 comments on commit 10185fb

Please sign in to comment.