Skip to content

Commit 934a54f

Browse files
committed
Add root pom path to the CLI
Signed-off-by: Rahul Krishna <i.m.ralk@gmail.com>
1 parent 3e73301 commit 934a54f

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/main/java/com/ibm/cldk/CodeAnalyzer.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public class CodeAnalyzer implements Runnable {
6969
@Option(names = {"--no-build"}, description = "Do not build your application. Use this option if you have already built your application.")
7070
private static boolean noBuild = false;
7171

72-
@Option(names = {"--no-copy-dependencies"}, description = "Do copy dependencies to a temporary directory.")
73-
private static boolean noCopyDeps = false;
72+
@Option(names = {"-f", "--project-root-path"}, description = "Path to the root pom.xml file of the project.")
73+
private static String projectRootPom;
7474

7575

7676
@Option(names = {"-a", "--analysis-level"}, description = "Level of analysis to perform. Options: 1 (for just symbol table) or 2 (for call graph). Default: 1")
@@ -122,15 +122,10 @@ private static void analyze() throws Exception {
122122
else {
123123
// download library dependencies of project for type resolution
124124
String dependencies = null;
125-
126-
if (!noCopyDeps) {
127-
if (BuildProject.downloadLibraryDependencies(input)) {
128-
dependencies = String.valueOf(BuildProject.libDownloadPath);
129-
} else {
130-
Log.warn("Failed to download library dependencies of project");
131-
}
125+
if (BuildProject.downloadLibraryDependencies(input, projectRootPom)) {
126+
dependencies = String.valueOf(BuildProject.libDownloadPath);
132127
} else {
133-
Log.warn("--no-copy-dependencies is activated, skipping library dependencies download");
128+
Log.warn("Failed to download library dependencies of project");
134129
}
135130
boolean analysisFileExists = output != null && Files.exists(Paths.get(output + File.separator + outputFileName));
136131

0 commit comments

Comments
 (0)