1 package org
.argeo
.slc
.aether
;
3 import org
.apache
.commons
.logging
.Log
;
4 import org
.apache
.commons
.logging
.LogFactory
;
5 import org
.sonatype
.aether
.artifact
.Artifact
;
6 import org
.sonatype
.aether
.graph
.DependencyNode
;
8 /** Utilities related to Aether */
9 public class AetherUtils
{
10 private final static Log log
= LogFactory
.getLog(AetherUtils
.class);
12 /** Logs a dependency node and its transitive dependencies as a tree. */
13 public static void logDependencyNode(int depth
,
14 DependencyNode dependencyNode
) {
15 if (!log
.isDebugEnabled())
18 StringBuffer prefix
= new StringBuffer(depth
* 2 + 2);
19 // prefix.append("|-");
20 for (int i
= 0; i
< depth
* 2; i
++) {
23 Artifact artifact
= dependencyNode
.getDependency().getArtifact();
24 log
.debug(prefix
+ "|-> " + artifact
.getArtifactId() + " ["
25 + artifact
.getVersion() + "]"
26 + (dependencyNode
.getDependency().isOptional() ?
" ?" : ""));
27 for (DependencyNode child
: dependencyNode
.getChildren()) {
28 logDependencyNode(depth
+ 1, child
);