Search in sources :

Example 1 with CheckInScmResult

use of org.apache.maven.scm.command.checkin.CheckInScmResult in project maven-plugins by apache.

the class AbstractScmPublishMojo method checkinFiles.

/**
     * Check-in content from scm checkout.
     *
     * @throws MojoExecutionException
     */
protected void checkinFiles() throws MojoExecutionException {
    if (skipCheckin) {
        return;
    }
    ScmFileSet updatedFileSet = new ScmFileSet(checkoutDirectory);
    try {
        long start = System.currentTimeMillis();
        CheckInScmResult checkinResult = checkScmResult(scmProvider.checkIn(scmRepository, updatedFileSet, new ScmBranch(scmBranch), checkinComment), "check-in files to SCM");
        logInfo("Checked in %d file(s) to revision %s in %s", checkinResult.getCheckedInFiles().size(), checkinResult.getScmRevision(), DurationFormatUtils.formatPeriod(start, System.currentTimeMillis(), "H' h 'm' m 's' s'"));
    } catch (ScmException e) {
        throw new MojoExecutionException("Failed to perform SCM checkin", e);
    }
}
Also used : ScmBranch(org.apache.maven.scm.ScmBranch) ScmFileSet(org.apache.maven.scm.ScmFileSet) ScmException(org.apache.maven.scm.ScmException) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) CheckInScmResult(org.apache.maven.scm.command.checkin.CheckInScmResult)

Aggregations

MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 ScmBranch (org.apache.maven.scm.ScmBranch)1 ScmException (org.apache.maven.scm.ScmException)1 ScmFileSet (org.apache.maven.scm.ScmFileSet)1 CheckInScmResult (org.apache.maven.scm.command.checkin.CheckInScmResult)1