Skip to content

Commit f7e33bb

Browse files
committed
Inherit Global Settings and User Settings
1 parent 8613f0a commit f7e33bb

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

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

11291150
/**

0 commit comments

Comments
 (0)