mirror of https://github.com/apache/maven.git
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:
parent
27ad44e116
commit
02cc158420
|
@ -134,12 +134,15 @@ public class DefaultRepositoryMetadataManager
|
||||||
ArtifactRepository deploymentRepository )
|
ArtifactRepository deploymentRepository )
|
||||||
throws ArtifactMetadataRetrievalException
|
throws ArtifactMetadataRetrievalException
|
||||||
{
|
{
|
||||||
|
getLogger().info( "Retrieving previous metadata from " + deploymentRepository.getId() );
|
||||||
|
resolveAlways( metadata, localRepository, deploymentRepository );
|
||||||
|
|
||||||
metadata.storeInLocalRepository( localRepository, deploymentRepository );
|
metadata.storeInLocalRepository( localRepository, deploymentRepository );
|
||||||
// TODO: shouldn't need to calculate this
|
|
||||||
File f = new File( localRepository.getBasedir(),
|
|
||||||
localRepository.pathOfLocalRepositoryMetadata( metadata, deploymentRepository ) );
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
File f = new File( localRepository.getBasedir(),
|
||||||
|
localRepository.pathOfLocalRepositoryMetadata( metadata, deploymentRepository ) );
|
||||||
wagonManager.putArtifactMetadata( f, metadata, deploymentRepository );
|
wagonManager.putArtifactMetadata( f, metadata, deploymentRepository );
|
||||||
}
|
}
|
||||||
catch ( TransferFailedException e )
|
catch ( TransferFailedException e )
|
||||||
|
|
|
@ -17,7 +17,6 @@ package org.apache.maven.artifact.transform;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.apache.maven.artifact.Artifact;
|
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.ArtifactMetadataRetrievalException;
|
||||||
import org.apache.maven.artifact.metadata.LatestArtifactMetadata;
|
import org.apache.maven.artifact.metadata.LatestArtifactMetadata;
|
||||||
import org.apache.maven.artifact.metadata.LegacyArtifactMetadata;
|
import org.apache.maven.artifact.metadata.LegacyArtifactMetadata;
|
||||||
|
@ -46,14 +45,14 @@ public class LatestArtifactTransformation
|
||||||
public void transformForInstall( Artifact artifact, ArtifactRepository localRepository )
|
public void transformForInstall( Artifact artifact, ArtifactRepository localRepository )
|
||||||
throws ArtifactMetadataRetrievalException
|
throws ArtifactMetadataRetrievalException
|
||||||
{
|
{
|
||||||
// metadata is added at install time
|
// metadata is added via addPluginArtifactMetadata
|
||||||
}
|
}
|
||||||
|
|
||||||
public void transformForDeployment( Artifact artifact, ArtifactRepository remoteRepository,
|
public void transformForDeployment( Artifact artifact, ArtifactRepository remoteRepository,
|
||||||
ArtifactRepository localRepository )
|
ArtifactRepository localRepository )
|
||||||
throws ArtifactMetadataRetrievalException
|
throws ArtifactMetadataRetrievalException
|
||||||
{
|
{
|
||||||
// metadata is added at deploy time
|
// metadata is added via addPluginArtifactMetadata
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LegacyArtifactMetadata createLegacyMetadata( Artifact artifact )
|
protected LegacyArtifactMetadata createLegacyMetadata( Artifact artifact )
|
||||||
|
@ -61,13 +60,6 @@ public class LatestArtifactTransformation
|
||||||
return new LatestArtifactMetadata( artifact );
|
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 )
|
protected String constructVersion( Versioning versioning, String baseVersion )
|
||||||
{
|
{
|
||||||
return versioning.getLatest();
|
return versioning.getLatest();
|
||||||
|
|
|
@ -56,16 +56,7 @@ public class ReleaseArtifactTransformation
|
||||||
public void transformForInstall( Artifact artifact, ArtifactRepository localRepository )
|
public void transformForInstall( Artifact artifact, ArtifactRepository localRepository )
|
||||||
throws ArtifactMetadataRetrievalException
|
throws ArtifactMetadataRetrievalException
|
||||||
{
|
{
|
||||||
Versioning versioning = new Versioning();
|
ArtifactMetadata metadata = createMetadata( artifact );
|
||||||
versioning.addVersion( artifact.getVersion() );
|
|
||||||
|
|
||||||
if ( artifact.isRelease() )
|
|
||||||
{
|
|
||||||
versioning.setRelease( artifact.getVersion() );
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: need to create?
|
|
||||||
ArtifactMetadata metadata = new ArtifactRepositoryMetadata( artifact, versioning );
|
|
||||||
|
|
||||||
artifact.addMetadata( metadata );
|
artifact.addMetadata( metadata );
|
||||||
}
|
}
|
||||||
|
@ -73,6 +64,13 @@ public class ReleaseArtifactTransformation
|
||||||
public void transformForDeployment( Artifact artifact, ArtifactRepository remoteRepository,
|
public void transformForDeployment( Artifact artifact, ArtifactRepository remoteRepository,
|
||||||
ArtifactRepository localRepository )
|
ArtifactRepository localRepository )
|
||||||
throws ArtifactMetadataRetrievalException
|
throws ArtifactMetadataRetrievalException
|
||||||
|
{
|
||||||
|
ArtifactMetadata metadata = createMetadata( artifact );
|
||||||
|
|
||||||
|
artifact.addMetadata( metadata );
|
||||||
|
}
|
||||||
|
|
||||||
|
private ArtifactMetadata createMetadata( Artifact artifact )
|
||||||
{
|
{
|
||||||
Versioning versioning = new Versioning();
|
Versioning versioning = new Versioning();
|
||||||
versioning.addVersion( artifact.getVersion() );
|
versioning.addVersion( artifact.getVersion() );
|
||||||
|
@ -82,14 +80,7 @@ public class ReleaseArtifactTransformation
|
||||||
versioning.setRelease( artifact.getVersion() );
|
versioning.setRelease( artifact.getVersion() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: need to create?
|
return new ArtifactRepositoryMetadata( artifact, versioning );
|
||||||
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 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LegacyArtifactMetadata createLegacyMetadata( Artifact artifact )
|
protected LegacyArtifactMetadata createLegacyMetadata( Artifact artifact )
|
||||||
|
|
Loading…
Reference in New Issue