private static String buildDependencyTree(StringBuilder sb, String indent, MavenArtifactInfo[] artifacts) { int length = artifacts.length - 1; for (int i = 0; i <= length; i++) { MavenArtifactInfo artifact = artifacts[i]; String parsedIndent = indent; String nextLevelIndent = indent.replaceAll("\\+- $", "\\| ") + "+- "; // indent last one in different manner if (i == length) { parsedIndent = parsedIndent.replaceAll("\\+- $", "\\\\- "); nextLevelIndent = indent.replaceAll("\\+- $", " ") + "+- "; } sb.append(parsedIndent).append(artifact.getCoordinate().toCanonicalForm()).append(" [").append(artifact.getScope()) .append("]").append("\n"); buildDependencyTree(sb, nextLevelIndent, artifact.getDependencies()); } return sb.toString(); }
private String getKey(MavenArtifactInfo artifact) { return "mvn:" + artifact.getCoordinate().getGroupId() + ":" + artifact.getCoordinate().getArtifactId() + ":" + artifact.getCoordinate().getVersion(); }
dependency.getCoordinate().toCanonicalForm() ).withTransitivity().asFile(); for(File jar : jars) {
for (MavenArtifactInfo dep : artifact.getDependencies()) { String key = getKey(dep); if (!dep.getScope().equals(ScopeType.TEST)) { long before = System.currentTimeMillis(); FlexyClassLoader depCl = get(key); if (depCl == null) { if (dep.getCoordinate().getType().equals(PackagingType.POM)) { Log.debug("{} + {} ({}ms)", indent, key, (System.currentTimeMillis() - before)); installDependencies(resolver, parentCl, dep, depth+1); try { depJar = resolver .resolve(dep.getCoordinate().toCanonicalForm()) .withoutTransitivity() .asSingleFile(); if (dep.getScope().equals(ScopeType.RUNTIME)) { try { parentCl.load(depJar); if (!dep.getScope().equals(ScopeType.RUNTIME)) { parentCl.attachChild(depCl); Log.debug("{} = {} already loaded", indent, key, (System.currentTimeMillis() - before));
if (!isArtifactEjb(mai.getCoordinate())) { for (MavenResolvedArtifact reqMra : provided) { if (reqMra.getCoordinate().toCanonicalForm().equals(mai.getCoordinate().toCanonicalForm())) {
if (!isArtifactEjb(mai.getCoordinate())) { for (MavenResolvedArtifact reqMra : provided) { if (reqMra.getCoordinate().toCanonicalForm().equals(mai.getCoordinate().toCanonicalForm())) {