mirror of https://github.com/apache/maven.git
o use the one way of creating an artifact resolution request.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@774335 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
57ea53e5f5
commit
835c8f14ef
|
@ -188,8 +188,6 @@ public class DefaultMavenProjectBuilder
|
||||||
throw new ProjectBuildingException( "", e.getMessage(), e );
|
throw new ProjectBuildingException( "", e.getMessage(), e );
|
||||||
}
|
}
|
||||||
|
|
||||||
//project.setActiveProfiles( projectProfiles );
|
|
||||||
|
|
||||||
Build build = project.getBuild();
|
Build build = project.getBuild();
|
||||||
// NOTE: setting this script-source root before path translation, because
|
// NOTE: setting this script-source root before path translation, because
|
||||||
// the plugin tools compose basedir and scriptSourceRoot into a single file.
|
// the plugin tools compose basedir and scriptSourceRoot into a single file.
|
||||||
|
@ -212,7 +210,11 @@ public class DefaultMavenProjectBuilder
|
||||||
artifact = repositorySystem.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() );
|
artifact = repositorySystem.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() );
|
||||||
}
|
}
|
||||||
|
|
||||||
ArtifactResolutionRequest request = new ArtifactResolutionRequest( artifact, configuration.getLocalRepository(), configuration.getRemoteRepositories() );
|
ArtifactResolutionRequest request = new ArtifactResolutionRequest()
|
||||||
|
.setArtifact( artifact )
|
||||||
|
.setLocalRepository( configuration.getLocalRepository() )
|
||||||
|
.setRemoteRepostories( configuration.getRemoteRepositories() );
|
||||||
|
|
||||||
ArtifactResolutionResult result = repositorySystem.resolve( request );
|
ArtifactResolutionResult result = repositorySystem.resolve( request );
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -296,6 +298,7 @@ public class DefaultMavenProjectBuilder
|
||||||
}
|
}
|
||||||
|
|
||||||
project.setArtifacts( result.getArtifacts() );
|
project.setArtifacts( result.getArtifacts() );
|
||||||
|
|
||||||
project.getArtifacts().remove( artifact );
|
project.getArtifacts().remove( artifact );
|
||||||
|
|
||||||
return new MavenProjectBuildingResult( project, result );
|
return new MavenProjectBuildingResult( project, result );
|
||||||
|
@ -531,7 +534,11 @@ public class DefaultMavenProjectBuilder
|
||||||
|
|
||||||
Artifact artifactParent = repositorySystem.createProjectArtifact( domainModel.getParentGroupId(), domainModel.getParentArtifactId(), domainModel.getParentVersion() );
|
Artifact artifactParent = repositorySystem.createProjectArtifact( domainModel.getParentGroupId(), domainModel.getParentArtifactId(), domainModel.getParentVersion() );
|
||||||
|
|
||||||
ArtifactResolutionRequest request = new ArtifactResolutionRequest( artifactParent, localRepository, remoteRepositories );
|
ArtifactResolutionRequest request = new ArtifactResolutionRequest()
|
||||||
|
.setArtifact( artifactParent )
|
||||||
|
.setLocalRepository( localRepository )
|
||||||
|
.setRemoteRepostories( remoteRepositories );
|
||||||
|
|
||||||
ArtifactResolutionResult result;
|
ArtifactResolutionResult result;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue