Search in sources :

Example 1 with Builder

use of com.itemis.maven.plugins.unleash.scm.requests.CommitRequest.Builder 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);
}
Also used : ScmPomVersionsMergeClient(com.itemis.maven.plugins.unleash.util.scm.ScmPomVersionsMergeClient) MavenProject(org.apache.maven.project.MavenProject) Builder(com.itemis.maven.plugins.unleash.scm.requests.CommitRequest.Builder) FileToRelativePath(com.itemis.maven.plugins.unleash.util.functions.FileToRelativePath)

Aggregations

Builder (com.itemis.maven.plugins.unleash.scm.requests.CommitRequest.Builder)1 FileToRelativePath (com.itemis.maven.plugins.unleash.util.functions.FileToRelativePath)1 ScmPomVersionsMergeClient (com.itemis.maven.plugins.unleash.util.scm.ScmPomVersionsMergeClient)1 MavenProject (org.apache.maven.project.MavenProject)1