Skip to content

Commit 10185fb

Browse files
committed
Inherit Global Settings and User Settings
1 parent 5fa0496 commit 10185fb

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,28 @@ private void executeGitCommand(final String... args)
11801180
*/
11811181
private void executeMvnCommand(final String... args)
11821182
throws CommandLineException, MojoFailureException {
1183-
executeCommand(cmdMvn, true, argLine, args);
1183+
1184+
final List<String> argLines = new ArrayList<String>();
1185+
1186+
if (StringUtils.isBlank(this.argLine)
1187+
|| !this.argLine.contains("-gs")) {
1188+
argLines.add("-gs");
1189+
argLines.add(this.mavenSession.getRequest()
1190+
.getGlobalSettingsFile()
1191+
.getAbsolutePath());
1192+
}
1193+
if (StringUtils.isBlank(this.argLine)
1194+
|| !this.argLine.contains("-s")) {
1195+
argLines.add("-s");
1196+
argLines.add(this.mavenSession.getRequest()
1197+
.getUserSettingsFile()
1198+
.getAbsolutePath());
1199+
}
1200+
if (StringUtils.isNotBlank(this.argLine)) {
1201+
argLines.add(this.argLine);
1202+
}
1203+
1204+
executeCommand(cmdMvn, true, StringUtils.join(argLines.toArray(), " "), args);
11841205
}
11851206

11861207
/**

0 commit comments

Comments
 (0)