mirror of https://github.com/apache/maven.git
PR: MNG-1286
Submitted by: Lester Ecarma Check exclusions against relocated artifacts git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@330201 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
cbc583333c
commit
259a63ba90
|
@ -274,6 +274,15 @@ public class DefaultArtifactCollector
|
|||
}
|
||||
|
||||
ResolutionGroup rGroup = source.retrieve( artifact, localRepository, remoteRepositories );
|
||||
|
||||
//TODO might be better to have source.retreive() throw a specific exception for this situation
|
||||
//and catch here rather than have it return null
|
||||
if ( rGroup == null )
|
||||
{
|
||||
//relocated dependency artifact is declared excluded, no need to add and recurse further
|
||||
continue;
|
||||
}
|
||||
|
||||
child.addDependencies( rGroup.getArtifacts(), rGroup.getResolutionRepositories(), filter );
|
||||
}
|
||||
catch ( CyclicDependencyException e )
|
||||
|
|
|
@ -155,6 +155,12 @@ public class MavenMetadataSource
|
|||
artifact.setVersion( relocation.getVersion() );
|
||||
}
|
||||
|
||||
if ( artifact.getDependencyFilter() != null &&
|
||||
!artifact.getDependencyFilter().include( artifact ) )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
String message = "\n This artifact has been relocated to " + artifact.getGroupId() + ":" +
|
||||
artifact.getArtifactId() + ":" + artifact.getVersion() + ".\n";
|
||||
|
||||
|
@ -199,8 +205,8 @@ public class MavenMetadataSource
|
|||
// or used the inherited scope (should that be passed to the buildFromRepository method above?)
|
||||
try
|
||||
{
|
||||
artifacts =
|
||||
project.createArtifacts( artifactFactory, artifact.getScope(), artifact.getDependencyFilter() );
|
||||
artifacts = project.createArtifacts( artifactFactory, artifact.getScope(),
|
||||
artifact.getDependencyFilter() );
|
||||
}
|
||||
catch ( InvalidDependencyVersionException e )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue