mirror of https://github.com/apache/maven.git
o make sure that the plugin repositories are propagated from the builder request and not from the MavenProject
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@796420 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1267ef7633
commit
c5fb845b6b
|
@ -79,7 +79,7 @@ public class AbstractArtifactResolutionException
|
|||
Throwable t )
|
||||
{
|
||||
super( constructMessageBase( message, groupId, artifactId, version, type, remoteRepositories, path ), t );
|
||||
|
||||
|
||||
this.originalMessage = message;
|
||||
this.groupId = groupId;
|
||||
this.artifactId = artifactId;
|
||||
|
|
|
@ -37,7 +37,7 @@ public class PluginResolutionException
|
|||
|
||||
public PluginResolutionException( Plugin plugin, ArtifactResolutionException e )
|
||||
{
|
||||
super( "Plugin could not be resolved: " + e.getMessage(), e.getGroupId(), e.getArtifactId(), e.getVersion(), "maven-plugin",null, e.getRemoteRepositories(), null, e.getCause() );
|
||||
super( "Plugin could not be resolved: " + e.getMessage(), e.getGroupId(), e.getArtifactId(), e.getVersion(), "maven-plugin", null, e.getRemoteRepositories(), null, e.getCause() );
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ public class DefaultProjectBuilder
|
|||
{
|
||||
lifecycle.populateDefaultConfigurationForPlugins( model.getBuild().getPlugins(),
|
||||
configuration.getLocalRepository(),
|
||||
project.getPluginArtifactRepositories() );
|
||||
configuration.getPluginArtifactRepositories() );
|
||||
}
|
||||
}
|
||||
catch ( LifecycleExecutionException e )
|
||||
|
|
|
@ -83,7 +83,7 @@ public abstract class AbstractCoreMavenComponentTestCase
|
|||
|
||||
protected MavenExecutionRequest createMavenExecutionRequest( File pom )
|
||||
throws Exception
|
||||
{
|
||||
{
|
||||
MavenExecutionRequest request = new DefaultMavenExecutionRequest()
|
||||
.setPom( pom ).setProjectPresent( true )
|
||||
.setPluginGroups( Arrays.asList( new String[] { "org.apache.maven.plugins" } ) )
|
||||
|
@ -109,7 +109,7 @@ public abstract class AbstractCoreMavenComponentTestCase
|
|||
throws Exception
|
||||
{
|
||||
MavenExecutionRequest request = createMavenExecutionRequest( pom );
|
||||
|
||||
|
||||
ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest()
|
||||
.setLocalRepository( request.getLocalRepository() )
|
||||
.setRemoteRepositories( request.getRemoteRepositories() )
|
||||
|
@ -153,9 +153,7 @@ public abstract class AbstractCoreMavenComponentTestCase
|
|||
Repository itRepo = new Repository();
|
||||
itRepo.setId( "maven.it" );
|
||||
itRepo.setUrl( "http://repository.sonatype.org/content/repositories/maven.snapshots" );
|
||||
|
||||
return Arrays.asList( repositorySystem.buildArtifactRepository( itRepo ),
|
||||
repositorySystem.createDefaultRemoteRepository() );
|
||||
return Arrays.asList( repositorySystem.createDefaultRemoteRepository(), repositorySystem.buildArtifactRepository( itRepo ) );
|
||||
}
|
||||
|
||||
protected ArtifactRepository getLocalRepository()
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.apache.maven.execution.MavenExecutionRequest;
|
|||
import org.apache.maven.repository.RepositorySystem;
|
||||
import org.apache.maven.settings.MavenSettingsBuilder;
|
||||
import org.apache.maven.settings.Mirror;
|
||||
import org.apache.maven.settings.Proxy;
|
||||
import org.apache.maven.settings.Server;
|
||||
import org.apache.maven.settings.Settings;
|
||||
import org.apache.maven.settings.SettingsUtils;
|
||||
|
@ -146,6 +147,18 @@ public class DefaultMavenExecutionRequestPopulator
|
|||
{
|
||||
Settings settings = request.getSettings();
|
||||
|
||||
// <proxies>
|
||||
// <proxy>
|
||||
// <active>true</active>
|
||||
// <protocol>http</protocol>
|
||||
// <host>proxy.somewhere.com</host>
|
||||
// <port>8080</port>
|
||||
// <username>proxyuser</username>
|
||||
// <password>somepassword</password>
|
||||
// <nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts>
|
||||
// </proxy>
|
||||
// </proxies>
|
||||
|
||||
/*
|
||||
Proxy proxy = settings.getActiveProxy();
|
||||
|
||||
|
@ -163,8 +176,6 @@ public class DefaultMavenExecutionRequestPopulator
|
|||
for ( Server server : settings.getServers() )
|
||||
{
|
||||
repositorySystem.addAuthenticationForArtifactRepository( server.getId(), server.getUsername(), server.getPassword() );
|
||||
|
||||
//repositorySystem.addPermissionInfo( server.getId(), server.getFilePermissions(), server.getDirectoryPermissions() );
|
||||
}
|
||||
|
||||
for ( Mirror mirror : settings.getMirrors() )
|
||||
|
|
Loading…
Reference in New Issue