use of org.apache.maven.scm.manager.NoSuchScmProviderException 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);
}
}
}
use of org.apache.maven.scm.manager.NoSuchScmProviderException in project maven-scm by apache.
the class JazzScmProviderRepositoryTest method testBrokenUrl.
private void testBrokenUrl(String scmUrl) {
try {
ScmRepository repository = scmManager.makeScmRepository(scmUrl);
fail("The expected ScmRepositoryException did not occur! " + repository);
} catch (ScmRepositoryException expected) {
// This is the expected behaviour, so we do nothing.
} catch (NoSuchScmProviderException unexpected) {
fail("Unexpected failure! " + unexpected.getMessage());
}
}
Aggregations