You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by tr...@apache.org on 2005/08/18 14:13:51 UTC
svn commit: r233310 -
/maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/ScpSiteDeployMojo.java
Author: trygvis
Date: Thu Aug 18 05:13:47 2005
New Revision: 233310
URL: http://svn.apache.org/viewcvs?rev=233310&view=rev
Log:
o Throwing an exception if the procotol isn't 'scp' as that's the only protocol
this provider currently supports.
Modified:
maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/ScpSiteDeployMojo.java
Modified: maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/ScpSiteDeployMojo.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/ScpSiteDeployMojo.java?rev=233310&r1=233309&r2=233310&view=diff
==============================================================================
--- maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/ScpSiteDeployMojo.java (original)
+++ maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/ScpSiteDeployMojo.java Thu Aug 18 05:13:47 2005
@@ -5,6 +5,7 @@
import org.apache.maven.artifact.manager.WagonManager;
import org.apache.maven.model.DistributionManagement;
+import org.apache.maven.model.Site;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
@@ -72,7 +73,7 @@
{
File baseDir = new File( inputDirectory );
- File zipFile = null;
+ File zipFile;
try
{
@@ -90,32 +91,31 @@
if ( distributionManagement == null )
{
- String msg = "distributionManagement element is missing in the POM: " + project.getId();
-
- throw new MojoExecutionException( msg );
+ throw new MojoExecutionException( "Missing distribution management information in the project" );
}
- if ( distributionManagement.getSite() == null )
- {
- String msg = "distributionManagement/site element is missing in the POM: " + project.getId();
-
- throw new MojoExecutionException( msg );
+ Site site = distributionManagement.getSite();
+ if ( site == null )
+ {
+ throw new MojoExecutionException( "Missing site information in the distribution management element in the project.." );
}
- String url = distributionManagement.getSite().getUrl();
+ String url = site.getUrl();
- String id = distributionManagement.getSite().getId();
+ String id = site.getId();
if ( url == null )
{
- String msg = "distributionManagement/site/url element is missing in the POM: " + project.getId();
-
- throw new MojoExecutionException( msg );
-
+ throw new MojoExecutionException( "The URL to the site is missing in the project descriptor." );
}
Repository repository = new Repository( id, url );
+
+ if ( !"scp".equals( repository.getProtocol() ) )
+ {
+ throw new MojoExecutionException( "The deploy mojo currently only supports site deployment using the 'scp' protocol." );
+ }
commandExecutor = (SshCommandExecutor) wagonManager.getWagon( "scp" );
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org