This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 4c8ca8ed [MJAVADOC-804] Remove temporary directories created by tests
4c8ca8ed is described below

commit 4c8ca8ede6517cc34a7a1a38ba113d0fac351e4d
Author: Piotrek Żygieło <pzygi...@users.noreply.github.com>
AuthorDate: Sun Jul 14 18:26:54 2024 +0200

    [MJAVADOC-804] Remove temporary directories created by tests
    
    This closes #301
---
 .../java/org/apache/maven/plugins/javadoc/JavadocReportTest.java    | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java 
b/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java
index f80cdf64..abcea9af 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java
@@ -83,6 +83,8 @@ public class JavadocReportTest extends AbstractMojoTestCase {
 
     private Path unit;
 
+    private Path tempDirectory;
+
     private File localRepo;
 
     private static final Logger LOGGER = 
LoggerFactory.getLogger(JavadocReportTest.class);
@@ -91,7 +93,7 @@ public class JavadocReportTest extends AbstractMojoTestCase {
     protected void setUp() throws Exception {
         super.setUp();
 
-        Path tempDirectory = Files.createTempDirectory("JavadocReportTest");
+        tempDirectory = Files.createTempDirectory("JavadocReportTest");
         localRepo = 
tempDirectory.resolve(Paths.get("target/local-repo/")).toFile();
         unit = new File(getBasedir(), "src/test/resources/unit").toPath();
 
@@ -101,7 +103,7 @@ public class JavadocReportTest extends AbstractMojoTestCase 
{
     @Override
     protected void tearDown() throws Exception {
         try {
-            deleteDirectory(localRepo);
+            deleteDirectory(tempDirectory.toFile());
         } catch (IOException ex) {
             // CI servers can have problems deleting files.
             // It will get cleared out eventually, and since

Reply via email to