mirror of https://github.com/apache/maven.git
[MNG-4952] [regression] RELEASE field of repository metadata is not updated upon repeated deployments
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1054683 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
12649ae4a7
commit
acd646e4a4
|
@ -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
|
||||
|
|
|
@ -20,6 +20,9 @@ package org.apache.maven.repository.internal;
|
|||
*/
|
||||
|
||||
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();
|
||||
|
|
Loading…
Reference in New Issue