From a7cabf2b0f3c662cba9db7582837a381c3dfc203 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Thu, 23 Jan 2020 12:46:14 +0200 Subject: [PATCH 1/2] Fix broken use GraalVM json configuration files --- .../pkg/steps/JarResultBuildStep.java | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/JarResultBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/JarResultBuildStep.java index 215ba39e698b9..c590c9ddab4c5 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/JarResultBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/JarResultBuildStep.java @@ -13,6 +13,7 @@ import java.io.UncheckedIOException; import java.nio.file.FileAlreadyExistsException; import java.nio.file.FileSystem; +import java.nio.file.FileSystems; import java.nio.file.FileVisitOption; import java.nio.file.FileVisitResult; import java.nio.file.Files; @@ -377,26 +378,28 @@ public NativeImageSourceJarBuildItem buildNativeImageJar(CurateOutcomeBuildItem */ private void copyJsonConfigFiles(ApplicationArchivesBuildItem applicationArchivesBuildItem, Path thinJarDirectory) throws IOException { - // this will contain all the resources in both maven and gradle cases - the latter is true because we copy them in AugmentTask - Path classesLocation = applicationArchivesBuildItem.getRootArchive().getArchiveLocation(); - try (Stream stream = Files.find(classesLocation, 1, new BiPredicate() { - @Override - public boolean test(Path path, BasicFileAttributes basicFileAttributes) { - return basicFileAttributes.isRegularFile() && path.toString().endsWith(".json"); - } - })) { - stream.forEach(new Consumer() { + // archiveLocation contains the location of the application jar at this point + Path appJarPath = applicationArchivesBuildItem.getRootArchive().getArchiveLocation(); + try (FileSystem jarFileSystem = FileSystems.newFileSystem(appJarPath, null)) { + try (Stream stream = Files.find(jarFileSystem.getPath("/"), 1, new BiPredicate() { @Override - public void accept(Path jsonPath) { - try { - Files.copy(jsonPath, thinJarDirectory.resolve(jsonPath.getFileName())); - } catch (IOException e) { - throw new UncheckedIOException( - "Unable to copy json config file from " + jsonPath + " to " + thinJarDirectory, - e); - } + public boolean test(Path path, BasicFileAttributes basicFileAttributes) { + return basicFileAttributes.isRegularFile() && path.toString().endsWith(".json"); } - }); + })) { + stream.forEach(new Consumer() { + @Override + public void accept(Path jsonPath) { + try { + Files.copy(jsonPath.getFileName(), thinJarDirectory.resolve(jsonPath.getFileName().toString())); + } catch (IOException e) { + throw new UncheckedIOException( + "Unable to copy json config file from " + jsonPath + " to " + thinJarDirectory, + e); + } + } + }); + } } } From 25f4c38e49cc2870ba2a5d3f47f516a9c7ac0bed Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Thu, 23 Jan 2020 12:54:44 +0200 Subject: [PATCH 2/2] Add infinispan-embedded to the native image CI --- ci-templates/stages.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci-templates/stages.yml b/ci-templates/stages.yml index 4f37c5c9d26e5..a89da6546c08b 100644 --- a/ci-templates/stages.yml +++ b/ci-templates/stages.yml @@ -306,10 +306,11 @@ stages: parameters: poolSettings: ${{parameters.poolSettings}} expectUseVMs: ${{parameters.expectUseVMs}} - timeoutInMinutes: 25 + timeoutInMinutes: 30 modules: - infinispan-cache-jpa - infinispan-client + - infinispan-embedded - cache name: cache