mirror of https://github.com/apache/maven.git
o use RepositorySystem and LegacyRepositorySystem
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@746432 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a85440fe92
commit
b4257bad3b
|
@ -34,7 +34,7 @@ import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.maven.ArtifactFilterManager;
|
import org.apache.maven.ArtifactFilterManager;
|
||||||
import org.apache.maven.MavenTools;
|
import org.apache.maven.RepositorySystem;
|
||||||
import org.apache.maven.artifact.Artifact;
|
import org.apache.maven.artifact.Artifact;
|
||||||
import org.apache.maven.artifact.factory.ArtifactFactory;
|
import org.apache.maven.artifact.factory.ArtifactFactory;
|
||||||
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
|
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
|
||||||
|
@ -137,7 +137,7 @@ public class DefaultPluginManager
|
||||||
protected PluginVersionManager pluginVersionManager;
|
protected PluginVersionManager pluginVersionManager;
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
protected MavenTools repositoryTools;
|
protected RepositorySystem repositoryTools;
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
protected RuntimeInformation runtimeInformation;
|
protected RuntimeInformation runtimeInformation;
|
||||||
|
@ -1471,7 +1471,7 @@ public class DefaultPluginManager
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
protected void resolveTransitiveDependencies( MavenSession context,
|
protected void resolveTransitiveDependencies( MavenSession context,
|
||||||
MavenTools repositoryTools,
|
RepositorySystem repositoryTools,
|
||||||
String scope,
|
String scope,
|
||||||
MavenProject project,
|
MavenProject project,
|
||||||
boolean isAggregator )
|
boolean isAggregator )
|
||||||
|
@ -1582,7 +1582,7 @@ public class DefaultPluginManager
|
||||||
|
|
||||||
private void downloadDependencies( MavenProject project,
|
private void downloadDependencies( MavenProject project,
|
||||||
MavenSession context,
|
MavenSession context,
|
||||||
MavenTools repositoryTools )
|
RepositorySystem repositoryTools )
|
||||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||||
{
|
{
|
||||||
ArtifactRepository localRepository = context.getLocalRepository();
|
ArtifactRepository localRepository = context.getLocalRepository();
|
||||||
|
|
|
@ -22,7 +22,7 @@ package org.apache.maven.plugin.version;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.maven.MavenTools;
|
import org.apache.maven.RepositorySystem;
|
||||||
import org.apache.maven.artifact.Artifact;
|
import org.apache.maven.artifact.Artifact;
|
||||||
import org.apache.maven.artifact.ArtifactUtils;
|
import org.apache.maven.artifact.ArtifactUtils;
|
||||||
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
|
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
|
||||||
|
@ -51,7 +51,7 @@ public class DefaultPluginVersionManager
|
||||||
implements PluginVersionManager
|
implements PluginVersionManager
|
||||||
{
|
{
|
||||||
@Requirement
|
@Requirement
|
||||||
private MavenTools repositoryTools;
|
private RepositorySystem repositoryTools;
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
private MavenProjectBuilder mavenProjectBuilder;
|
private MavenProjectBuilder mavenProjectBuilder;
|
||||||
|
|
|
@ -31,7 +31,7 @@ import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.maven.Maven;
|
import org.apache.maven.Maven;
|
||||||
import org.apache.maven.MavenTools;
|
import org.apache.maven.RepositorySystem;
|
||||||
import org.apache.maven.artifact.Artifact;
|
import org.apache.maven.artifact.Artifact;
|
||||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||||
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
|
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
|
||||||
|
@ -137,7 +137,7 @@ public class MavenEmbedder
|
||||||
|
|
||||||
private MavenXpp3Writer modelWriter;
|
private MavenXpp3Writer modelWriter;
|
||||||
|
|
||||||
private MavenTools repositoryTools;
|
private RepositorySystem repositoryTools;
|
||||||
|
|
||||||
private Maven maven;
|
private Maven maven;
|
||||||
|
|
||||||
|
@ -659,7 +659,7 @@ public class MavenEmbedder
|
||||||
|
|
||||||
pluginRepository = container.lookup( PluginRepository.class );
|
pluginRepository = container.lookup( PluginRepository.class );
|
||||||
|
|
||||||
repositoryTools = container.lookup( MavenTools.class );
|
repositoryTools = 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.
|
||||||
|
|
|
@ -26,7 +26,7 @@ import java.util.List;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import org.apache.maven.Maven;
|
import org.apache.maven.Maven;
|
||||||
import org.apache.maven.MavenTools;
|
import org.apache.maven.RepositorySystem;
|
||||||
import org.apache.maven.artifact.InvalidRepositoryException;
|
import org.apache.maven.artifact.InvalidRepositoryException;
|
||||||
import org.apache.maven.artifact.manager.WagonManager;
|
import org.apache.maven.artifact.manager.WagonManager;
|
||||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||||
|
@ -87,7 +87,7 @@ public class DefaultMavenExecutionRequestPopulator
|
||||||
private MavenSettingsBuilder settingsBuilder;
|
private MavenSettingsBuilder settingsBuilder;
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
private MavenTools mavenTools;
|
private RepositorySystem mavenTools;
|
||||||
|
|
||||||
// 2009-02-12 Oleg: this component is defined in maven-core components.xml
|
// 2009-02-12 Oleg: this component is defined in maven-core components.xml
|
||||||
// because it already has another declared (not generated) component
|
// because it already has another declared (not generated) component
|
||||||
|
|
|
@ -72,9 +72,9 @@ import org.codehaus.plexus.util.StringUtils;
|
||||||
/**
|
/**
|
||||||
* @author Jason van Zyl
|
* @author Jason van Zyl
|
||||||
*/
|
*/
|
||||||
@Component(role = MavenTools.class)
|
@Component(role = RepositorySystem.class)
|
||||||
public class DefaultMavenTools
|
public class LegacyRepositorySystem
|
||||||
implements MavenTools, LogEnabled
|
implements RepositorySystem, LogEnabled
|
||||||
{
|
{
|
||||||
@Requirement
|
@Requirement
|
||||||
private ArtifactFactory artifactFactory;
|
private ArtifactFactory artifactFactory;
|
|
@ -51,7 +51,7 @@ import org.codehaus.plexus.component.annotations.Requirement;
|
||||||
/**
|
/**
|
||||||
* @author Jason van Zyl
|
* @author Jason van Zyl
|
||||||
*/
|
*/
|
||||||
public interface MavenTools
|
public interface RepositorySystem
|
||||||
{
|
{
|
||||||
List<ArtifactRepository> buildArtifactRepositories( List<Repository> repositories )
|
List<ArtifactRepository> buildArtifactRepositories( List<Repository> repositories )
|
||||||
throws InvalidRepositoryException;
|
throws InvalidRepositoryException;
|
|
@ -19,7 +19,7 @@ package org.apache.maven.profiles.build;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.apache.maven.MavenTools;
|
import org.apache.maven.RepositorySystem;
|
||||||
import org.apache.maven.artifact.ArtifactUtils;
|
import org.apache.maven.artifact.ArtifactUtils;
|
||||||
import org.apache.maven.artifact.InvalidRepositoryException;
|
import org.apache.maven.artifact.InvalidRepositoryException;
|
||||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||||
|
@ -60,7 +60,7 @@ public class DefaultProfileAdvisor
|
||||||
public static final String ROLE_HINT = "default";
|
public static final String ROLE_HINT = "default";
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
private MavenTools mavenTools;
|
private RepositorySystem mavenTools;
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
private MavenProfilesBuilder profilesBuilder;
|
private MavenProfilesBuilder profilesBuilder;
|
||||||
|
|
|
@ -26,7 +26,7 @@ import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.maven.MavenTools;
|
import org.apache.maven.RepositorySystem;
|
||||||
import org.apache.maven.artifact.Artifact;
|
import org.apache.maven.artifact.Artifact;
|
||||||
import org.apache.maven.artifact.ArtifactUtils;
|
import org.apache.maven.artifact.ArtifactUtils;
|
||||||
import org.apache.maven.artifact.InvalidRepositoryException;
|
import org.apache.maven.artifact.InvalidRepositoryException;
|
||||||
|
@ -74,7 +74,7 @@ public class DefaultMavenProjectBuilder
|
||||||
private ProfileAdvisor profileAdvisor;
|
private ProfileAdvisor profileAdvisor;
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
private MavenTools mavenTools;
|
private RepositorySystem mavenTools;
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
private ProjectBuilder projectBuilder;
|
private ProjectBuilder projectBuilder;
|
||||||
|
|
|
@ -22,7 +22,7 @@ package org.apache.maven.project;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import org.apache.maven.MavenTools;
|
import org.apache.maven.RepositorySystem;
|
||||||
import org.apache.maven.mercury.PomProcessor;
|
import org.apache.maven.mercury.PomProcessor;
|
||||||
import org.apache.maven.mercury.PomProcessorException;
|
import org.apache.maven.mercury.PomProcessorException;
|
||||||
import org.apache.maven.mercury.MavenDomainModel;
|
import org.apache.maven.mercury.MavenDomainModel;
|
||||||
|
@ -61,7 +61,7 @@ public class DefaultProjectBuilder
|
||||||
private ArtifactFactory artifactFactory;
|
private ArtifactFactory artifactFactory;
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
private MavenTools mavenTools;
|
private RepositorySystem mavenTools;
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
List<ModelEventListener> listeners;
|
List<ModelEventListener> listeners;
|
||||||
|
|
|
@ -34,7 +34,7 @@ import java.util.Properties;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
|
|
||||||
import org.apache.maven.MavenTools;
|
import org.apache.maven.RepositorySystem;
|
||||||
import org.apache.maven.artifact.Artifact;
|
import org.apache.maven.artifact.Artifact;
|
||||||
import org.apache.maven.artifact.ArtifactUtils;
|
import org.apache.maven.artifact.ArtifactUtils;
|
||||||
import org.apache.maven.artifact.DependencyResolutionRequiredException;
|
import org.apache.maven.artifact.DependencyResolutionRequiredException;
|
||||||
|
@ -213,7 +213,7 @@ public class MavenProject
|
||||||
* @param projectBuilderConfiguration
|
* @param projectBuilderConfiguration
|
||||||
* @throws InvalidRepositoryException
|
* @throws InvalidRepositoryException
|
||||||
*/
|
*/
|
||||||
public MavenProject( Model model, ArtifactFactory artifactFactory, MavenTools mavenTools, MavenProjectBuilder mavenProjectBuilder, ProjectBuilderConfiguration projectBuilderConfiguration )
|
public MavenProject( Model model, ArtifactFactory artifactFactory, RepositorySystem mavenTools, MavenProjectBuilder mavenProjectBuilder, ProjectBuilderConfiguration projectBuilderConfiguration )
|
||||||
throws InvalidRepositoryException
|
throws InvalidRepositoryException
|
||||||
{
|
{
|
||||||
if(model == null)
|
if(model == null)
|
||||||
|
|
|
@ -24,7 +24,7 @@ import java.io.IOException;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import org.apache.maven.MavenTools;
|
import org.apache.maven.RepositorySystem;
|
||||||
import org.apache.maven.profiles.DefaultProfileManager;
|
import org.apache.maven.profiles.DefaultProfileManager;
|
||||||
import org.apache.maven.profiles.activation.DefaultProfileActivationContext;
|
import org.apache.maven.profiles.activation.DefaultProfileActivationContext;
|
||||||
import org.apache.maven.profiles.activation.ProfileActivationContext;
|
import org.apache.maven.profiles.activation.ProfileActivationContext;
|
||||||
|
@ -52,7 +52,7 @@ public class PomConstructionTest
|
||||||
|
|
||||||
private MavenProjectBuilder mavenProjectBuilder;
|
private MavenProjectBuilder mavenProjectBuilder;
|
||||||
|
|
||||||
private MavenTools mavenTools;
|
private RepositorySystem mavenTools;
|
||||||
|
|
||||||
private PomArtifactResolver pomArtifactResolver;
|
private PomArtifactResolver pomArtifactResolver;
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ public class PomConstructionTest
|
||||||
testMixinDirectory = new File( getBasedir(), BASE_MIXIN_DIR );
|
testMixinDirectory = new File( getBasedir(), BASE_MIXIN_DIR );
|
||||||
mavenProjectBuilder = lookup( MavenProjectBuilder.class );
|
mavenProjectBuilder = lookup( MavenProjectBuilder.class );
|
||||||
projectBuilder = lookup( ProjectBuilder.class );
|
projectBuilder = lookup( ProjectBuilder.class );
|
||||||
mavenTools = lookup( MavenTools.class );
|
mavenTools = lookup( RepositorySystem.class );
|
||||||
pomArtifactResolver = new PomArtifactResolver()
|
pomArtifactResolver = new PomArtifactResolver()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue