o remove more methods from the repository interface

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@750686 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2009-03-05 23:35:02 +00:00
parent 74384e7c63
commit 5a35fc9aee
3 changed files with 1 additions and 62 deletions

View File

@ -26,7 +26,6 @@ import java.util.Set;
import org.apache.maven.Maven;
import org.apache.maven.artifact.InvalidRepositoryException;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
import org.apache.maven.embedder.Configuration;
import org.apache.maven.embedder.MavenEmbedder;
import org.apache.maven.embedder.MavenEmbedderException;
@ -98,10 +97,6 @@ public class DefaultMavenExecutionRequestPopulator
localRepository( request, configuration );
snapshotPolicy( request, configuration );
checksumPolicy( request, configuration );
artifactTransferMechanism( request, configuration );
realmManager( request, configuration );
@ -407,48 +402,6 @@ public class DefaultMavenExecutionRequestPopulator
}
}
// ------------------------------------------------------------------------
// Snapshot Policy
// ------------------------------------------------------------------------
private void snapshotPolicy( MavenExecutionRequest request, Configuration configuration )
{
// ------------------------------------------------------------------------
// Snapshot Repository Update Policies
//
// Set the global policies for snapshot updates.
// ------------------------------------------------------------------------
boolean snapshotPolicySet = false;
if ( request.isOffline() )
{
snapshotPolicySet = true;
}
if ( !snapshotPolicySet )
{
if ( request.isUpdateSnapshots() )
{
repositorySystem.setGlobalUpdatePolicy( ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS );
}
else if ( request.isNoSnapshotUpdates() )
{
getLogger().info( "+ Supressing SNAPSHOT updates." );
repositorySystem.setGlobalUpdatePolicy( ArtifactRepositoryPolicy.UPDATE_POLICY_NEVER );
}
}
}
// ------------------------------------------------------------------------
// Checksum Policy
// ------------------------------------------------------------------------
private void checksumPolicy( MavenExecutionRequest request, Configuration configuration )
{
repositorySystem.setGlobalChecksumPolicy( request.getGlobalChecksumPolicy() );
}
// ------------------------------------------------------------------------
// Artifact Transfer Mechanism
// ------------------------------------------------------------------------

View File

@ -404,16 +404,6 @@ public class LegacyMavenRepositorySystem
return artifactRepositoryFactory.createArtifactRepository( repositoryId, url, defaultArtifactRepositoryLayout, snapshotsPolicy, releasesPolicy );
}
public void setGlobalUpdatePolicy( String policy )
{
artifactRepositoryFactory.setGlobalUpdatePolicy( policy );
}
public void setGlobalChecksumPolicy( String policy )
{
artifactRepositoryFactory.setGlobalChecksumPolicy( policy );
}
public ArtifactResolutionResult resolve( ArtifactResolutionRequest request )
{
return artifactResolver.resolve( request );

View File

@ -39,7 +39,7 @@ import org.apache.maven.wagon.events.TransferListener;
* @author Jason van Zyl
*/
public interface MavenRepositorySystem
extends ArtifactMetadataSource // This needs to be removed
extends ArtifactMetadataSource // This needs to be removed and it's here because it's passed into the resolver. not sure why we didn't just inject the metadata source.
{
// Artifact creation: This needs to be reduced to fewer, if not one, method.
@ -75,10 +75,6 @@ public interface MavenRepositorySystem
ArtifactRepository createRepository( String url, String repositoryId );
void setGlobalUpdatePolicy( String policy );
void setGlobalChecksumPolicy( String policy );
// Artifact resolution
//MetadataResolutionResult resolveMetadata( MetadataResolutionRequest request );