o shortening the interface name for the repository system

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@751196 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2009-03-07 05:08:43 +00:00
parent fd7c521580
commit b68c9f9231
15 changed files with 50 additions and 47 deletions

View File

@ -79,7 +79,7 @@ import org.apache.maven.realm.MavenRealmManager;
import org.apache.maven.realm.RealmManagementException; import org.apache.maven.realm.RealmManagementException;
import org.apache.maven.realm.RealmScanningUtils; import org.apache.maven.realm.RealmScanningUtils;
import org.apache.maven.reporting.MavenReport; import org.apache.maven.reporting.MavenReport;
import org.apache.maven.repository.MavenRepositorySystem; import org.apache.maven.repository.RepositorySystem;
import org.apache.maven.repository.VersionNotFoundException; import org.apache.maven.repository.VersionNotFoundException;
import org.apache.maven.shared.model.InterpolatorProperty; import org.apache.maven.shared.model.InterpolatorProperty;
import org.apache.maven.shared.model.ModelMarshaller; import org.apache.maven.shared.model.ModelMarshaller;
@ -139,7 +139,7 @@ public class DefaultPluginManager
protected MavenPluginCollector pluginCollector; protected MavenPluginCollector pluginCollector;
@Requirement @Requirement
protected MavenRepositorySystem repositorySystem; protected RepositorySystem repositorySystem;
@Requirement @Requirement
private ResolutionErrorHandler resolutionErrorHandler; private ResolutionErrorHandler resolutionErrorHandler;
@ -1327,7 +1327,7 @@ public class DefaultPluginManager
// Artifact resolution // Artifact resolution
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
protected void resolveTransitiveDependencies( MavenSession context, MavenRepositorySystem repositorySystem, String scope, MavenProject project, boolean isAggregator ) protected void resolveTransitiveDependencies( MavenSession context, RepositorySystem repositorySystem, String scope, MavenProject project, boolean isAggregator )
throws ArtifactResolutionException, ArtifactNotFoundException, InvalidDependencyVersionException throws ArtifactResolutionException, ArtifactNotFoundException, InvalidDependencyVersionException
{ {
// TODO: such a call in MavenMetadataSource too - packaging not really the intention of type // TODO: such a call in MavenMetadataSource too - packaging not really the intention of type
@ -1430,7 +1430,7 @@ public class DefaultPluginManager
// Artifact downloading // Artifact downloading
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
private void downloadDependencies( MavenProject project, MavenSession context, MavenRepositorySystem repositorySystem ) private void downloadDependencies( MavenProject project, MavenSession context, RepositorySystem repositorySystem )
throws ArtifactResolutionException, ArtifactNotFoundException throws ArtifactResolutionException, ArtifactNotFoundException
{ {
ArtifactRepository localRepository = context.getLocalRepository(); ArtifactRepository localRepository = context.getLocalRepository();

View File

@ -64,7 +64,7 @@ import org.apache.maven.project.MavenProjectBuildingResult;
import org.apache.maven.project.ProjectBuildingException; import org.apache.maven.project.ProjectBuildingException;
import org.apache.maven.reactor.MavenExecutionException; import org.apache.maven.reactor.MavenExecutionException;
import org.apache.maven.reactor.MissingModuleException; import org.apache.maven.reactor.MissingModuleException;
import org.apache.maven.repository.MavenRepositorySystem; import org.apache.maven.repository.RepositorySystem;
import org.apache.maven.settings.Settings; import org.apache.maven.settings.Settings;
import org.apache.maven.settings.SettingsConfigurationException; import org.apache.maven.settings.SettingsConfigurationException;
import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader; import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader;
@ -127,7 +127,7 @@ public class MavenEmbedder
private MavenProjectBuilder mavenProjectBuilder; private MavenProjectBuilder mavenProjectBuilder;
private MavenRepositorySystem repositorySystem; private RepositorySystem repositorySystem;
private MavenXpp3Reader modelReader; private MavenXpp3Reader modelReader;
@ -540,7 +540,7 @@ public class MavenEmbedder
populator = container.lookup( MavenExecutionRequestPopulator.class ); populator = container.lookup( MavenExecutionRequestPopulator.class );
repositorySystem = container.lookup( MavenRepositorySystem.class ); repositorySystem = container.lookup( RepositorySystem.class );
// This is temporary as we can probably cache a single request and use it for default values and // This is temporary as we can probably cache a single request and use it for default values and
// simply cascade values in from requests used for individual executions. // simply cascade values in from requests used for individual executions.

View File

@ -40,7 +40,7 @@ import org.apache.maven.profiles.DefaultProfileManager;
import org.apache.maven.profiles.ProfileActivationContext; import org.apache.maven.profiles.ProfileActivationContext;
import org.apache.maven.profiles.ProfileManager; import org.apache.maven.profiles.ProfileManager;
import org.apache.maven.realm.DefaultMavenRealmManager; import org.apache.maven.realm.DefaultMavenRealmManager;
import org.apache.maven.repository.MavenRepositorySystem; import org.apache.maven.repository.RepositorySystem;
import org.apache.maven.settings.MavenSettingsBuilder; import org.apache.maven.settings.MavenSettingsBuilder;
import org.apache.maven.settings.Mirror; import org.apache.maven.settings.Mirror;
import org.apache.maven.settings.Proxy; import org.apache.maven.settings.Proxy;
@ -75,7 +75,7 @@ public class DefaultMavenExecutionRequestPopulator
private MavenSettingsBuilder settingsBuilder; private MavenSettingsBuilder settingsBuilder;
@Requirement @Requirement
private MavenRepositorySystem repositorySystem; private RepositorySystem repositorySystem;
// 2009-03-05 Oleg: this component is defined sub-classed in this package // 2009-03-05 Oleg: this component is defined sub-classed in this package
@Requirement(hint = "maven") @Requirement(hint = "maven")

View File

@ -61,7 +61,7 @@ import org.apache.maven.project.builder.ProjectUri;
import org.apache.maven.project.builder.profile.ProfileContext; import org.apache.maven.project.builder.profile.ProfileContext;
import org.apache.maven.project.validation.ModelValidationResult; import org.apache.maven.project.validation.ModelValidationResult;
import org.apache.maven.project.validation.ModelValidator; import org.apache.maven.project.validation.ModelValidator;
import org.apache.maven.repository.MavenRepositorySystem; import org.apache.maven.repository.RepositorySystem;
import org.apache.maven.repository.VersionNotFoundException; import org.apache.maven.repository.VersionNotFoundException;
import org.apache.maven.shared.model.DomainModel; import org.apache.maven.shared.model.DomainModel;
import org.apache.maven.shared.model.InterpolatorProperty; import org.apache.maven.shared.model.InterpolatorProperty;
@ -97,7 +97,7 @@ public class DefaultMavenProjectBuilder
private ModelValidator validator; private ModelValidator validator;
@Requirement @Requirement
private MavenRepositorySystem repositorySystem; private RepositorySystem repositorySystem;
@Requirement @Requirement
private PlexusContainer container; private PlexusContainer container;

View File

@ -69,7 +69,7 @@ import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.model.io.xpp3.MavenXpp3Writer; import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
import org.apache.maven.project.artifact.ActiveProjectArtifact; import org.apache.maven.project.artifact.ActiveProjectArtifact;
import org.apache.maven.project.artifact.InvalidDependencyVersionException; import org.apache.maven.project.artifact.InvalidDependencyVersionException;
import org.apache.maven.repository.MavenRepositorySystem; import org.apache.maven.repository.RepositorySystem;
import org.apache.maven.repository.MavenRepositoryWrapper; import org.apache.maven.repository.MavenRepositoryWrapper;
import org.apache.maven.repository.VersionNotFoundException; import org.apache.maven.repository.VersionNotFoundException;
import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.StringUtils;
@ -165,7 +165,7 @@ public class MavenProject
private ProjectBuilderConfiguration projectBuilderConfiguration; private ProjectBuilderConfiguration projectBuilderConfiguration;
private MavenRepositorySystem repositorySystem; private RepositorySystem repositorySystem;
// //
private File parentFile; private File parentFile;
@ -210,7 +210,7 @@ public class MavenProject
* @param projectBuilderConfiguration * @param projectBuilderConfiguration
* @throws InvalidRepositoryException * @throws InvalidRepositoryException
*/ */
public MavenProject( Model model, MavenRepositorySystem repositorySystem, MavenProjectBuilder mavenProjectBuilder, ProjectBuilderConfiguration projectBuilderConfiguration ) public MavenProject( Model model, RepositorySystem repositorySystem, MavenProjectBuilder mavenProjectBuilder, ProjectBuilderConfiguration projectBuilderConfiguration )
throws InvalidRepositoryException throws InvalidRepositoryException
{ {
if ( model == null ) if ( model == null )

View File

@ -48,7 +48,7 @@ import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectBuilder; import org.apache.maven.project.MavenProjectBuilder;
import org.apache.maven.project.ProjectBuildingException; import org.apache.maven.project.ProjectBuildingException;
import org.apache.maven.project.validation.ModelValidationResult; import org.apache.maven.project.validation.ModelValidationResult;
import org.apache.maven.repository.LegacyMavenRepositorySystem; import org.apache.maven.repository.LegacyRepositorySystem;
import org.apache.maven.repository.VersionNotFoundException; import org.apache.maven.repository.VersionNotFoundException;
import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Component;
@ -459,7 +459,7 @@ public class MavenMetadataSource
{ {
try try
{ {
return LegacyMavenRepositorySystem.createArtifacts( artifactFactory, dependencies, inheritedScope, return LegacyRepositorySystem.createArtifacts( artifactFactory, dependencies, inheritedScope,
dependencyFilter, project ); dependencyFilter, project );
} }
catch ( VersionNotFoundException e ) catch ( VersionNotFoundException e )

View File

@ -20,24 +20,25 @@ package org.apache.maven.project;
*/ */
import java.io.File; import java.io.File;
import java.io.IOException;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.util.*; import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import org.apache.maven.profiles.DefaultProfileManager;
import org.apache.maven.profiles.ProfileActivationContext;
import org.apache.maven.model.Model;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.artifact.repository.DefaultArtifactRepository; import org.apache.maven.artifact.repository.DefaultArtifactRepository;
import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
import org.apache.maven.model.Model;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.profiles.DefaultProfileManager;
import org.apache.maven.profiles.ProfileActivationContext;
import org.apache.maven.project.harness.PomTestWrapper; import org.apache.maven.project.harness.PomTestWrapper;
import org.apache.maven.repository.RepositorySystem;
import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
public class PomConstructionTest public class PomConstructionTest
extends PlexusTestCase extends PlexusTestCase
{ {
private static String BASE_DIR = "src/test"; private static String BASE_DIR = "src/test";
private static String BASE_POM_DIR = BASE_DIR + "/resources-project-builder"; private static String BASE_POM_DIR = BASE_DIR + "/resources-project-builder";
@ -46,6 +47,8 @@ public class PomConstructionTest
private DefaultMavenProjectBuilder mavenProjectBuilder; private DefaultMavenProjectBuilder mavenProjectBuilder;
private RepositorySystem mavenTools;
private File testDirectory; private File testDirectory;
private File testMixinDirectory; private File testMixinDirectory;
@ -56,6 +59,7 @@ public class PomConstructionTest
testDirectory = new File( getBasedir(), BASE_POM_DIR ); testDirectory = new File( getBasedir(), BASE_POM_DIR );
testMixinDirectory = new File( getBasedir(), BASE_MIXIN_DIR ); testMixinDirectory = new File( getBasedir(), BASE_MIXIN_DIR );
mavenProjectBuilder = (DefaultMavenProjectBuilder) lookup( MavenProjectBuilder.class ); mavenProjectBuilder = (DefaultMavenProjectBuilder) lookup( MavenProjectBuilder.class );
mavenTools = lookup( RepositorySystem.class );
} }
/** /**

View File

@ -13,16 +13,16 @@ import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.model.Model; import org.apache.maven.model.Model;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader; import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.project.artifact.InvalidDependencyVersionException; import org.apache.maven.project.artifact.InvalidDependencyVersionException;
import org.apache.maven.repository.LegacyMavenRepositorySystem; import org.apache.maven.repository.LegacyRepositorySystem;
import org.apache.maven.repository.MavenRepositorySystem; import org.apache.maven.repository.RepositorySystem;
import org.apache.maven.repository.VersionNotFoundException; import org.apache.maven.repository.VersionNotFoundException;
import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
@Component(role = MavenRepositorySystem.class, hint = "test") @Component(role = RepositorySystem.class, hint = "test")
public class TestMavenRepositorySystem public class TestMavenRepositorySystem
extends LegacyMavenRepositorySystem extends LegacyRepositorySystem
{ {
public ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories ) public ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories )
throws ArtifactMetadataRetrievalException throws ArtifactMetadataRetrievalException

View File

@ -29,7 +29,7 @@ import org.apache.maven.model.DependencyManagement;
import org.apache.maven.model.Exclusion; import org.apache.maven.model.Exclusion;
import org.apache.maven.model.Model; import org.apache.maven.model.Model;
import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProject;
import org.apache.maven.repository.MavenRepositorySystem; import org.apache.maven.repository.RepositorySystem;
import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.PlexusTestCase;
import java.util.ArrayList; import java.util.ArrayList;
@ -41,13 +41,13 @@ import java.util.Set;
public class MavenMetadataSourceTest public class MavenMetadataSourceTest
extends PlexusTestCase extends PlexusTestCase
{ {
private MavenRepositorySystem repositorySystem; private RepositorySystem repositorySystem;
protected void setUp() protected void setUp()
throws Exception throws Exception
{ {
super.setUp(); super.setUp();
repositorySystem = lookup( MavenRepositorySystem.class ); repositorySystem = lookup( RepositorySystem.class );
} }
public void testShouldNotCarryExclusionsOverFromDependencyToDependency() public void testShouldNotCarryExclusionsOverFromDependencyToDependency()

View File

@ -37,7 +37,7 @@ extends AbstractMavenRepositorySystemTest
{ {
super.setUp(); super.setUp();
_mrs = getContainer().lookup( MavenRepositorySystem.class, "default" ); _mrs = getContainer().lookup( RepositorySystem.class, "default" );
} }
// TODO: 2009-03-Oleg : turned it off till we figure out which methods work, which don't // TODO: 2009-03-Oleg : turned it off till we figure out which methods work, which don't

View File

@ -31,8 +31,8 @@ import org.apache.maven.mercury.plexus.PlexusMercury;
import org.apache.maven.mercury.repository.api.Repository; import org.apache.maven.mercury.repository.api.Repository;
import org.apache.maven.mercury.repository.api.RepositoryException; import org.apache.maven.mercury.repository.api.RepositoryException;
import org.apache.maven.mercury.util.Util; import org.apache.maven.mercury.util.Util;
import org.apache.maven.repository.LegacyMavenRepositorySystem; import org.apache.maven.repository.RepositorySystem;
import org.apache.maven.repository.MavenRepositorySystem; import org.apache.maven.repository.LegacyRepositorySystem;
import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.lang.DefaultLanguage; import org.codehaus.plexus.lang.DefaultLanguage;
@ -42,10 +42,10 @@ import org.codehaus.plexus.lang.Language;
* @author Oleg Gusakov * @author Oleg Gusakov
* @version $Id$ * @version $Id$
*/ */
@Component( role = MavenRepositorySystem.class, hint = "mercury" ) @Component( role = RepositorySystem.class, hint = "mercury" )
public class MercuryRepositorySystem public class MercuryRepositorySystem
extends LegacyMavenRepositorySystem extends LegacyRepositorySystem
implements MavenRepositorySystem implements RepositorySystem
{ {
private static final Language LANG = new DefaultLanguage( MercuryRepositorySystem.class ); private static final Language LANG = new DefaultLanguage( MercuryRepositorySystem.class );

View File

@ -26,7 +26,7 @@ import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
import org.apache.maven.model.DeploymentRepository; import org.apache.maven.model.DeploymentRepository;
import org.apache.maven.model.Repository; import org.apache.maven.model.Repository;
import org.apache.maven.model.RepositoryPolicy; import org.apache.maven.model.RepositoryPolicy;
import org.apache.maven.repository.MavenRepositorySystem; import org.apache.maven.repository.RepositorySystem;
import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
@ -38,7 +38,7 @@ import java.util.List;
public final class ProjectUtils public final class ProjectUtils
{ {
static MavenRepositorySystem rs; static RepositorySystem rs;
private ProjectUtils() private ProjectUtils()
{ {
@ -72,11 +72,11 @@ public final class ProjectUtils
return rs( c ).buildArtifactRepository( repo ); return rs( c ).buildArtifactRepository( repo );
} }
private static MavenRepositorySystem rs( PlexusContainer c ) private static RepositorySystem rs( PlexusContainer c )
{ {
try try
{ {
rs = c.lookup( MavenRepositorySystem.class ); rs = c.lookup( RepositorySystem.class );
} }
catch ( ComponentLookupException e ) catch ( ComponentLookupException e )
{ {

View File

@ -59,9 +59,9 @@ import org.codehaus.plexus.util.StringUtils;
/** /**
* @author Jason van Zyl * @author Jason van Zyl
*/ */
@Component(role = MavenRepositorySystem.class) @Component(role = RepositorySystem.class)
public class LegacyMavenRepositorySystem public class LegacyRepositorySystem
implements MavenRepositorySystem implements RepositorySystem
{ {
@Requirement @Requirement

View File

@ -39,7 +39,7 @@ import org.apache.maven.wagon.events.TransferListener;
/** /**
* @author Jason van Zyl * @author Jason van Zyl
*/ */
public interface MavenRepositorySystem public interface RepositorySystem
{ {
Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type ); Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type );
@ -83,7 +83,6 @@ public interface MavenRepositorySystem
// Mirrors // Mirrors
void addMirror( String id, String mirrorOf, String url ); void addMirror( String id, String mirrorOf, String url );
List<ArtifactRepository> getMirrors( List<ArtifactRepository> repositories ); List<ArtifactRepository> getMirrors( List<ArtifactRepository> repositories );
} }

View File

@ -64,7 +64,7 @@ public abstract class AbstractMavenRepositorySystemTest
ArtifactFactory _artifactFactory; ArtifactFactory _artifactFactory;
protected MavenRepositorySystem _mrs; protected RepositorySystem _mrs;
protected Startable _server; protected Startable _server;