maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r1054683 - in /maven/maven-3/trunk/maven-aether-provider/src/main/java/org/apache/maven/repository/internal: MavenMetadata.java VersionsMetadata.java
Date Mon, 03 Jan 2011 16:56:51 GMT
Author: bentmann
Date: Mon Jan  3 16:56:51 2011
New Revision: 1054683

URL: http://svn.apache.org/viewvc?rev=1054683&view=rev
Log:
[MNG-4952] [regression] RELEASE field of repository metadata is not updated upon repeated
deployments

Modified:
    maven/maven-3/trunk/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenMetadata.java
    maven/maven-3/trunk/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadata.java

Modified: maven/maven-3/trunk/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenMetadata.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenMetadata.java?rev=1054683&r1=1054682&r2=1054683&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenMetadata.java
(original)
+++ maven/maven-3/trunk/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenMetadata.java
Mon Jan  3 16:56:51 2011
@@ -25,7 +25,6 @@ import java.io.Reader;
 import java.io.Writer;
 
 import org.apache.maven.artifact.repository.metadata.Metadata;
-import org.apache.maven.artifact.repository.metadata.Versioning;
 import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader;
 import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Writer;
 import org.codehaus.plexus.util.IOUtil;
@@ -81,24 +80,7 @@ abstract class MavenMetadata
         return merged;
     }
 
-    protected void merge( Metadata recessive )
-    {
-        Versioning versioning = recessive.getVersioning();
-        if ( versioning != null )
-        {
-            versioning.setLastUpdated( null );
-        }
-
-        Metadata dominant = metadata;
-
-        versioning = dominant.getVersioning();
-        if ( versioning != null )
-        {
-            versioning.updateTimestamp();
-        }
-
-        dominant.merge( recessive );
-    }
+    protected abstract void merge( Metadata recessive );
 
     private Metadata read( File metadataFile )
         throws RepositoryException

Modified: maven/maven-3/trunk/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadata.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadata.java?rev=1054683&r1=1054682&r2=1054683&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadata.java
(original)
+++ maven/maven-3/trunk/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadata.java
Mon Jan  3 16:56:51 2011
@@ -20,6 +20,9 @@ package org.apache.maven.repository.inte
  */
 
 import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedHashSet;
 
 import org.apache.maven.artifact.repository.metadata.Metadata;
 import org.apache.maven.artifact.repository.metadata.Versioning;
@@ -68,6 +71,29 @@ final class VersionsMetadata
         return metadata;
     }
 
+    @Override
+    protected void merge( Metadata recessive )
+    {
+        Versioning versioning = metadata.getVersioning();
+        versioning.updateTimestamp();
+
+        if ( recessive.getVersioning() != null )
+        {
+            if ( versioning.getLatest() == null )
+            {
+                versioning.setLatest( recessive.getVersioning().getLatest() );
+            }
+            if ( versioning.getRelease() == null )
+            {
+                versioning.setRelease( recessive.getVersioning().getRelease() );
+            }
+
+            Collection<String> versions = new LinkedHashSet<String>( recessive.getVersioning().getVersions()
);
+            versions.addAll( versioning.getVersions() );
+            versioning.setVersions( new ArrayList<String>( versions ) );
+        }
+    }
+
     public Object getKey()
     {
         return getGroupId() + ':' + getArtifactId();



Mime
View raw message