From 07599a99b0443fd0fd0303db3654d1b31fc0ef08 Mon Sep 17 00:00:00 2001 From: jan-vcapgemini Date: Thu, 10 Aug 2023 12:32:14 +0200 Subject: [PATCH] #1696: fixed jar handling added extra condition for jar handling to TemplateSetReader constructor --- .../impl/config/reader/TemplateSetReader.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/reader/TemplateSetReader.java b/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/reader/TemplateSetReader.java index 09436bba0..d6175e73b 100644 --- a/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/reader/TemplateSetReader.java +++ b/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/reader/TemplateSetReader.java @@ -10,6 +10,7 @@ import com.devonfw.cobigen.impl.config.entity.io.ContextConfiguration; import com.devonfw.cobigen.impl.config.entity.io.TemplateSetConfiguration; import com.devonfw.cobigen.impl.config.entity.io.TemplatesConfiguration; +import com.devonfw.cobigen.impl.util.FileSystemUtil; /** * The {@link TemplateSetReader} combines everything from the {@link TemplatesConfigurationReader} and @@ -44,8 +45,15 @@ public class TemplateSetReader extends JaxbDeserializer { public TemplateSetReader(Path rootDir, ConfigurationReader configurationReader) { - this.templateSetFile = rootDir.resolve(ConfigurationConstants.MAVEN_CONFIGURATION_RESOURCE_FOLDER) - .resolve(ConfigurationConstants.TEMPLATE_SET_CONFIG_FILENAME); + if (rootDir.toString().endsWith(".jar")) { + this.templateSetFile = FileSystemUtil.createFileSystemDependentPath(rootDir.toUri()) + .resolve(ConfigurationConstants.TEMPLATE_SET_CONFIG_FILENAME); + } else { + this.templateSetFile = FileSystemUtil.createFileSystemDependentPath(rootDir.toUri()) + .resolve(ConfigurationConstants.MAVEN_CONFIGURATION_RESOURCE_FOLDER) + .resolve(ConfigurationConstants.TEMPLATE_SET_CONFIG_FILENAME); + } + this.configurationReader = configurationReader; deserializeConfigFile(); }