Skip to content

Commit

Permalink
Merge pull request #268 from bstansberry/WFGP-259
Browse files Browse the repository at this point in the history
[WFGP-259] Use the native FS path as the moduleTemplates map key, not the…
  • Loading branch information
jfdenise authored Nov 2, 2023
2 parents ffec067 + 4088b53 commit 548127b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 548127b

Please sign in to comment.