Skip to content

Commit

Permalink
Add -DdepsTreeOutputFile system property for Projects
Browse files Browse the repository at this point in the history
  • Loading branch information
omerzi committed Jan 1, 2024
1 parent ae942f8 commit 001b669
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/test/java/com/jfrog/mavendeptree/integration/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ static List<String> runMavenDepTree(String projectName, String testOutputDir, St
*
* @param projectName - The test project to run
* @param pluginVersion - The plugin version
* @param withOutputFile - Write the test result to a temporary output file
* @return the output.
* @throws IOException in case of any unexpected I/O error.
* @throws VerificationException in case of any Maven Verifier error.
Expand All @@ -91,8 +92,10 @@ static List<String> runMavenProjectTree(String projectName, String pluginVersion
List<String> goals = Lists.newArrayList("clean", "com.jfrog:maven-dep-tree:" + pluginVersion + ":projects", "-q");

if (withOutputFile) {
goals.add("-DdepsTreeOutputFile=" + testDir.getAbsolutePath() + "/testOutput.out");
outputFile = "testOutput.out";
Path tempFile = Files.createTempFile(Paths.get(testDir.getAbsolutePath()), "testOutput", ".out");
String tempFilePath = tempFile.toAbsolutePath().toString();
goals.add("-DdepsTreeOutputFile=" + tempFilePath);
outputFile = tempFile.toString();
}

verifier.executeGoals(goals);
Expand Down

0 comments on commit 001b669

Please sign in to comment.