diff --git a/quarkus/addons/source-files/deployment/src/main/java/org/kie/kogito/addon/source/files/deployment/KogitoAddOnSourceFilesProcessor.java b/quarkus/addons/source-files/deployment/src/main/java/org/kie/kogito/addon/source/files/deployment/KogitoAddOnSourceFilesProcessor.java index e3641df6ae1..8ab5587f562 100644 --- a/quarkus/addons/source-files/deployment/src/main/java/org/kie/kogito/addon/source/files/deployment/KogitoAddOnSourceFilesProcessor.java +++ b/quarkus/addons/source-files/deployment/src/main/java/org/kie/kogito/addon/source/files/deployment/KogitoAddOnSourceFilesProcessor.java @@ -87,11 +87,13 @@ private List getSourceFiles(File[] resourcePaths) throws IOException { for (File resourceFile : resourcePaths) { Path resourcePath = resourceFile.toPath(); - try (Stream walkedPaths = Files.walk(resourcePath)) { - walkedPaths.filter(this::isSourceFile) - .map(resourcePath::relativize) - .map(Path::toString) - .forEach(sourceFiles::add); + if (Files.exists(resourcePath)) { + try (Stream walkedPaths = Files.walk(resourcePath)) { + walkedPaths.filter(this::isSourceFile) + .map(resourcePath::relativize) + .map(Path::toString) + .forEach(sourceFiles::add); + } } }