You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2013/09/14 16:30:51 UTC

svn commit: r1523257 - in /maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy: AbstractDeployMojo.java DeployFileMojo.java DeployMojo.java

Author: rfscholte
Date: Sat Sep 14 14:30:51 2013
New Revision: 1523257

URL: http://svn.apache.org/r1523257
Log:
Code formatting

Modified:
    maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java
    maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
    maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java

Modified: maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java?rev=1523257&r1=1523256&r2=1523257&view=diff
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java (original)
+++ maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java Sat Sep 14 14:30:51 2013
@@ -82,9 +82,9 @@ public abstract class AbstractDeployMojo
     protected boolean updateReleaseInfo;
 
     /**
-     * Parameter used to control how many times a failed deployment will be retried before giving up and failing.
-     * If a value outside the range 1-10 is specified it will be pulled to the nearest value within the range 1-10.
-     *
+     * Parameter used to control how many times a failed deployment will be retried before giving up and failing. If a
+     * value outside the range 1-10 is specified it will be pulled to the nearest value within the range 1-10.
+     * 
      * @since 2.7
      */
     @Parameter( property = "retryFailedDeploymentCount", defaultValue = "1" )
@@ -136,7 +136,7 @@ public abstract class AbstractDeployMojo
 
     /**
      * Deploy an artifact from a particular file.
-     *
+     * 
      * @param source the file to deploy
      * @param artifact the artifact definition
      * @param deploymentRepository the repository to deploy to
@@ -153,10 +153,9 @@ public abstract class AbstractDeployMojo
         {
             try
             {
-                if (count > 0)
+                if ( count > 0 )
                 {
-                    getLog().info(
-                        "Retrying deployment attempt " + ( count + 1 ) + " of " + retryFailedDeploymentCount );
+                    getLog().info( "Retrying deployment attempt " + ( count + 1 ) + " of " + retryFailedDeploymentCount );
                 }
                 getDeployer().deploy( source, artifact, deploymentRepository, localRepository );
                 exception = null;
@@ -164,8 +163,9 @@ public abstract class AbstractDeployMojo
             }
             catch ( ArtifactDeploymentException e )
             {
-                if (count + 1 < retryFailedDeploymentCount) {
-                    getLog().warn( "Encountered issue during deployment: " + e.getLocalizedMessage());
+                if ( count + 1 < retryFailedDeploymentCount )
+                {
+                    getLog().warn( "Encountered issue during deployment: " + e.getLocalizedMessage() );
                     getLog().debug( e );
                 }
                 if ( exception == null )

Modified: maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java?rev=1523257&r1=1523256&r2=1523257&view=diff
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java (original)
+++ maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java Sat Sep 14 14:30:51 2013
@@ -54,7 +54,7 @@ import org.codehaus.plexus.util.xml.pull
 
 /**
  * Installs the artifact in the remote repository.
- *
+ * 
  * @author <a href="mailto:aramirez@apache.org">Allan Ramirez</a>
  */
 @Mojo( name = "deploy-file", requiresProject = false, threadSafe = true )
@@ -74,29 +74,28 @@ public class DeployFileMojo
     private MavenProjectHelper projectHelper;
 
     /**
-     * GroupId of the artifact to be deployed.  Retrieved from POM file if specified.
+     * GroupId of the artifact to be deployed. Retrieved from POM file if specified.
      */
     @Parameter( property = "groupId" )
     private String groupId;
 
     /**
-     * ArtifactId of the artifact to be deployed.  Retrieved from POM file if specified.
+     * ArtifactId of the artifact to be deployed. Retrieved from POM file if specified.
      */
     @Parameter( property = "artifactId" )
     private String artifactId;
 
     /**
-     * Version of the artifact to be deployed.  Retrieved from POM file if specified.
+     * Version of the artifact to be deployed. Retrieved from POM file if specified.
      */
     @Parameter( property = "version" )
     private String version;
 
     /**
-     * Type of the artifact to be deployed.
-     * Retrieved from the &lt;packaging&gt element of the POM file if a POM file specified.
-     * Defaults to the file extension if it is not specified via command line or POM.<br/>
-     * Maven uses two terms to refer to this datum: the &lt;packaging&gt; element
-     * for the entire POM, and the &lt;type&gt; element in a dependency specification.
+     * Type of the artifact to be deployed. Retrieved from the &lt;packaging&gt element of the POM file if a POM file
+     * specified. Defaults to the file extension if it is not specified via command line or POM.<br/>
+     * Maven uses two terms to refer to this datum: the &lt;packaging&gt; element for the entire POM, and the
+     * &lt;type&gt; element in a dependency specification.
      */
     @Parameter( property = "packaging" )
     private String packaging;
