[MNG-4191] separate plugin and artifact repositories

o Updated test setup

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@786791 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-06-20 10:32:11 +00:00
parent 34580df645
commit 93f90df0de
2 changed files with 13 additions and 5 deletions

View File

@ -89,6 +89,7 @@ public abstract class AbstractCoreMavenComponentTestCase
.setPluginGroups( Arrays.asList( new String[] { "org.apache.maven.plugins" } ) )
.setLocalRepository( getLocalRepository() )
.setRemoteRepositories( getRemoteRepositories() )
.setPluginArtifactRepositories( getPluginArtifactRepositories() )
.setGoals( Arrays.asList( new String[] { "package" } ) )
.setProperties( new Properties() );
@ -112,6 +113,7 @@ public abstract class AbstractCoreMavenComponentTestCase
ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest()
.setLocalRepository( request.getLocalRepository() )
.setRemoteRepositories( request.getRemoteRepositories() )
.setPluginArtifactRepositories( request.getPluginArtifactRepositories() )
.setExecutionProperties( executionProperties );
MavenProject project = null;
@ -139,7 +141,13 @@ public abstract class AbstractCoreMavenComponentTestCase
return new MavenProject( model );
}
protected List<ArtifactRepository> getRemoteRepositories()
protected List<ArtifactRepository> getRemoteRepositories()
throws InvalidRepositoryException
{
return Arrays.asList( repositorySystem.createDefaultRemoteRepository() );
}
protected List<ArtifactRepository> getPluginArtifactRepositories()
throws InvalidRepositoryException
{
Repository itRepo = new Repository();

View File

@ -127,7 +127,7 @@ public class PluginManagerTest
plugin.setVersion( "2.4.2" );
// The project has already been fully interpolated so getting the raw mojoDescriptor is not going to have the processes configuration.
MojoDescriptor mojoDescriptor = pluginManager.getMojoDescriptor( plugin, goal, session.getLocalRepository(), session.getCurrentProject().getRemoteArtifactRepositories() );
MojoDescriptor mojoDescriptor = pluginManager.getMojoDescriptor( plugin, goal, session.getLocalRepository(), session.getCurrentProject().getPluginArtifactRepositories() );
assertPluginDescriptor( mojoDescriptor, "org.apache.maven.plugins", "maven-surefire-plugin", "2.4.2" );
System.out.println( session.getCurrentProject().getBuild().getPluginsAsMap() );
@ -207,7 +207,7 @@ public class PluginManagerTest
// we need to pass this through as is so it doesn't get parsed again.
Artifact pluginArtifact = new ProjectArtifact( pluginProject );
Set<Artifact> artifacts = pluginManager.getPluginArtifacts( pluginArtifact, plugin, getLocalRepository(), getRemoteRepositories() );
Set<Artifact> artifacts = pluginManager.getPluginArtifacts( pluginArtifact, plugin, getLocalRepository(), getPluginArtifactRepositories() );
System.out.println( artifacts );
*/
@ -220,12 +220,12 @@ public class PluginManagerTest
ArtifactResolutionRequest request = new ArtifactResolutionRequest()
.setArtifact( pluginArtifact )
.setLocalRepository( getLocalRepository() )
.setRemoteRepostories( getRemoteRepositories() );
.setRemoteRepostories( getPluginArtifactRepositories() );
ArtifactResolutionResult result = repositorySystem.resolve( request );
*/
List<Artifact> artifacts = pluginManager.getPluginArtifacts( pluginArtifact, plugin, getLocalRepository(), getRemoteRepositories() );
List<Artifact> artifacts = pluginManager.getPluginArtifacts( pluginArtifact, plugin, getLocalRepository(), getPluginArtifactRepositories() );
assertEquals( 4, artifacts.size() );
for ( Artifact a : artifacts )