in maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRunGoalsPhase.java [66:121]
protected ReleaseResult execute(
ReleaseDescriptor releaseDescriptor,
ReleaseEnvironment releaseEnvironment,
File workingDirectory,
String additionalArguments,
boolean logArguments)
throws ReleaseExecutionException {
ReleaseResult result = new ReleaseResult();
try {
String goals = getGoals(releaseDescriptor);
if (!(goals == null || goals.isEmpty())) {
logInfo(result, "Executing goals '" + buffer().strong(goals) + "'...");
if (logArguments) {
// logging arguments may log secrets: should be activated only on dryRun
logInfo(
result,
" with additional arguments: "
+ (additionalArguments == null ? "(none)" : additionalArguments));
}
MavenExecutor mavenExecutor = mavenExecutors.get(releaseEnvironment.getMavenExecutorId());
if (mavenExecutor == null) {
throw new ReleaseExecutionException(
"Cannot find Maven executor with id: " + releaseEnvironment.getMavenExecutorId());
}
File executionRoot;
String pomFileName;
if (releaseDescriptor.getPomFileName() != null) {
File rootPom = new File(workingDirectory, releaseDescriptor.getPomFileName());
executionRoot = rootPom.getParentFile();
pomFileName = rootPom.getName();
} else {
executionRoot = workingDirectory;
pomFileName = null;
}
mavenExecutor.executeGoals(
executionRoot,
goals,
releaseEnvironment,
releaseDescriptor.isInteractive(),
additionalArguments,
pomFileName,
result);
}
} catch (MavenExecutorException e) {
throw new ReleaseExecutionException(e.getMessage(), e);
}
result.setResultCode(ReleaseResult.SUCCESS);
return result;
}