PR: MNG-613

fix the location of the metadata update check

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@280191 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-09-11 22:37:26 +00:00
parent 27ad44e116
commit 02cc158420
3 changed files with 17 additions and 31 deletions

View File

@ -134,12 +134,15 @@ public class DefaultRepositoryMetadataManager
ArtifactRepository deploymentRepository )
throws ArtifactMetadataRetrievalException
{
getLogger().info( "Retrieving previous metadata from " + deploymentRepository.getId() );
resolveAlways( metadata, localRepository, deploymentRepository );
metadata.storeInLocalRepository( localRepository, deploymentRepository );
// TODO: shouldn't need to calculate this
File f = new File( localRepository.getBasedir(),
localRepository.pathOfLocalRepositoryMetadata( metadata, deploymentRepository ) );
try
{
File f = new File( localRepository.getBasedir(),
localRepository.pathOfLocalRepositoryMetadata( metadata, deploymentRepository ) );
wagonManager.putArtifactMetadata( f, metadata, deploymentRepository );
}
catch ( TransferFailedException e )

View File

@ -17,7 +17,6 @@ package org.apache.maven.artifact.transform;
*/
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
import org.apache.maven.artifact.metadata.LatestArtifactMetadata;
import org.apache.maven.artifact.metadata.LegacyArtifactMetadata;
@ -46,14 +45,14 @@ public class LatestArtifactTransformation
public void transformForInstall( Artifact artifact, ArtifactRepository localRepository )
throws ArtifactMetadataRetrievalException
{
// metadata is added at install time
// metadata is added via addPluginArtifactMetadata
}
public void transformForDeployment( Artifact artifact, ArtifactRepository remoteRepository,
ArtifactRepository localRepository )
throws ArtifactMetadataRetrievalException
{
// metadata is added at deploy time
// metadata is added via addPluginArtifactMetadata
}
protected LegacyArtifactMetadata createLegacyMetadata( Artifact artifact )
@ -61,13 +60,6 @@ public class LatestArtifactTransformation
return new LatestArtifactMetadata( artifact );
}
protected ArtifactMetadata createMetadata( Artifact artifact, Versioning versioning )
{
LatestArtifactMetadata metadata = new LatestArtifactMetadata( artifact );
metadata.setVersion( versioning.getLatest() );
return metadata;
}
protected String constructVersion( Versioning versioning, String baseVersion )
{
return versioning.getLatest();

View File

@ -56,16 +56,7 @@ public class ReleaseArtifactTransformation
public void transformForInstall( Artifact artifact, ArtifactRepository localRepository )
throws ArtifactMetadataRetrievalException
{
Versioning versioning = new Versioning();
versioning.addVersion( artifact.getVersion() );
if ( artifact.isRelease() )
{
versioning.setRelease( artifact.getVersion() );
}
// TODO: need to create?
ArtifactMetadata metadata = new ArtifactRepositoryMetadata( artifact, versioning );
ArtifactMetadata metadata = createMetadata( artifact );
artifact.addMetadata( metadata );
}
@ -73,6 +64,13 @@ public class ReleaseArtifactTransformation
public void transformForDeployment( Artifact artifact, ArtifactRepository remoteRepository,
ArtifactRepository localRepository )
throws ArtifactMetadataRetrievalException
{
ArtifactMetadata metadata = createMetadata( artifact );
artifact.addMetadata( metadata );
}
private ArtifactMetadata createMetadata( Artifact artifact )
{
Versioning versioning = new Versioning();
versioning.addVersion( artifact.getVersion() );
@ -82,14 +80,7 @@ public class ReleaseArtifactTransformation
versioning.setRelease( artifact.getVersion() );
}
// TODO: need to create?
ArtifactMetadata metadata = new ArtifactRepositoryMetadata( artifact, versioning );
artifact.addMetadata( metadata );
// TODO: this should be in the part that actually merges instead
getLogger().info( "Retrieving previous metadata from " + remoteRepository.getId() );
repositoryMetadataManager.resolveAlways( metadata, localRepository, remoteRepository );
return new ArtifactRepositoryMetadata( artifact, versioning );
}
protected LegacyArtifactMetadata createLegacyMetadata( Artifact artifact )