diff --git a/pepper-lib/src/main/java/de/hu_berlin/german/korpling/saltnpepper/pepper/cli/PepperStarter.java b/pepper-lib/src/main/java/de/hu_berlin/german/korpling/saltnpepper/pepper/cli/PepperStarter.java index 1fb05e592..3ed17e820 100644 --- a/pepper-lib/src/main/java/de/hu_berlin/german/korpling/saltnpepper/pepper/cli/PepperStarter.java +++ b/pepper-lib/src/main/java/de/hu_berlin/german/korpling/saltnpepper/pepper/cli/PepperStarter.java @@ -143,7 +143,7 @@ public void setPepperConfiguration(PepperStarterConfiguration pepperConf) { } public enum COMMAND { - PRINT_DEPS("dependencies", "deps", "Bundle id or groupId, artifactId and version split by ::", "displays all dependencies of the specified component"), + PRINT_DEPS("dependencies", "deps", "Bundle id or GROUP_ID::ARTIFACT_ID::VERSION::MAVEN_REPOSITORY_URL or plugin names split by space; parameter all prints dependencies for all plugins", "displays all dependencies of the specified component"), // UPDATE("update", "u", "module name or location", "Updates the pepper module(s). Parameter \"all\" updates all modules listed in modules.xml."), // diff --git a/pepper-lib/src/main/java/de/hu_berlin/german/korpling/saltnpepper/pepper/connectors/impl/MavenAccessor.java b/pepper-lib/src/main/java/de/hu_berlin/german/korpling/saltnpepper/pepper/connectors/impl/MavenAccessor.java index 5e93ae516..c7a29ee95 100644 --- a/pepper-lib/src/main/java/de/hu_berlin/german/korpling/saltnpepper/pepper/connectors/impl/MavenAccessor.java +++ b/pepper-lib/src/main/java/de/hu_berlin/german/korpling/saltnpepper/pepper/connectors/impl/MavenAccessor.java @@ -707,6 +707,9 @@ private RemoteRepository buildRepo(String id, String url){ return repoBuilder.build(); } + /** This method starts invokes the computation of the dependency tree. If no version is + * provided, the highest version in the specified maven repository is used. If no repository + * is provided, maven central and the korpling maven repository are used for trial. */ public String printDependencies(String groupId, String artifactId, String version, String repositoryUrl){ /* repositories */ RemoteRepository repo = null; @@ -747,29 +750,29 @@ public String printDependencies(String groupId, String artifactId, String versio CollectResult collectResult; try { collectResult = mvnSystem.collectDependencies( session, collectRequest ); - return getDependencyPrint(collectResult.getRoot(), 0, 0); + return getDependencyPrint(collectResult.getRoot(), 0); } catch (DependencyCollectionException e) { logger.error("Could not print dependencies for ".concat(artifactId).concat(".")); } return null; } - private String getDependencyPrint(DependencyNode startNode, int level, int depth){ + /** this method recursively computes */ + private String getDependencyPrint(DependencyNode startNode, int depth){ String d = ""; - for (int i=0; i