Skip to content

Commit 4e92bb1

Browse files
committed
Inherit Global Settings and User Settings
1 parent 14a282f commit 4e92bb1

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
@@ -1122,7 +1122,28 @@ private void executeGitCommand(final String... args)
11221122
*/
11231123
private void executeMvnCommand(final String... args)
11241124
throws CommandLineException, MojoFailureException {
1125-
executeCommand(cmdMvn, true, argLine, args);
1125+
1126+
final List<String> argLines = new ArrayList<String>();
1127+
1128+
if (StringUtils.isBlank(this.argLine)
1129+
|| !this.argLine.contains("-gs")) {
1130+
argLines.add("-gs");
1131+
argLines.add(this.mavenSession.getRequest()
1132+
.getGlobalSettingsFile()
1133+
.getAbsolutePath());
1134+
}
1135+
if (StringUtils.isBlank(this.argLine)
1136+
|| !this.argLine.contains("-s")) {
1137+
argLines.add("-s");
1138+
argLines.add(this.mavenSession.getRequest()
1139+
.getUserSettingsFile()
1140+
.getAbsolutePath());
1141+
}
1142+
if (StringUtils.isNotBlank(this.argLine)) {
1143+
argLines.add(this.argLine);
1144+
}
1145+
1146+
executeCommand(cmdMvn, true, StringUtils.join(argLines.toArray(), " "), args);
11261147
}
11271148

11281149
/**

0 commit comments

Comments
 (0)