From 4088b533611d5253748b0e7be93f62521c46261f Mon Sep 17 00:00:00 2001 From: Brian Stansberry Date: Tue, 31 Oct 2023 16:54:17 -0500 Subject: [PATCH] [WFGP-259] Use the native FS path as the moduleTemplates map key, not the source path The source path may come from ZipFileSystem and might not use the same separator char as the native FS file where the module template is stored --- .../wildfly/galleon/maven/FeatureSpecGeneratorInvoker.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/maven-plugin/src/main/java/org/wildfly/galleon/maven/FeatureSpecGeneratorInvoker.java b/maven-plugin/src/main/java/org/wildfly/galleon/maven/FeatureSpecGeneratorInvoker.java index 9cf67a9c..d4d97396 100644 --- a/maven-plugin/src/main/java/org/wildfly/galleon/maven/FeatureSpecGeneratorInvoker.java +++ b/maven-plugin/src/main/java/org/wildfly/galleon/maven/FeatureSpecGeneratorInvoker.java @@ -632,8 +632,10 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (WfConstants.MODULE_XML.equals(file.getFileName().toString())) { final String relativePath = source.relativize(file).toString(); - moduleTemplates.put(relativePath, fpArtifacts); - Files.copy(file, moduleTemplatesDir.resolve(relativePath), StandardCopyOption.REPLACE_EXISTING); + Path nativeCopy = Files.copy(file, moduleTemplatesDir.resolve(relativePath), StandardCopyOption.REPLACE_EXISTING); + // Use the native FS path as the map key, not the source path, which may be from ZipFileSystem + // and won't match the path of the actual template file we just wrote + moduleTemplates.put(moduleTemplatesDir.relativize(nativeCopy).toString(), fpArtifacts); } else { final Path target = wildflyHome.resolve(MODULES).resolve(source.relativize(file).toString()); Files.createDirectories(target.getParent());