Skip to content

Commit 4c8ca8e

Browse files
pzygielomichael-o
authored andcommitted
[MJAVADOC-804] Remove temporary directories created by tests
This closes #301
1 parent 91369fa commit 4c8ca8e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ public class JavadocReportTest extends AbstractMojoTestCase {
8383

8484
private Path unit;
8585

86+
private Path tempDirectory;
87+
8688
private File localRepo;
8789

8890
private static final Logger LOGGER = LoggerFactory.getLogger(JavadocReportTest.class);
@@ -91,7 +93,7 @@ public class JavadocReportTest extends AbstractMojoTestCase {
9193
protected void setUp() throws Exception {
9294
super.setUp();
9395

94-
Path tempDirectory = Files.createTempDirectory("JavadocReportTest");
96+
tempDirectory = Files.createTempDirectory("JavadocReportTest");
9597
localRepo = tempDirectory.resolve(Paths.get("target/local-repo/")).toFile();
9698
unit = new File(getBasedir(), "src/test/resources/unit").toPath();
9799

@@ -101,7 +103,7 @@ protected void setUp() throws Exception {
101103
@Override
102104
protected void tearDown() throws Exception {
103105
try {
104-
deleteDirectory(localRepo);
106+
deleteDirectory(tempDirectory.toFile());
105107
} catch (IOException ex) {
106108
// CI servers can have problems deleting files.
107109
// It will get cleared out eventually, and since

0 commit comments

Comments
 (0)