Search in sources :

Example 1 with ScmRepositoryException

use of org.apache.maven.scm.repository.ScmRepositoryException in project maven-plugins by apache.

the class AbstractScmPublishMojo method execute.

public void execute() throws MojoExecutionException, MojoFailureException {
    // setup the scm plugin with help from release plugin utilities
    try {
        setupScm();
    } catch (ScmRepositoryException e) {
        throw new MojoExecutionException(e.getMessage(), e);
    } catch (NoSuchScmProviderException e) {
        throw new MojoExecutionException(e.getMessage(), e);
    }
    boolean tmpCheckout = false;
    if (checkoutDirectory.getPath().contains("${project.")) {
        try {
            tmpCheckout = true;
            checkoutDirectory = File.createTempFile("maven-scm-publish", ".checkout");
            checkoutDirectory.delete();
            checkoutDirectory.mkdir();
        } catch (IOException ioe) {
            throw new MojoExecutionException(ioe.getMessage(), ioe);
        }
    }
    try {
        scmPublishExecute();
    } finally {
        if (tmpCheckout) {
            FileUtils.deleteQuietly(checkoutDirectory);
        }
    }
}
Also used : ScmRepositoryException(org.apache.maven.scm.repository.ScmRepositoryException) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) IOException(java.io.IOException) NoSuchScmProviderException(org.apache.maven.scm.manager.NoSuchScmProviderException)

Aggregations

IOException (java.io.IOException)1 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 NoSuchScmProviderException (org.apache.maven.scm.manager.NoSuchScmProviderException)1 ScmRepositoryException (org.apache.maven.scm.repository.ScmRepositoryException)1