[MNG-4275] [regression] Direct relocations no longer log at WARNING level : MNG-3380 conflicts with MNG-1689

o Merged from r801437

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@801785 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-08-06 19:29:18 +00:00
parent 95632cef43
commit ae33045c96
2 changed files with 12 additions and 5 deletions

View File

@ -395,6 +395,7 @@ private void recurse( ArtifactResolutionResult result,
if ( !child.isResolved() && ( !child.getArtifact().isOptional() || child.isChildOfRootNode() ) )
{
Artifact artifact = child.getArtifact();
artifact.setDependencyTrail( node.getDependencyTrail() );
List<ArtifactRepository> childRemoteRepositories = child.getRemoteRepositories();
try
@ -458,9 +459,6 @@ private void recurse( ArtifactResolutionResult result,
if ( version == null )
{
// Getting the dependency trail so it can be logged in the exception
artifact.setDependencyTrail( node.getDependencyTrail() );
if ( versions.isEmpty() )
{
throw new OverConstrainedVersionException(
@ -506,8 +504,6 @@ private void recurse( ArtifactResolutionResult result,
continue;
}
artifact.setDependencyTrail( node.getDependencyTrail() );
ResolutionGroup rGroup = source.retrieve( artifact, localRepository, childRemoteRepositories );
// TODO might be better to have source.retrieve() throw a specific exception for this

View File

@ -568,6 +568,17 @@ private ProjectRelocation retrieveRelocatedProject( Artifact artifact, ArtifactR
{
message += " " + relocation.getMessage() + "\n";
}
if ( artifact.getDependencyTrail() != null && artifact.getDependencyTrail().size() == 1 )
{
logger.warn( "While downloading " + pomArtifact.getGroupId() + ":"
+ pomArtifact.getArtifactId() + ":" + pomArtifact.getVersion() + message + "\n" );
}
else
{
logger.debug( "While downloading " + pomArtifact.getGroupId() + ":"
+ pomArtifact.getArtifactId() + ":" + pomArtifact.getVersion() + message + "\n" );
}
}
else
{