@@ -126,15 +125,14 @@ public class DeployFileMojo
     private File sources;
 
     /**
-     * Server Id to map on the &lt;id&gt; under &lt;server&gt; section of settings.xml
-     * In most cases, this parameter will be required for authentication.
+     * Server Id to map on the &lt;id&gt; under &lt;server&gt; section of settings.xml In most cases, this parameter
+     * will be required for authentication.
      */
     @Parameter( property = "repositoryId", defaultValue = "remote-repository", required = true )
     private String repositoryId;
 
     /**
-     * The type of remote repository layout to deploy to. Try <i>legacy</i> for
-     * a Maven 1.x-style repository layout.
+     * The type of remote repository layout to deploy to. Try <i>legacy</i> for a Maven 1.x-style repository layout.
      */
     @Parameter( property = "repositoryLayout", defaultValue = "default" )
     private String repositoryLayout;
@@ -147,15 +145,13 @@ public class DeployFileMojo
     private String url;
 
     /**
-     * Location of an existing POM file to be deployed alongside the main
-     * artifact, given by the ${file} parameter.
+     * Location of an existing POM file to be deployed alongside the main artifact, given by the ${file} parameter.
      */
     @Parameter( property = "pomFile" )
     private File pomFile;
 
     /**
-     * Upload a POM for this artifact.  Will generate a default POM if none is
-     * supplied with the pomFile argument.
+     * Upload a POM for this artifact. Will generate a default POM if none is supplied with the pomFile argument.
      */
     @Parameter( property = "generatePom", defaultValue = "true" )
     private boolean generatePom;
@@ -179,8 +175,8 @@ public class DeployFileMojo
     private ModelValidator modelValidator;
 
     /**
-     * A comma separated list of types for each of the extra side artifacts to deploy. If there is a mis-match in
-     * the number of entries in {@link #files} or {@link #classifiers}, then an error will be raised.
+     * A comma separated list of types for each of the extra side artifacts to deploy. If there is a mis-match in the
+     * number of entries in {@link #files} or {@link #classifiers}, then an error will be raised.
      */
     @Parameter( property = "types" )
     private String types;
@@ -193,8 +189,8 @@ public class DeployFileMojo
     private String classifiers;
 
     /**
-     * A comma separated list of files for each of the extra side artifacts to deploy. If there is a mis-match in
-     * the number of entries in {@link #types} or {@link #classifiers}, then an error will be raised.
+     * A comma separated list of files for each of the extra side artifacts to deploy. If there is a mis-match in the
+     * number of entries in {@link #types} or {@link #classifiers}, then an error will be raised.
      */
     @Parameter( property = "files" )
     private String files;
@@ -211,7 +207,7 @@ public class DeployFileMojo
 
             processModel( model );
         }
-        
+
         if ( packaging == null && file != null )
         {
             packaging = FileUtils.getExtension( file.getName() );
@@ -272,7 +268,7 @@ public class DeployFileMojo
         {
             artifact.setRelease( true );
         }
-        
+
         project.setArtifact( artifact );
 
         try
@@ -309,13 +305,13 @@ public class DeployFileMojo
             int classifiersLength = StringUtils.countMatches( classifiers, "," );
             if ( typesLength != filesLength )
             {
-                throw new MojoExecutionException( "You must specify the same number of entries in 'files' and " +
-                        "'types' (respectively " + filesLength + " and " + typesLength + " entries )" );
+                throw new MojoExecutionException( "You must specify the same number of entries in 'files' and "
+                    + "'types' (respectively " + filesLength + " and " + typesLength + " entries )" );
             }
             if ( classifiersLength != filesLength )
             {
-                throw new MojoExecutionException( "You must specify the same number of entries in 'files' and " +
-                        "'classifiers' (respectively " + filesLength + " and " + classifiersLength + " entries )" );
+                throw new MojoExecutionException( "You must specify the same number of entries in 'files' and "
+                    + "'classifiers' (respectively " + filesLength + " and " + classifiersLength + " entries )" );
             }
             int fi = 0;
             int ti = 0;
@@ -351,8 +347,8 @@ public class DeployFileMojo
                     }
                     else
                     {
-                        projectHelper.attachArtifact( project, types.substring( ti, nti).trim(), 
-                                classifiers.substring( ci, nci ).trim(), file);
+                        projectHelper.attachArtifact( project, types.substring( ti, nti ).trim(),
+                                                      classifiers.substring( ci, nci ).trim(), file );
                     }
                 }
                 else
@@ -379,7 +375,7 @@ public class DeployFileMojo
         @SuppressWarnings( "unchecked" )
         List<Artifact> attachedArtifacts = project.getAttachedArtifacts();
 
-        for ( Artifact attached : attachedArtifacts)
+        for ( Artifact attached : attachedArtifacts )
         {
             try
             {
@@ -387,7 +383,8 @@ public class DeployFileMojo
             }
             catch ( ArtifactDeploymentException e )
             {
-                throw new MojoExecutionException( "Error deploying attached artifact " + attached.getFile() + ": " + e.getMessage(), e );
+                throw new MojoExecutionException( "Error deploying attached artifact " + attached.getFile() + ": "
+                    + e.getMessage(), e );
             }
         }
 
@@ -408,7 +405,7 @@ public class DeployFileMojo
 
     /**
      * Process the supplied pomFile to get groupId, artifactId, version, and packaging
-     *
+     * 
      * @param model The POM to extract missing artifact coordinates from, must not be <code>null</code>.
      */
     private void processModel( Model model )
