mirror of https://github.com/apache/maven.git
o Fixed resolution of project dependencies
git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@773213 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0c5208ac25
commit
2637a1e5d1
|
@ -306,7 +306,7 @@ public class DefaultMavenProjectBuilder
|
|||
Artifact pomArtifact = repositorySystem.createProjectArtifact( project.getGroupId(), project.getArtifactId(), project.getVersion() );
|
||||
pomArtifact.setFile( pomFile );
|
||||
|
||||
ArtifactResolutionRequest request = new ArtifactResolutionRequest().setArtifact( pomArtifact ).setArtifactDependencies( project.getDependencyArtifacts() )
|
||||
ArtifactResolutionRequest request = new ArtifactResolutionRequest().setArtifact( pomArtifact ).setResolveTransitively( true ).setArtifactDependencies( project.getDependencyArtifacts() )
|
||||
.setLocalRepository( configuration.getLocalRepository() ).setRemoteRepostories( project.getRemoteArtifactRepositories() ).setManagedVersionMap( project.getManagedVersionMap() );
|
||||
|
||||
ArtifactResolutionResult result = repositorySystem.resolve( request );
|
||||
|
|
|
@ -65,6 +65,11 @@ public class MavenMetadataSource
|
|||
{
|
||||
Artifact pomArtifact = repositorySystem.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() );
|
||||
|
||||
if ( "pom".equals( artifact.getType() ) )
|
||||
{
|
||||
pomArtifact.setFile( artifact.getFile() );
|
||||
}
|
||||
|
||||
Set<Artifact> artifacts = Collections.emptySet();
|
||||
|
||||
ProjectBuilderConfiguration configuration = new DefaultProjectBuilderConfiguration();
|
||||
|
@ -79,7 +84,15 @@ public class MavenMetadataSource
|
|||
|
||||
if ( !artifact.getArtifactHandler().isIncludesDependencies() )
|
||||
{
|
||||
ArtifactFilter filter = new ScopeArtifactFilter( artifact.getScope() );
|
||||
ArtifactFilter filter;
|
||||
if ( artifact.getScope() == null )
|
||||
{
|
||||
filter = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
filter = new ScopeArtifactFilter( artifact.getScope() );
|
||||
}
|
||||
|
||||
artifacts = project.createArtifacts( filter );
|
||||
|
||||
|
|
Loading…
Reference in New Issue