You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by br...@apache.org on 2006/04/24 02:22:55 UTC

svn commit: r396355 - in /maven/plugins/trunk/maven-release-plugin/src: main/java/org/apache/maven/plugins/release/ main/java/org/apache/maven/plugins/release/helpers/ main/java/org/apache/maven/plugins/release/versions/ test/java/org/apache/maven/plug...

Author: brett
Date: Sun Apr 23 17:22:53 2006
New Revision: 396355

URL: http://svn.apache.org/viewcvs?rev=396355&view=rev
Log:
align copyright, formatting, imports

Modified:
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ProjectScmRewriter.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ProjectVersionResolver.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ReleaseProgressTracker.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/versions/DefaultVersionInfo.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/versions/VersionInfo.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/versions/VersionParseException.java
    maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/PrepareReleaseMojoTest.java
    maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/versions/DefaultVersionInfoTest.java

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java?rev=396355&r1=396354&r2=396355&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java (original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java Sun Apr 23 17:22:53 2006
@@ -1,14 +1,14 @@
 package org.apache.maven.plugins.release;
 
 /*
- * Copyright 2001-2005 The Apache Software Foundation.
- * 
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -111,6 +111,7 @@
 
     /**
      * Set the SCM Helper
+     *
      * @param scmHelper
      */
     protected void setScmHelper( ScmHelper scmHelper )
@@ -119,7 +120,8 @@
     }
 
     /**
-     * Get the SCM Manager 
+     * Get the SCM Manager
+     *
      * @return
      */
     private ScmManager getScmManager()
@@ -129,6 +131,7 @@
 
     /**
      * Set the SCM Manager
+     *
      * @param scmManager
      */
     public void setScmManager( ScmManager scmManager )