@@ -477,7 +474,7 @@ public class DeployFileMojo
 
     /**
      * Generates a minimal POM from the user-supplied artifact information.
-     *
+     * 
      * @return The path to the generated POM file, never <code>null</code>.
      * @throws MojoExecutionException If the generation failed.
      */

Modified: maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java?rev=1523257&r1=1523256&r2=1523257&view=diff
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java (original)
+++ maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java Sat Sep 14 14:30:51 2013
@@ -41,7 +41,7 @@ import java.util.regex.Pattern;
 
 /**
  * Deploys an artifact to remote repository.
- *
+ * 
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  * @author <a href="mailto:jdcasey@apache.org">John Casey (refactoring only)</a>
  * @version $Id$
@@ -57,13 +57,13 @@ public class DeployMojo
      */
     @Component
     private MavenProject project;
-    
+
     @Parameter( defaultValue = "${reactorProjects}", required = true, readonly = true )
     private List<MavenProject> reactorProjects;
-    
+
     /**
-     * Whether every project should be deployed during its own deploy-phase or at the end of the multimodule build.
-     * If set to {@code true} and the build fails, none of the reactor projects is deployed 
+     * Whether every project should be deployed during its own deploy-phase or at the end of the multimodule build. If
+     * set to {@code true} and the build fails, none of the reactor projects is deployed
      * 
      * @since 2.8
      */
@@ -89,19 +89,17 @@ public class DeployMojo
     private File pomFile;
 
     /**
-     * Specifies an alternative repository to which the project artifacts should be deployed ( other
-     * than those specified in &lt;distributionManagement&gt; ).
-     * <br/>
+     * Specifies an alternative repository to which the project artifacts should be deployed ( other than those
+     * specified in &lt;distributionManagement&gt; ). <br/>
      * Format: id::layout::url
-     * 
      * <dl>
-     *   <dt>id</dt>
-     *   <dd>The id can be used to pick up the correct credentials from the settings.xml</dd>
-     *   <dt>layout</dt>
-     *   <dd>Either <code>default</code> for the Maven2 layout or <code>legacy</code> for the Maven1 layout. 
-     *       Maven3 also uses the <code>default</code> layout.</dd>
-     *   <dt>url</dt>
-     *   <dd>The location of the repository</dd>
+     * <dt>id</dt>
+     * <dd>The id can be used to pick up the correct credentials from the settings.xml</dd>
+     * <dt>layout</dt>
+     * <dd>Either <code>default</code> for the Maven2 layout or <code>legacy</code> for the Maven1 layout. Maven3 also
+     * uses the <code>default</code> layout.</dd>
+     * <dt>url</dt>
+     * <dd>The location of the repository</dd>
      * </dl>
      */
     @Parameter( property = "altDeploymentRepository" )
@@ -133,7 +131,7 @@ public class DeployMojo
 
     /**
      * Set this to 'true' to bypass artifact deploy
-     *
+     * 
      * @since 2.4
      */
     @Parameter( property = "maven.deploy.skip", defaultValue = "false" )
@@ -149,25 +147,25 @@ public class DeployMojo
         }
 
         failIfOffline();
-        
-        if( !deployAtEnd )
+
+        if ( !deployAtEnd )
         {
             deployProject( project );
         }
         else
         {
             MavenProject lastProject = reactorProjects.get( reactorProjects.size() - 1 );
-            if( lastProject.equals( project ) )
+            if ( lastProject.equals( project ) )
             {
-                for( MavenProject reactorProject : reactorProjects )
+                for ( MavenProject reactorProject : reactorProjects )
                 {
                     deployProject( reactorProject );
                 }
             }
             else
             {
-                getLog().info( "Deploying " + project.getGroupId() + ":" + project.getArtifactId() + 
-                               ":" + project.getVersion() + " at end" );
+                getLog().info( "Deploying " + project.getGroupId() + ":" + project.getArtifactId() + ":"
+                                   + project.getVersion() + " at end" );
             }
         }
     }
@@ -178,10 +176,10 @@ public class DeployMojo
         Artifact artifact = project.getArtifact();
         String packaging = project.getPackaging();
         File pomFile = project.getFile();
-        
+
         @SuppressWarnings( "unchecked" )
         List<Artifact> attachedArtifacts = project.getAttachedArtifacts();
-        
+
         ArtifactRepository repo = getDeploymentRepository( project );
 
         String protocol = repo.getProtocol();
@@ -195,7 +193,6 @@ public class DeployMojo
                 sshFile.mkdirs();
             }
         }
-        
 
         // Deploy the POM
         boolean isPomArtifact = "pom".equals( packaging );
@@ -309,8 +306,9 @@ public class DeployMojo
 
         if ( repo == null )
         {
-            String msg = "Deployment failed: repository element was not specified in the POM inside"
-                + " distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter";
+            String msg =
+                "Deployment failed: repository element was not specified in the POM inside"
+                    + " distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter";
 
             throw new MojoExecutionException( msg );
         }