Skip to content

Commit

Permalink
Update debug log messages about management performed (apache#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianSchulte authored and slachiewicz committed Dec 26, 2019
1 parent e3aa406 commit da196b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,8 @@ public boolean visitEnter( DependencyNode node )
org.eclipse.aether.artifact.Artifact art = dep.getArtifact();

buffer.append( art );
if ( StringUtils.isNotEmpty( dep.getScope() ) )
{
buffer.append( ':' ).append( dep.getScope() );
}

if ( dep.isOptional() )
{
buffer.append( " (optional)" );
}
buffer.append( ':' ).append( dep.getScope() );
buffer.append( ':' ).append( dep.isOptional() ? "optional" : "not optional" );

// TODO We currently cannot tell which <dependencyManagement> section contained the management
// information. When the resolver provides this information, these log messages should be updated
Expand All @@ -259,23 +252,23 @@ public boolean visitEnter( DependencyNode node )
{
final String premanagedScope = DependencyManagerUtils.getPremanagedScope( node );
buffer.append( " (scope managed from " );
buffer.append( Objects.toString( premanagedScope, "default" ) );
buffer.append( StringUtils.defaultString( premanagedScope, "default" ) );
buffer.append( ')' );
}

if ( ( node.getManagedBits() & DependencyNode.MANAGED_VERSION ) == DependencyNode.MANAGED_VERSION )
{
final String premanagedVersion = DependencyManagerUtils.getPremanagedVersion( node );
buffer.append( " (version managed from " );
buffer.append( Objects.toString( premanagedVersion, "default" ) );
buffer.append( StringUtils.defaultString( premanagedVersion, "default" ) );
buffer.append( ')' );
}

if ( ( node.getManagedBits() & DependencyNode.MANAGED_OPTIONAL ) == DependencyNode.MANAGED_OPTIONAL )
{
final Boolean premanagedOptional = DependencyManagerUtils.getPremanagedOptional( node );
buffer.append( " (optionality managed from " );
buffer.append( Objects.toString( premanagedOptional, "default" ) );
buffer.append( StringUtils.defaultString( premanagedOptional, "default" ) );
buffer.append( ')' );
}

Expand All @@ -286,7 +279,7 @@ public boolean visitEnter( DependencyNode node )
DependencyManagerUtils.getPremanagedExclusions( node );

buffer.append( " (exclusions managed from " );
buffer.append( Objects.toString( premanagedExclusions, "default" ) );
buffer.append( StringUtils.defaultString( premanagedExclusions, "default" ) );
buffer.append( ')' );
}

Expand All @@ -297,7 +290,7 @@ public boolean visitEnter( DependencyNode node )
DependencyManagerUtils.getPremanagedProperties( node );

buffer.append( " (properties managed from " );
buffer.append( Objects.toString( premanagedProperties, "default" ) );
buffer.append( StringUtils.defaultString( premanagedProperties, "default" ) );
buffer.append( ')' );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,8 @@ public boolean visitEnter( DependencyNode node )
org.eclipse.aether.artifact.Artifact art = dep.getArtifact();

buffer.append( art );
if ( StringUtils.isNotEmpty( dep.getScope() ) )
{
buffer.append( ':' ).append( dep.getScope() );
}
buffer.append( ':' ).append( dep.getScope() );
buffer.append( ':' ).append( dep.isOptional() ? "optional" : "not optional" );

if ( dep.isOptional() )
{
Expand Down Expand Up @@ -297,7 +295,7 @@ public boolean visitEnter( DependencyNode node )
DependencyManagerUtils.getPremanagedExclusions( node );

buffer.append( " (exclusions managed from " );
buffer.append( Objects.toString( premanagedExclusions, "default" ) );
buffer.append( StringUtils.defaultString( premanagedExclusions, "default" ) );
buffer.append( ')' );
}

Expand All @@ -308,7 +306,7 @@ public boolean visitEnter( DependencyNode node )
DependencyManagerUtils.getPremanagedProperties( node );

buffer.append( " (properties managed from " );
buffer.append( Objects.toString( premanagedProperties, "default" ) );
buffer.append( StringUtils.defaultString( premanagedProperties, "default" ) );
buffer.append( ')' );
}
}
Expand Down

0 comments on commit da196b1

Please sign in to comment.