Skip to content

Commit

Permalink
Merge pull request #13170 from Mobe91/issues/13169-quarkus-maven-plug…
Browse files Browse the repository at this point in the history
…in-debug-enabled-fixes

Do not throw an exception when enabling debug for native image if src/main/java does not exist
  • Loading branch information
gsmet authored Feb 4, 2021
2 parents fa8df61 + 137a026 commit ad2b90b
Showing 1 changed file with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -503,18 +503,20 @@ private static void copySourcesToSourceCache(OutputTargetBuildItem outputTargetB
final Path javaSourcesPath = outputTargetBuildItem.getOutputDirectory().resolve(
Paths.get("..", "src", "main", "java"));

try (Stream<Path> paths = Files.walk(javaSourcesPath)) {
paths.forEach(path -> {
Path targetPath = Paths.get(targetSrc.toString(),
path.toString().substring(javaSourcesPath.toString().length()));
try {
Files.copy(path, targetPath, StandardCopyOption.REPLACE_EXISTING);
} catch (IOException e) {
throw new UncheckedIOException("Unable to copy from " + path + " to " + targetPath, e);
}
});
} catch (IOException e) {
throw new UncheckedIOException("Unable to walk path " + javaSourcesPath, e);
if (Files.exists(javaSourcesPath)) {
try (Stream<Path> paths = Files.walk(javaSourcesPath)) {
paths.forEach(path -> {
Path targetPath = Paths.get(targetSrc.toString(),
path.toString().substring(javaSourcesPath.toString().length()));
try {
Files.copy(path, targetPath, StandardCopyOption.REPLACE_EXISTING);
} catch (IOException e) {
throw new UncheckedIOException("Unable to copy from " + path + " to " + targetPath, e);
}
});
} catch (IOException e) {
throw new UncheckedIOException("Unable to walk path " + javaSourcesPath, e);
}
}
}

Expand Down

0 comments on commit ad2b90b

Please sign in to comment.