Skip to content

Commit d9cec4b

Browse files
committed
Inherit Global Settings and User Settings
1 parent 6800dde commit d9cec4b

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
@@ -1188,7 +1188,28 @@ private void executeGitCommand(final String... args)
11881188
*/
11891189
private void executeMvnCommand(final String... args)
11901190
throws CommandLineException, MojoFailureException {
1191-
executeCommand(cmdMvn, true, argLine, args);
1191+
1192+
final List<String> argLines = new ArrayList<String>();
1193+
1194+
if (StringUtils.isBlank(this.argLine)
1195+
|| !this.argLine.contains("-gs")) {
1196+
argLines.add("-gs");
1197+
argLines.add(this.mavenSession.getRequest()
1198+
.getGlobalSettingsFile()
1199+
.getAbsolutePath());
1200+
}
1201+
if (StringUtils.isBlank(this.argLine)
1202+
|| !this.argLine.contains("-s")) {
1203+
argLines.add("-s");
1204+
argLines.add(this.mavenSession.getRequest()
1205+
.getUserSettingsFile()
1206+
.getAbsolutePath());
1207+
}
1208+
if (StringUtils.isNotBlank(this.argLine)) {
1209+
argLines.add(this.argLine);
1210+
}
1211+
1212+
executeCommand(cmdMvn, true, StringUtils.join(argLines.toArray(), " "), args);
11921213
}
11931214

11941215
/**

0 commit comments

Comments
 (0)