@@ -151,7 +154,7 @@
 
             try
             {
-                repository = getScmManager().makeScmRepository( scmHelper.getUrl() );
+                repository = scmManager.makeScmRepository( scmHelper.getUrl() );
             }
             catch ( ScmRepositoryException e )
             {

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java?rev=396355&r1=396354&r2=396355&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java (original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java Sun Apr 23 17:22:53 2006
@@ -1,7 +1,7 @@
 package org.apache.maven.plugins.release;
 
 /*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2005-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,7 +23,6 @@
 import org.apache.maven.plugins.release.helpers.ScmHelper;
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.util.StringUtils;
-import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.cli.CommandLineException;
 import org.codehaus.plexus.util.cli.CommandLineUtils;
 import org.codehaus.plexus.util.cli.Commandline;
@@ -32,8 +31,8 @@
 
 import java.io.BufferedReader;
 import java.io.File;
-import java.io.InputStreamReader;
 import java.io.IOException;
+import java.io.InputStreamReader;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
@@ -50,17 +49,19 @@
     extends AbstractReleaseMojo
 {
     /**
-     * Comma or space separated goals 
+     * Comma or space separated goals
+     *
      * @parameter expression="${goals}"
      */
     private String goals = "deploy";
 
     /**
-     * Comma or space separated arguments such as 
+     * Comma or space separated arguments such as
+     *
      * @parameter expression="${arguments}"
      */
     private String arguments;
-    
+
     /**
      * @parameter expression="${project.build.directory}/checkout"
      * @required
@@ -80,14 +81,14 @@
      * @readonly
      */
     private boolean interactive;
-    
+
     /**
      * @parameter expression="${releasePom}"
      */
     private String releasePom;
 
     private ReleaseProgressTracker releaseProgress;
-    
+
     private final static String MAVEN_TEST_SKIP = "maven.test.skip";
 
     public void execute()
@@ -130,7 +131,7 @@
         {
             addSystemEnvironment( cl );
         }
-        catch( Exception e )
+        catch ( Exception e )
         {
             throw new MojoExecutionException( "Can't add system environment variables to mvn command line.", e );
         }
@@ -147,8 +148,8 @@
         {
             // accept both space and comma, so the old way still work
             String [] tokens = StringUtils.split( this.goals, ", " );
-            
-            for ( int i = 0 ; i < tokens.length ; ++i )
+
+            for ( int i = 0; i < tokens.length; ++i )
             {
                 cl.createArgument().setValue( tokens[i] );
             }
@@ -157,20 +158,20 @@
         if ( this.arguments != null )
         {
             String [] tokens = StringUtils.split( this.arguments, ", " );
-            
-            for ( int i = 0 ; i < tokens.length ; ++i )
+
+            for ( int i = 0; i < tokens.length; ++i )
             {
                 cl.createArgument().setValue( tokens[i] );
             }
         }
-        
+
         cl.createArgument().setLine( "--no-plugin-updates" );
 
         if ( !interactive )
         {
             cl.createArgument().setLine( "--batch-mode" );
         }
-        
+
         if ( StringUtils.isNotEmpty( System.getProperty( MAVEN_TEST_SKIP ) ) )
         {
             cl.createArgument().setLine( "-D" + MAVEN_TEST_SKIP + "=" + System.getProperty( MAVEN_TEST_SKIP ) );
@@ -182,7 +183,7 @@
 
             releasePom = pomFile.getName();
         }
-        
+
         if ( releasePom.equals( Maven.RELEASE_POMv4 ) && interactive )
         {
             StringBuffer warning = new StringBuffer();
@@ -190,15 +191,15 @@
             warning.append( "\nYou have chosen to use the fully resolved release-POM to deploy this project." );
             warning.append( "\n" );
             warning.append( "\nNOTE: Deploying artifacts using the fully resolved release-POM " );
-            warning.append( "\nwill result in loss of any version ranges specified for your");
+            warning.append( "\nwill result in loss of any version ranges specified for your" );
             warning.append( "\nproject's dependencies." );
             warning.append( "\n" );
             warning.append( "\nAre you sure you want to do this?" );
             warning.append( "\n" );
             warning.append( "\n*******************************************************************************\n" );
-            
+
             getLog().warn( warning );
-            
+
             getLog().info( "Enter the POM filename to use for deployment: [" + releasePom + "] " );
 
             try
@@ -215,11 +216,11 @@
                 throw new MojoExecutionException( "An error has occurred while reading the pom file location.", e );
             }
         }
-        
+
         getLog().info( "Releasing project based on POM: " + releasePom + " in working directory: " + workingDirectory );
-        
+
         cl.createArgument().setLine( "-f " + releasePom );
-        
+
         List profiles = project.getActiveProfiles();
 
         if ( profiles != null && !profiles.isEmpty() )
@@ -245,7 +246,7 @@
         try
         {
             this.getLog().info( cl.toString() );
-            
+
             int result = CommandLineUtils.executeCommandLine( cl, consumer, consumer );
 
             if ( result != 0 )
@@ -319,7 +320,7 @@
         //If this is windows set the shell to command.com or cmd.exe with correct arguments.
         if ( os.indexOf( "windows" ) != -1 )
         {
-            if (os.indexOf("95") != -1 || os.indexOf("98") != -1 || os.indexOf("Me") != -1)
+            if ( os.indexOf( "95" ) != -1 || os.indexOf( "98" ) != -1 || os.indexOf( "Me" ) != -1 )
             {
                 p = r.exec( "command.com /c set" );
             }
@@ -337,7 +338,7 @@
 
         String line;
 
-        while( ( line = br.readLine() ) != null )
+        while ( ( line = br.readLine() ) != null )
         {
             int idx = line.indexOf( '=' );
 

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ProjectScmRewriter.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ProjectScmRewriter.java?rev=396355&r1=396354&r2=396355&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ProjectScmRewriter.java (original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ProjectScmRewriter.java Sun Apr 23 17:22:53 2006
@@ -1,7 +1,7 @@
 package org.apache.maven.plugins.release.helpers;
 
 /*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2005-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -44,7 +44,7 @@
         }
     }
 
-    public void restoreScmInfo( Model model ) 
+    public void restoreScmInfo( Model model )
         throws MojoExecutionException
     {
         Scm scm = model.getScm();
@@ -55,12 +55,13 @@
             {
                 groupId = model.getParent().getGroupId();
             }
-            
-            if ( groupId == null ) 
+
+            if ( groupId == null )
             {
-                throw new MojoExecutionException("Unable to determine groupId for artifact: " + model.getArtifactId() );
+                throw new MojoExecutionException(
+                    "Unable to determine groupId for artifact: " + model.getArtifactId() );
             }
-            
+
             String projectId = ArtifactUtils.versionlessKey( groupId, model.getArtifactId() );
 
             releaseProgress.restoreScmInfo( projectId, scm );

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ProjectVersionResolver.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ProjectVersionResolver.java?rev=396355&r1=396354&r2=396355&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ProjectVersionResolver.java (original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ProjectVersionResolver.java Sun Apr 23 17:22:53 2006
@@ -1,7 +1,7 @@
 package org.apache.maven.plugins.release.helpers;
 
 /*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2005-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ReleaseProgressTracker.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ReleaseProgressTracker.java?rev=396355&r1=396354&r2=396355&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ReleaseProgressTracker.java (original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ReleaseProgressTracker.java Sun Apr 23 17:22:53 2006
@@ -1,14 +1,14 @@
 package org.apache.maven.plugins.release.helpers;
 
 /*
- * Copyright 2001-2006 The Apache Software Foundation.
- * 
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/versions/DefaultVersionInfo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/versions/DefaultVersionInfo.java?rev=396355&r1=396354&r2=396355&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/versions/DefaultVersionInfo.java (original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/versions/DefaultVersionInfo.java Sun Apr 23 17:22:53 2006
@@ -1,14 +1,14 @@
 package org.apache.maven.plugins.release.versions;
 
 /*
- * Copyright 2001-2006 The Apache Software Foundation.
- * 
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/versions/VersionInfo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/versions/VersionInfo.java?rev=396355&r1=396354&r2=396355&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/versions/VersionInfo.java (original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/versions/VersionInfo.java Sun Apr 23 17:22:53 2006
@@ -1,14 +1,14 @@
 package org.apache.maven.plugins.release.versions;
 
 /*
- * Copyright 2001-2006 The Apache Software Foundation.
- * 
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/versions/VersionParseException.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/versions/VersionParseException.java?rev=396355&r1=396354&r2=396355&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/versions/VersionParseException.java (original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/versions/VersionParseException.java Sun Apr 23 17:22:53 2006
@@ -1,14 +1,14 @@
 package org.apache.maven.plugins.release.versions;
 
 /*
- * Copyright 2001-2006 The Apache Software Foundation.
- * 
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Modified: maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/PrepareReleaseMojoTest.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/PrepareReleaseMojoTest.java?rev=396355&r1=396354&r2=396355&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/PrepareReleaseMojoTest.java (original)
+++ maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/PrepareReleaseMojoTest.java Sun Apr 23 17:22:53 2006
@@ -1,14 +1,14 @@
 package org.apache.maven.plugins.release;
 
 /*
- * Copyright 2001-2006 The Apache Software Foundation.
- * 
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,10 +16,6 @@
  * limitations under the License.
  */
 
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-
 import org.apache.maven.model.Contributor;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
@@ -35,9 +31,13 @@
 import org.jmock.core.stub.ReturnStub;
 import org.jmock.core.stub.ThrowStub;
 
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+
 /**
  * Test for PrepareReleaseMojo
- * 
+ *
  * @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
  * @version $Id$
  */
@@ -69,6 +69,7 @@
 
     /**
      * Test for writePom with special characters in the pom
+     *
      * @throws Exception
      */
     public void testWritePom()
@@ -77,7 +78,7 @@
         Model model = new Model();
         Contributor contributor = new Contributor();
         /* hack to avoid problems with sources encoding, this string contains accentuated "aeiou" */
-        String s = new String( new byte[] { -31, -23, -19, -13, -6 } );
+        String s = new String( new byte[]{-31, -23, -19, -13, -6} );
         contributor.setName( s );
         model.addContributor( contributor );
         File file = new File( mojo.basedir, "testWritePom.xml" );
@@ -98,6 +99,7 @@
 
     /**
      * Test for writePom when the ScmHelper throws a ScmException
+     *
      * @throws Exception
      */
     public void testWritePomWithScmException()

Modified: maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/versions/DefaultVersionInfoTest.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/versions/DefaultVersionInfoTest.java?rev=396355&r1=396354&r2=396355&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/versions/DefaultVersionInfoTest.java (original)
+++ maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/versions/DefaultVersionInfoTest.java Sun Apr 23 17:22:53 2006
@@ -1,14 +1,14 @@
 package org.apache.maven.plugins.release.versions;
 
 /*
- * Copyright 2001-2006 The Apache Software Foundation.
- * 
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.