use of com.itemis.maven.plugins.unleash.util.functions.FileToRelativePath in project unleash-maven-plugin by shillner.
the class DevVersionUtil method commitChanges.
public void commitChanges(boolean commitPomsOnly) {
this.log.debug("\tCommitting changed POMs of all modules and pushing to remote repository. Merging with remote changes if necessary.");
this.metadata.setScmRevisionBeforeNextDevVersion(this.scmProvider.getLatestRemoteRevision());
StringBuilder message = new StringBuilder("Preparation for next development cycle.");
if (StringUtils.isNotBlank(this.scmMessagePrefix)) {
message.insert(0, this.scmMessagePrefix);
}
Builder requestBuilder = CommitRequest.builder().merge().mergeClient(new ScmPomVersionsMergeClient()).message(message.toString()).push();
FileToRelativePath pathConverter = new FileToRelativePath(this.project.getBasedir());
if (commitPomsOnly) {
for (MavenProject p : this.reactorProjects) {
requestBuilder.addPaths(pathConverter.apply(p.getFile()));
}
}
String newRevision = this.scmProvider.commit(requestBuilder.build());
this.metadata.setScmRevisionAfterNextDevVersion(newRevision);
}
Aggregations