Skip to content

Commit f817cf5

Browse files
committed
Inherit Global Settings and User Settings
1 parent c7f8def commit f817cf5

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
@@ -1320,7 +1320,28 @@ private void executeGitCommand(final String... args)
13201320
*/
13211321
private void executeMvnCommand(final String... args)
13221322
throws CommandLineException, MojoFailureException {
1323-
executeCommand(cmdMvn, true, argLine, args);
1323+
1324+
final List<String> argLines = new ArrayList<String>();
1325+
1326+
if (StringUtils.isBlank(this.argLine)
1327+
|| !this.argLine.contains("-gs")) {
1328+
argLines.add("-gs");
1329+
argLines.add(this.mavenSession.getRequest()
1330+
.getGlobalSettingsFile()
1331+
.getAbsolutePath());
1332+
}
1333+
if (StringUtils.isBlank(this.argLine)
1334+
|| !this.argLine.contains("-s")) {
1335+
argLines.add("-s");
1336+
argLines.add(this.mavenSession.getRequest()
1337+
.getUserSettingsFile()
1338+
.getAbsolutePath());
1339+
}
1340+
if (StringUtils.isNotBlank(this.argLine)) {
1341+
argLines.add(this.argLine);
1342+
}
1343+
1344+
executeCommand(cmdMvn, true, StringUtils.join(argLines.toArray(), " "), args);
13241345
}
13251346

13261347
/**

0 commit comments

Comments
 (0)