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 Feb 15, 2021
1 parent b04c0ae commit 31f8804
Showing 1 changed file with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,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 31f8804

Please sign in to comment.