Find dependencies even if parent is cannot be found
@@ -164,7 +164,7 @@ public class GraphMavenResolver implements Runnable {
if (repl) {
if (dependencyGraph == null) {
- logger.warn("REPL mode only works with an initilized graph");
+ logger.warn("REPL mode only works with an initialized graph");
return;
}
@@ -179,7 +179,9 @@ public class GraphMavenResolver implements Runnable {
System.out.print("> ");
var input = scanner.nextLine();
- if (input.equals("quit")) {break;}
+ if (input.equals("quit")) {
+ break;
+ }
var parts = input.split(":");
if (parts.length < 3 || parts[2] == null) {
@@ -195,7 +197,6 @@ public class GraphMavenResolver implements Runnable {
}
} catch (Exception e) {
System.err.println(e.getMessage());
- continue;
}
allDeps.addAll(resolveDependencies(parts[0], parts[1], parts[2], true));
@@ -208,7 +209,9 @@ public class GraphMavenResolver implements Runnable {
}
/**
- * Performs a BFS on the dependency graph to resolve the dependencies of the provided {@link Revision}
+ * Performs a BFS on the dependency graph to resolve the dependencies of the provided {@link Revision}, as specified
+ * by the provided revision details.
+ *
* @return The (transitive) dependency set
*/
public Set<Revision> resolveDependencies(String groupId, String artifactId,
@@ -218,7 +221,9 @@ public class GraphMavenResolver implements Runnable {
new Revision(groupId, artifactId, version, new Timestamp(-1))));
var result = new HashSet<>(workQueue);
- if (!transitive) { return new HashSet<>(workQueue); }
+ if (!transitive) {
+ return new HashSet<>(workQueue);
+ }
boolean notEmpty = !workQueue.isEmpty();
while (notEmpty) {
@@ -234,12 +239,16 @@ public class GraphMavenResolver implements Runnable {
return result;
}
+ /**
+ * Performs a BFS on the dependency graph to resolve the dependencies of the provided {@link Revision}
+ *
+ * @return The (transitive) dependency set
+ */
public Set<Revision> resolveDependencies(Revision r, boolean transitive) {
return resolveDependencies(r.groupId, r.artifactId, r.version.toString(), transitive);
}
-
public void buildDependencyGraph(DSLContext dbContext) {
dependencyGraph = new DependencyGraphBuilder().buildDependencyGraph(dbContext);
}
