maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r532350 - in /maven/release/trunk: maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ maven-release-plugin/src/main/java/org/apache/maven/plugins/release/
Date Wed, 25 Apr 2007 13:34:57 GMT
Author: evenisse
Date: Wed Apr 25 06:34:55 2007
New Revision: 532350

URL: http://svn.apache.org/viewvc?view=rev&rev=532350
Log:
[MRELEASE-145] Allow to do a partial release (don't have all projects as SNAPSHOT projects)

Modified:
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckPomPhase.java
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapVersionsPhase.java
    maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckPomPhase.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckPomPhase.java?view=diff&rev=532350&r1=532349&r2=532350
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckPomPhase.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckPomPhase.java
Wed Apr 25 06:34:55 2007
@@ -91,17 +91,21 @@
             }
         }
 
+        boolean containsSnapshotProjects = false;
+
         for ( Iterator it = reactorProjects.iterator(); it.hasNext(); )
         {
             MavenProject project = (MavenProject) it.next();
 
-            String projectId = ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId()
);
-
-            if ( !ArtifactUtils.isSnapshot( project.getVersion() ) )
+            if ( ArtifactUtils.isSnapshot( project.getVersion() ) )
             {
-                throw new ReleaseFailureException(
-                    "The project " + projectId + " isn't a snapshot (" + project.getVersion()
+ ")." );
+                containsSnapshotProjects = true;
             }
+        }
+
+        if ( !containsSnapshotProjects )
+        {
+            throw new ReleaseFailureException( "You don't have a SNAPSHOT project in the
reactor projects list." );
         }
 
         result.setResultCode( ReleaseResult.SUCCESS );

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapVersionsPhase.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapVersionsPhase.java?view=diff&rev=532350&r1=532349&r2=532350
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapVersionsPhase.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapVersionsPhase.java
Wed Apr 25 06:34:55 2007
@@ -125,28 +125,35 @@
                 }
                 else
                 {
-                    String nextVersion = null;
-                    if ( version != null )
+                    if ( ArtifactUtils.isSnapshot( project.getVersion() ) )
                     {
-                        nextVersion = version.getReleaseVersionString();
-                    }
+                        String nextVersion = null;
+                        if ( version != null )
+                        {
+                            nextVersion = version.getReleaseVersionString();
+                        }
 
-                    if ( releaseDescriptor.isInteractive() )
-                    {
-                        nextVersion = prompter.prompt(
-                            "What is the release version for \"" + project.getName() + "\"?
(" + projectId + ")",
-                            nextVersion );
+                        if ( releaseDescriptor.isInteractive() )
+                        {
+                            nextVersion = prompter.prompt(
+                                "What is the release version for \"" + project.getName()
+ "\"? (" + projectId + ")",
+                                nextVersion );
+                        }
+                        else
+                        {
+                            Map relVersions = releaseDescriptor.getReleaseVersions();
+                            if ( relVersions.containsKey( projectId ) )
+                            {
+                                nextVersion = relVersions.remove( projectId ).toString();
+                            }
+                        }
+
+                        releaseDescriptor.mapReleaseVersion( projectId, nextVersion );
                     }
                     else
                     {
-                        Map relVersions = releaseDescriptor.getReleaseVersions();
-                        if ( relVersions.containsKey( projectId ) )
-                        {
-                            nextVersion = relVersions.remove( projectId ).toString();
-                        }
+                        releaseDescriptor.mapReleaseVersion( projectId, project.getVersion()
);
                     }
-
-                    releaseDescriptor.mapReleaseVersion( projectId, nextVersion );
                 }
             }
             catch ( PrompterException e )

Modified: maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java?view=diff&rev=532350&r1=532349&r2=532350
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java
(original)
+++ maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java
Wed Apr 25 06:34:55 2007
@@ -63,6 +63,13 @@
     private boolean useEditMode;
 
     /**
+     * Whether to update dependencies version to the next development version.
+     *
+     * @parameter expression="${updateDependencies}" default-value="true"
+     */
+    private boolean updateDependencies;
+
+    /**
      * Dry run: don't checkin or tag anything in the scm repository, or modify the checkout.
      * Running <code>mvn -DdryRun=true release:prepare</code> is useful in order
to check that modifications to
      * poms and scm operations (only listed on the console) are working as expected.
@@ -103,6 +110,7 @@
         config.setScmUseEditMode( useEditMode );
         config.setPreparationGoals( preparationGoals );
         config.setCommitByProject( commitByProject );
+        config.setUpdateDependencies( updateDependencies );
 
         try
         {



Mime
View raw message