Skip to content

Commit 9bc0ccc

Browse files
authored
Merge pull request #48701 from gsmet/avoid-old-roots
Config doc - Avoid target directories from dropped modules
2 parents b1c2c06 + 8dbbfe6 commit 9bc0ccc

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)