davsclaus commented on code in PR #9470:
URL: https://github.com/apache/camel/pull/9470#discussion_r1126972504


##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportSpringBoot.java:
##########
@@ -137,13 +139,23 @@ private void createSettingsGradle(File file) throws 
Exception {
     private void createMavenPom(File settings, File profile, File pom, 
Set<String> deps) throws Exception {
         String[] ids = gav.split(":");
 
-        String context = 
readResourceTemplate("templates/spring-boot-pom.tmpl");
-
         Properties prop = new CamelCaseOrderedProperties();
         RuntimeUtil.loadProperties(prop, settings);
         String repos = getMavenRepos(settings, prop, camelSpringBootVersion);
 
         CamelCatalog catalog = CatalogLoader.loadSpringBootCatalog(repos, 
camelSpringBootVersion);
+
+        // First try to load a specialized template from the catalog, if the 
catalog does not provide it
+        // fallback to the template defined in camel-jbang-core
+        String context;
+        InputStream template = catalog.loadResource("camel-jbang", 
"spring-boot-pom.tmpl");
+        if (template != null) {
+            context = IOHelper.loadText(template);
+            IOHelper.close(template);

Review Comment:
   IOHelper automatic close, so no need for this



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to