You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/12/21 19:19:25 UTC

[GitHub] [camel] Croway opened a new pull request #6583: CAMEL-17345: camel-jbang create maven project

Croway opened a new pull request #6583:
URL: https://github.com/apache/camel/pull/6583


   <!-- Uncomment and fill this section if your PR is not trivial
   - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
   - [ ] Each commit in the pull request should have a meaningful subject line and body.
   - [ ] If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
   - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [ ] Run `mvn clean install -Psourcecheck` in your module with source check enabled to make sure basic checks pass and there are no checkstyle violations. A more thorough check will be performed on your pull request automatically.
   Below are the contribution guidelines:
   https://github.com/apache/camel/blob/main/CONTRIBUTING.md
   -->
   


-- 
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-unsubscribe@camel.apache.org

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



[GitHub] [camel] orpiske commented on a change in pull request #6583: CAMEL-17345: camel-jbang create maven project

Posted by GitBox <gi...@apache.org>.
orpiske commented on a change in pull request #6583:
URL: https://github.com/apache/camel/pull/6583#discussion_r777455008



##########
File path: dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CamelJBangMain.java
##########
@@ -29,6 +29,7 @@
     public static void run(String... args) {
         commandLine = new CommandLine(new CamelJBangMain())
                 .addSubcommand("run", new Run())
+                .addSubcommand("create-project", new CreateProject())

Review comment:
       I think it would be better to use two sub-commands so that we maintain the same pattern. I mean, it would be better to use `create project`. Look at how we do for the `init kamelet` feature.




-- 
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-unsubscribe@camel.apache.org

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



[GitHub] [camel] oscerd commented on a change in pull request #6583: CAMEL-17345: camel-jbang create maven project

Posted by GitBox <gi...@apache.org>.
oscerd commented on a change in pull request #6583:
URL: https://github.com/apache/camel/pull/6583#discussion_r773613822



##########
File path: dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CreateProject.java
##########
@@ -0,0 +1,100 @@
+package org.apache.camel.dsl.jbang.core.commands;

Review comment:
       Missing license

##########
File path: dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/generator/QuarkusGenerator.java
##########
@@ -0,0 +1,22 @@
+package org.apache.camel.dsl.jbang.core.generator;

Review comment:
       License

##########
File path: dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/generator/CamelJbangGenerator.java
##########
@@ -0,0 +1,10 @@
+package org.apache.camel.dsl.jbang.core.generator;

Review comment:
       License




-- 
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-unsubscribe@camel.apache.org

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



[GitHub] [camel] Croway commented on a change in pull request #6583: CAMEL-17345: camel-jbang create maven project

Posted by GitBox <gi...@apache.org>.
Croway commented on a change in pull request #6583:
URL: https://github.com/apache/camel/pull/6583#discussion_r777899190



##########
File path: dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CamelJBangMain.java
##########
@@ -29,6 +29,7 @@
     public static void run(String... args) {
         commandLine = new CommandLine(new CamelJBangMain())
                 .addSubcommand("run", new Run())
+                .addSubcommand("create-project", new CreateProject())

Review comment:
       Thanks for the review, I made the requested changes and the project can be created with
   ```
   jbang -Dcamel.jbang.version=3.15.0-SNAPSHOT CamelJBang@apache/camel create project TimerRoute.java test.yaml --quarkus-dependency=camel-quarkus-timer,camel-quarkus-log,camel-quarkus-yaml-dsl,camel-quarkus-http --name=TestProject
   ```
   help output from create command is
   ```
   ➜ jbang -Dcamel.jbang.version=3.15.0-SNAPSHOT CamelJBang@apache/camel create -h
   [jbang] Building jar...
   Usage: CamelJBang create [-h] [COMMAND]
   Creates Maven Project (use --help)
     -h, --help   Display the help and sub-commands
   Commands:
     project  Creates Camel-Quarkus project
     ```




-- 
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-unsubscribe@camel.apache.org

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



[GitHub] [camel] davsclaus commented on pull request #6583: CAMEL-17345: camel-jbang create maven project

Posted by GitBox <gi...@apache.org>.
davsclaus commented on pull request #6583:
URL: https://github.com/apache/camel/pull/6583#issuecomment-1005778534


   There is a merge conflict now, can you fix that so we can get this merged.
   
   


-- 
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-unsubscribe@camel.apache.org

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



[GitHub] [camel] Croway edited a comment on pull request #6583: CAMEL-17345: camel-jbang create maven project

Posted by GitBox <gi...@apache.org>.
Croway edited a comment on pull request #6583:
URL: https://github.com/apache/camel/pull/6583#issuecomment-999466994


   Hi @oscerd, @davsclaus , the generator can be used like this:
   ```
   jbang -Dcamel.jbang.version=3.15.0-SNAPSHOT CamelJBang@apache/camel create-project TimerRoute.java test.yaml --quarkus-dependency=camel-quarkus-timer,camel-quarkus-log,camel-quarkus-yaml-dsl,camel-quarkus-http --name=TestProject
   ```
   where
   TimerRoute.java
   ```
   package org.acme.timer.log;
   
   import org.apache.camel.builder.RouteBuilder;
   
   public class TimerRoute extends RouteBuilder {
   
       @Override
       public void configure() throws Exception {
           from("timer:foo?period=1000").log("Hello World");
       }
   }
   ```
   and test.yaml
   ```
   - from:
       uri: "timer:tick"
       parameters:
         period: "5000"
       steps:
       - to: "https://random-data-api.com/api/cannabis/random_cannabis"
       - to: "log:info?showStreams=true"
   ```
   the resulting project is:
   ![image](https://user-images.githubusercontent.com/34543311/147078773-3826d5f0-fedb-483d-b7ff-02a52c7cd742.png)
   
   with the given routes and `--quarkus-dependency=...` it is working as expected.
   
   wdyt?


-- 
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-unsubscribe@camel.apache.org

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



[GitHub] [camel] davsclaus commented on pull request #6583: CAMEL-17345: camel-jbang create maven project

Posted by GitBox <gi...@apache.org>.
davsclaus commented on pull request #6583:
URL: https://github.com/apache/camel/pull/6583#issuecomment-999605544


   > > we should make the dependency resolution smarter...
   > 
   > I see, I'm probably missing something here, but camel-jbang by default already import some dependencies, like `camel-platform-http-vertx`, but if an user wants to use kafka for example, kafka jar should be added to classpath via `jbang --cp /path/to/camel-kafka.jar ...`, in order to work with quarkus, all the default dependencies + classpath ones should be parsed and "converted" to the camel-quarkus respective ones?
   
   Yes but lets tackle this in another ticket/PR.
   
   The idea with jbang run / create-project is that a entry level users to Camel can start with this (and via karavan) and then quickly prototype an integration, and then after a while, take it to the next level and migrate it as a java based camel quarkus project, where we setup all the boilerplate project files for the user.
   
   Then the user can continue to load this in the java editor and continue development with more power.
   


-- 
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-unsubscribe@camel.apache.org

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



[GitHub] [camel] davsclaus commented on pull request #6583: CAMEL-17345: camel-jbang create maven project

Posted by GitBox <gi...@apache.org>.
davsclaus commented on pull request #6583:
URL: https://github.com/apache/camel/pull/6583#issuecomment-1005414774


   @Croway before we merge, then I wonder if you would add some docs about this new command to the camel-jbang.adoc file (see in docs folder)


-- 
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-unsubscribe@camel.apache.org

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



[GitHub] [camel] Croway commented on pull request #6583: CAMEL-17345: camel-jbang create maven project

Posted by GitBox <gi...@apache.org>.
Croway commented on pull request #6583:
URL: https://github.com/apache/camel/pull/6583#issuecomment-999466994


   Hi @oscerd, @davsclaus , the generator can be used like this:
   ```
   jbang -Dcamel.jbang.version=3.15.0-SNAPSHOT /home/federico/Work/croway/camel/dsl/camel-jbang/camel-jbang-main/src/main/jbang/main/CamelJBang.java create-project TimerRoute.java test.yaml --quarkus-dependency=camel-quarkus-timer,camel-quarkus-log,camel-quarkus-yaml-dsl,camel-quarkus-http --name=TestProject
   ```
   where
   TimerRoute.java
   ```
   package org.acme.timer.log;
   
   import org.apache.camel.builder.RouteBuilder;
   
   public class TimerRoute extends RouteBuilder {
   
       @Override
       public void configure() throws Exception {
           from("timer:foo?period=1000").log("Hello World");
       }
   }
   ```
   and test.yaml
   ```
   - from:
       uri: "timer:tick"
       parameters:
         period: "5000"
       steps:
       - to: "https://random-data-api.com/api/cannabis/random_cannabis"
       - to: "log:info?showStreams=true"
   ```
   the resulting project is:
   ![image](https://user-images.githubusercontent.com/34543311/147078773-3826d5f0-fedb-483d-b7ff-02a52c7cd742.png)
   
   with the given routes and `--quarkus-dependency=...` it is working as expected.
   
   wdyt?


-- 
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-unsubscribe@camel.apache.org

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



[GitHub] [camel] davsclaus commented on pull request #6583: CAMEL-17345: camel-jbang create maven project

Posted by GitBox <gi...@apache.org>.
davsclaus commented on pull request #6583:
URL: https://github.com/apache/camel/pull/6583#issuecomment-999553550


   Yeah that is a good first attempt, we should make the dependency resolution smarter, so we can maybe run camel once in a special startup mode, where it use the existing auto download JAR stuff to find out which dependencies are needed for quarkus. Then we need a way of mapping to the quarkus extension GAV.
   
   We could also have a goal for that dependency resolution thingy, ala maven dependency:tree, then we could maybe write this to a special file, that the create-project can read as input to enrich the dependency list for quarkus


-- 
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-unsubscribe@camel.apache.org

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



[GitHub] [camel] Croway commented on pull request #6583: CAMEL-17345: camel-jbang create maven project

Posted by GitBox <gi...@apache.org>.
Croway commented on pull request #6583:
URL: https://github.com/apache/camel/pull/6583#issuecomment-1005511261


   > @Croway before we merge, then I wonder if you would add some docs about this new command to the camel-jbang.adoc file (see in docs folder)
   
   docs added, I'd like to refine it by adding folder structure examples, is it possible in adoc? seems like that blocks like [tree] or [directory] are not supported


-- 
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-unsubscribe@camel.apache.org

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



[GitHub] [camel] vkasala commented on pull request #6583: CAMEL-17345: camel-jbang create maven project

Posted by GitBox <gi...@apache.org>.
vkasala commented on pull request #6583:
URL: https://github.com/apache/camel/pull/6583#issuecomment-1007224503


   @ppalaga and @jamesnetherton FYI


-- 
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-unsubscribe@camel.apache.org

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



[GitHub] [camel] davsclaus commented on a change in pull request #6583: CAMEL-17345: camel-jbang create maven project

Posted by GitBox <gi...@apache.org>.
davsclaus commented on a change in pull request #6583:
URL: https://github.com/apache/camel/pull/6583#discussion_r773865999



##########
File path: dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CreateProject.java
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dsl.jbang.core.commands;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.Callable;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import freemarker.template.Configuration;
+import freemarker.template.Template;
+import freemarker.template.TemplateException;
+import freemarker.template.TemplateExceptionHandler;
+import org.apache.camel.dsl.jbang.core.generator.CamelJbangGenerator;
+import org.apache.camel.dsl.jbang.core.generator.QuarkusGenerator;
+import picocli.CommandLine;
+
+@CommandLine.Command(name = "create-project", description = "Creates Camel-Quarkus project")
+public class CreateProject implements Callable<Integer> {
+
+    private static final String PACKAGE_REGEX = "package\\s+([a-zA_Z_][\\.\\w]*);";
+    private static final Pattern PACKAGE_PATTERN = Pattern.compile(PACKAGE_REGEX);
+    //CHECKSTYLE:ON
+    @CommandLine.Parameters(description = "The Camel file(s) to run", arity = "1")

Review comment:
       to run -> to include in the created project

##########
File path: dsl/camel-jbang/camel-jbang-core/src/main/resources/generator/quarkus-pom.ftl
##########
@@ -0,0 +1,270 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--

Review comment:
       We should not include ASF license in the generated project code, as end users can use this for their own projects that is not ASF licensed

##########
File path: dsl/camel-jbang/camel-jbang-core/src/main/resources/generator/quarkus-pom.ftl
##########
@@ -0,0 +1,270 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+         http://www.apache.org/licenses/LICENSE-2.0
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<artifactId>${name}</artifactId>
+	<groupId>org.apache.camel.jbang</groupId>

Review comment:
       I think you should be able to configure the groupId also




-- 
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-unsubscribe@camel.apache.org

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



[GitHub] [camel] Croway commented on pull request #6583: CAMEL-17345: camel-jbang create maven project

Posted by GitBox <gi...@apache.org>.
Croway commented on pull request #6583:
URL: https://github.com/apache/camel/pull/6583#issuecomment-999609611


   Ok, maybe it is worth investigating `jbang export portable CamelJBang@apache/camel`, a jar is generated with the following content
   ![image](https://user-images.githubusercontent.com/34543311/147106413-0137cd2c-d515-4064-b1fe-bd8b2c59672b.png)
   dependency list is quite long, though additional --cp are not added


-- 
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-unsubscribe@camel.apache.org

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



[GitHub] [camel] davsclaus merged pull request #6583: CAMEL-17345: camel-jbang create maven project

Posted by GitBox <gi...@apache.org>.
davsclaus merged pull request #6583:
URL: https://github.com/apache/camel/pull/6583


   


-- 
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-unsubscribe@camel.apache.org

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



[GitHub] [camel] Croway commented on pull request #6583: CAMEL-17345: camel-jbang create maven project

Posted by GitBox <gi...@apache.org>.
Croway commented on pull request #6583:
URL: https://github.com/apache/camel/pull/6583#issuecomment-999600935


   > we should make the dependency resolution smarter...
   
   I see, I'm probably missing something here, but camel-jbang by default already import some dependencies, like `camel-platform-http-vertx`, but if an user wants to use kafka for example, kafka jar should be added to classpath via `jbang --cp /path/to/camel-kafka.jar ...`, in order to work with quarkus, all the default dependencies + classpath ones should be parsed and "converted" to the camel-quarkus respective ones?


-- 
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-unsubscribe@camel.apache.org

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



[GitHub] [camel] davsclaus commented on pull request #6583: CAMEL-17345: camel-jbang create maven project

Posted by GitBox <gi...@apache.org>.
davsclaus commented on pull request #6583:
URL: https://github.com/apache/camel/pull/6583#issuecomment-1000348049


   > Ok, maybe it is worth investigating `jbang export portable CamelJBang@apache/camel`, a jar is generated with the following content ![image](https://user-images.githubusercontent.com/34543311/147106413-0137cd2c-d515-4064-b1fe-bd8b2c59672b.png) dependency list is quite long, though additional --cp are not added
   
   Hmm maybe - however the idea is to move away from jbang to a pure camel-quarkus project. And as such the dependency should be camel-quarkus extensions only. And for that I would think that its better we take this in our own hand - also the dependency resolution in camel-jbang/camel-k is different where we auto discover and auto download, that is something we need to find out as well for this so users dont have to add a lot of manual JARs via -cp or something. What I talked about earlier. But this is a 2nd priority - being able to generate the pom.xml and move the source files into right folders is 1st task.


-- 
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-unsubscribe@camel.apache.org

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



[GitHub] [camel] Croway commented on pull request #6583: CAMEL-17345: camel-jbang create maven project

Posted by GitBox <gi...@apache.org>.
Croway commented on pull request #6583:
URL: https://github.com/apache/camel/pull/6583#issuecomment-999395865


   > Lgtm to me, just missing license
   
   Thanks for early review @oscerd , I opened the PR in draft to check if pipeline will complain about it (and it does :D)


-- 
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-unsubscribe@camel.apache.org

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



[GitHub] [camel] vkasala commented on pull request #6583: CAMEL-17345: camel-jbang create maven project

Posted by GitBox <gi...@apache.org>.
vkasala commented on pull request #6583:
URL: https://github.com/apache/camel/pull/6583#issuecomment-1007224503


   @ppalaga and @jamesnetherton FYI


-- 
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-unsubscribe@camel.apache.org

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



[GitHub] [camel] davsclaus commented on a change in pull request #6583: CAMEL-17345: camel-jbang create maven project

Posted by GitBox <gi...@apache.org>.
davsclaus commented on a change in pull request #6583:
URL: https://github.com/apache/camel/pull/6583#discussion_r777909203



##########
File path: dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Project.java
##########
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dsl.jbang.core.commands;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.Callable;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import freemarker.template.Configuration;
+import freemarker.template.Template;
+import freemarker.template.TemplateException;
+import freemarker.template.TemplateExceptionHandler;
+import org.apache.camel.dsl.jbang.core.generator.CamelJbangGenerator;
+import org.apache.camel.dsl.jbang.core.generator.QuarkusGenerator;
+import picocli.CommandLine;
+
+@CommandLine.Command(name = "create-project", description = "Creates Camel-Quarkus project")
+public class Project implements Callable<Integer> {
+
+    private static final String PACKAGE_REGEX = "package\\s+([a-zA_Z_][\\.\\w]*);";
+    private static final Pattern PACKAGE_PATTERN = Pattern.compile(PACKAGE_REGEX);
+    @CommandLine.Parameters(description = "The Camel file(s) to include in the created project", arity = "1")
+    private String[] files;
+    @CommandLine.Option(names = { "-h", "--help" }, usageHelp = true, description = "Display the help and sub-commands")
+    private boolean helpRequested;
+    @CommandLine.Option(names = { "-n", "--name" }, description = "The name of the Camel application",
+                        defaultValue = "CamelJBang")
+    private String name;
+    @CommandLine.Option(names = { "-g", "--group-id" }, description = "The group ID of the maven project",
+                        defaultValue = "org.apache.camel.jbang")
+    private String groupId;
+    @CommandLine.Option(names = { "-d", "--directory" }, description = "Directory where the project will be created",
+                        defaultValue = ".")
+    private String baseDirectory;
+    @CommandLine.Option(names = "--quarkus-dependency", description = "Comma separated list of camel-quarkus dependencies",
+                        defaultValue = "camel-quarkus-timer,camel-quarkus-log,camel-quarkus-yaml-dsl,camel-quarkus-kamelet,org.apache.camel.kamelets:camel-kamelets-catalog:0.5.0")

Review comment:
       We upgraded to kamelet 0.6.0

##########
File path: dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Project.java
##########
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dsl.jbang.core.commands;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.Callable;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import freemarker.template.Configuration;
+import freemarker.template.Template;
+import freemarker.template.TemplateException;
+import freemarker.template.TemplateExceptionHandler;
+import org.apache.camel.dsl.jbang.core.generator.CamelJbangGenerator;
+import org.apache.camel.dsl.jbang.core.generator.QuarkusGenerator;
+import picocli.CommandLine;
+
+@CommandLine.Command(name = "create-project", description = "Creates Camel-Quarkus project")
+public class Project implements Callable<Integer> {
+
+    private static final String PACKAGE_REGEX = "package\\s+([a-zA_Z_][\\.\\w]*);";
+    private static final Pattern PACKAGE_PATTERN = Pattern.compile(PACKAGE_REGEX);
+    @CommandLine.Parameters(description = "The Camel file(s) to include in the created project", arity = "1")
+    private String[] files;
+    @CommandLine.Option(names = { "-h", "--help" }, usageHelp = true, description = "Display the help and sub-commands")
+    private boolean helpRequested;
+    @CommandLine.Option(names = { "-n", "--name" }, description = "The name of the Camel application",
+                        defaultValue = "CamelJBang")
+    private String name;
+    @CommandLine.Option(names = { "-g", "--group-id" }, description = "The group ID of the maven project",
+                        defaultValue = "org.apache.camel.jbang")
+    private String groupId;
+    @CommandLine.Option(names = { "-d", "--directory" }, description = "Directory where the project will be created",
+                        defaultValue = ".")
+    private String baseDirectory;
+    @CommandLine.Option(names = "--quarkus-dependency", description = "Comma separated list of camel-quarkus dependencies",
+                        defaultValue = "camel-quarkus-timer,camel-quarkus-log,camel-quarkus-yaml-dsl,camel-quarkus-kamelet,org.apache.camel.kamelets:camel-kamelets-catalog:0.5.0")
+    private String quarkusDependencies;
+    @CommandLine.Option(names = "--quarkus-bom-version", description = "Override quarkus bom version in pom.xml",
+                        defaultValue = "2.5.0.Final")

Review comment:
       Use 2.6.0.Final




-- 
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-unsubscribe@camel.apache.org

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