Skip to content

Commit

Permalink
devonfw#1696: fixed jar handling
Browse files Browse the repository at this point in the history
added extra condition for jar handling to TemplateSetReader constructor
  • Loading branch information
jan-vcapgemini committed Aug 10, 2023
1 parent 60bbd58 commit 07599a9
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 07599a9

Please sign in to comment.