maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r399109 - in /maven/plugins/trunk/maven-release-plugin/src: main/java/org/apache/maven/plugins/release/config/ test/java/org/apache/maven/plugins/release/config/ test/resources/org/apache/maven/plugins/release/
Date Wed, 03 May 2006 02:15:47 GMT
Author: brett
Date: Tue May  2 19:15:45 2006
New Revision: 399109

URL: http://svn.apache.org/viewcvs?rev=399109&view=rev
Log:
[MRELEASE-98] fix bug with groups/artifacts that have '.' in their id.

Modified:
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStore.java
    maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStoreTest.java
    maven/plugins/trunk/maven-release-plugin/src/test/resources/org/apache/maven/plugins/release/DefaultReleaseManagerTest.xml

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStore.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStore.java?rev=399109&r1=399108&r2=399109&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStore.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStore.java
Tue May  2 19:15:45 2006
@@ -108,8 +108,8 @@
             }
             else if ( property.startsWith( "project.scm." ) )
             {
-                int index = property.indexOf( '.', "project.scm.".length() );
-                if ( index > 0 )
+                int index = property.lastIndexOf( '.' );
+                if ( index > "project.scm.".length() )
                 {
                     String key = property.substring( "project.scm.".length(), index );
 

Modified: maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStoreTest.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStoreTest.java?rev=399109&r1=399108&r2=399109&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStoreTest.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStoreTest.java
Tue May  2 19:15:45 2006
@@ -171,6 +171,34 @@
         assertEquals( "compare configuration", config, rereadConfiguration );
     }
 
+    public void testWriteToNewFileDottedIds()
+        throws ReleaseConfigurationStoreException
+    {
+        File file = getTestFile( "target/test-classes/new-release.properties" );
+        file.delete();
+        assertFalse( "Check file doesn't exist", file.exists() );
+
+        ReleaseConfiguration config = new ReleaseConfiguration();
+        config.setCompletedPhase( "completed-phase-write" );
+        config.setUrl( "url-write" );
+
+        config.mapReleaseVersion( "group.id:artifact.id", "1.1" );
+        config.mapDevelopmentVersion( "group.id:artifact.id", "1.2-SNAPSHOT" );
+
+        Scm scm = new Scm();
+        scm.setConnection( "connection" );
+        scm.setDeveloperConnection( "devConnection" );
+        scm.setTag( "tag" );
+        scm.setUrl( "url" );
+        config.mapOriginalScmInfo( "group.id:artifact.id", scm );
+
+        store.write( config, file );
+
+        ReleaseConfiguration rereadConfiguration = store.read( file );
+
+        assertEquals( "compare configuration", config, rereadConfiguration );
+    }
+
     public void testOverwriteFile()
         throws ReleaseConfigurationStoreException
     {

Modified: maven/plugins/trunk/maven-release-plugin/src/test/resources/org/apache/maven/plugins/release/DefaultReleaseManagerTest.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/test/resources/org/apache/maven/plugins/release/DefaultReleaseManagerTest.xml?rev=399109&r1=399108&r2=399109&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/test/resources/org/apache/maven/plugins/release/DefaultReleaseManagerTest.xml
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/test/resources/org/apache/maven/plugins/release/DefaultReleaseManagerTest.xml
Tue May  2 19:15:45 2006
@@ -89,5 +89,14 @@
         <name>step3</name>
       </configuration>
     </component>
+    <!-- Turn off info messages -->
+    <component>
+      <role>org.codehaus.plexus.logging.LoggerManager</role>
+      <implementation>org.codehaus.plexus.logging.console.ConsoleLoggerManager</implementation>
+      <lifecycle-handler>basic</lifecycle-handler>
+      <configuration>
+        <threshold>ERROR</threshold>
+      </configuration>
+    </component>
   </components>
 </component-set>



Mime
View raw message