Skip to content

Commit 8dbbfe6

Browse files
committed
Config doc - Avoid target directories from dropped modules
It has been a problem from time to time and it's simple enough to fix so let's fix it.
1 parent bc0ade2 commit 8dbbfe6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

devtools/config-doc-maven-plugin/src/main/java/io/quarkus/maven/config/doc/GenerateConfigDocMojo.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,11 @@ private static List<Path> findTargetDirectories(Path scanDirectory) throws MojoE
276276
@Override
277277
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
278278
if (dir.endsWith(TARGET)) {
279-
targets.add(dir);
279+
// we check if there is a POM around as it might happen that the target/ directory is still around
280+
// while the module has been dropped
281+
if (Files.exists(dir.resolve("../pom.xml"))) {
282+
targets.add(dir);
283+
}
280284

281285
// a target directory can contain target directories for test projects
282286
// so let's make sure we ignore whatever is nested in a target

0 commit comments

Comments
 (0)