This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push: new bfecd55 CAMEL-17345: camel-jbang create maven project (#6583) bfecd55 is described below commit bfecd551ae19939ef3c945a037f7abca71231619 Author: Federico Mariani <34543311+cro...@users.noreply.github.com> AuthorDate: Wed Jan 5 19:50:49 2022 +0100 CAMEL-17345: camel-jbang create maven project (#6583) --- .../modules/ROOT/pages/camel-jbang.adoc | 53 +++++ .../dsl/jbang/core/commands/CamelJBangMain.java | 4 +- .../camel/dsl/jbang/core/commands/Create.java | 38 +++ .../camel/dsl/jbang/core/commands/Project.java | 160 +++++++++++++ .../jbang/core/generator/CamelJbangGenerator.java | 33 +++ .../dsl/jbang/core/generator/PomDependency.java | 74 ++++++ .../dsl/jbang/core/generator/PomProperty.java | 43 ++++ .../dsl/jbang/core/generator/QuarkusGenerator.java | 67 ++++++ .../src/main/resources/generator/quarkus-pom.ftl | 259 +++++++++++++++++++++ dsl/camel-kamelet-main/pom.xml | 4 + 10 files changed, 734 insertions(+), 1 deletion(-) diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc index 44b6255..9e474e8 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc @@ -316,3 +316,56 @@ You can also generate bindings that can be run by CamelJBang or Camel Core, but ---- camel init binding --destination /path/to/destination/directory/ --kamelet sftp-source --project core ---- + +=== Create Project + +The create project command can be used to generate a maven project. After running the integration with the `run` command `create project` will generate a maven quarkus project with some required dependencies that can be used as a starting point for complex integrations. + +To execute this feature run: + +[source,bash] +---- +jbang camel@apache/camel create project integration.java integration.yaml integration.xml +---- + +this command generates a folder named CamelJBang that contains the quarkus project, in order to execute it the following command can be run: + +[source,bash] +---- +cd CamelJBang +mvn compile quarkus:dev +---- + +The table below lists all the command line options configurable on the `create project` command: + +|=== +|Option |Description + +|name +|The name of the Camel application (artifactId and folder) + +|group-id +|The group ID of the maven project + +|directory +|Directory where the project will be created + +|quarkus-dependency +|Comma separated list of camel-quarkus dependencies + +|quarkus-bom-version +|Override quarkus bom version in pom.xml + +|=== + +==== Examples + +[source,bash] +---- +jbang camel@apache/camel create project TimerRoute.java --quarkusDependencies=camel-quarkus-timer,camel-quarkus-log,camel-quarkus-yaml-dsl,camel-quarkus-http --name=TimerRouteProject +---- + +[source,bash] +---- +jbang camel@apache/camel create project KafkaRoute.java --quarkusDependencies=camel-quarkus-kafka,camel-quarkus-log --name=KafkaRouteProject +---- diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CamelJBangMain.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CamelJBangMain.java index 0411236..760eb60 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CamelJBangMain.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CamelJBangMain.java @@ -36,7 +36,9 @@ public class CamelJBangMain implements Callable<Integer> { .addSubcommand("others", new SearchOthers())) .addSubcommand("init", new CommandLine(new Init()) .addSubcommand("kamelet", new InitKamelet()) - .addSubcommand("binding", new InitBinding())); + .addSubcommand("binding", new InitBinding())) + .addSubcommand("create", new CommandLine(new Create()) + .addSubcommand("project", new Project())); int exitCode = commandLine.execute(args); System.exit(exitCode); diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Create.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Create.java new file mode 100644 index 0000000..83f4757 --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Create.java @@ -0,0 +1,38 @@ +/* + * 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.util.concurrent.Callable; + +import picocli.CommandLine; +import picocli.CommandLine.Command; +import picocli.CommandLine.Option; + +@Command(name = "create", description = "Creates Maven Project (use --help)") +class Create implements Callable<Integer> { + //CHECKSTYLE:OFF + @Option(names = { "-h", "--help" }, usageHelp = true, description = "Display the help and sub-commands") + private boolean helpRequested = false; + //CHECKSTYLE:ON + + @Override + public Integer call() throws Exception { + new CommandLine(this).execute("--help"); + + return 0; + } +} diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Project.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Project.java new file mode 100644 index 0000000..db893b4 --- /dev/null +++ b/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.6.0") + private String quarkusDependencies; + @CommandLine.Option(names = "--quarkus-bom-version", description = "Override quarkus bom version in pom.xml", + defaultValue = "2.6.0.Final") + private String quarkusBomVersion; + + private CamelJbangGenerator generator; + private Path resourcesFolder = Paths.get("src", "main", "resources"); + private Path sourcesFolder = Paths.get("src", "main", "java"); + private Path routesFolder = resourcesFolder.resolve("routes"); + + @Override + public Integer call() throws Exception { + generator = new QuarkusGenerator(Arrays.asList(quarkusDependencies.split(",")), quarkusBomVersion); + + File baseDir = new File(baseDirectory); + createDirectory(baseDir); + + Path projectPath = Paths.get(baseDirectory, name); + File projectDir = projectPath.toFile(); + createDirectory(projectDir); + + System.out.println(name + " project will be generated in " + projectDir.getAbsolutePath()); + + createProjectStructure(projectPath); + + for (String file : files) { + if (!file.endsWith(".java")) { + Files.copy(Paths.get(file), projectPath.resolve(routesFolder).resolve(Paths.get(file).getFileName())); + } else { + String packageName = Files.lines(Paths.get(file)) + .map(fileContent -> getPackage(fileContent)) + .filter(Objects::nonNull) + .findFirst() + .orElse(""); + try { + Path packageDirectory + = projectPath.resolve(sourcesFolder).resolve(packageName.replace(".", File.separator)); + if (!packageDirectory.toFile().exists()) { + createDirectory(packageDirectory.toFile()); + } + + Files.copy(Paths.get(file), + packageDirectory.resolve(Paths.get(file).getFileName())); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } + + return 0; + } + + private void createProjectStructure(Path projectPath) throws IOException { + Path javaSourcesPath = projectPath.resolve(sourcesFolder); + createDirectory(javaSourcesPath.toFile()); + Path resourcesPath = projectPath.resolve(resourcesFolder); + createDirectory(resourcesPath.toFile()); + Path routes = projectPath.resolve(routesFolder); + createDirectory(routes.toFile()); + + // Create application.properties + Files.write(projectPath.resolve(generator.getPropertyFileLocation()), + generator.getPropertyFileContent(name).getBytes()); + + // Create pom.xml + Map root = new HashMap<String, Object>(); + root.put("name", name); + root.put("groupId", groupId); + root.put("pomProperties", generator.getPomProperties()); + root.put("pomDependencies", generator.getPomDependencies()); + + Configuration cfg = new Configuration(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS); + cfg.setClassForTemplateLoading(this.getClass(), "/generator"); + cfg.setTemplateExceptionHandler(TemplateExceptionHandler.IGNORE_HANDLER); + + Template template = cfg.getTemplate(generator.getTemplate()); + + try (Writer fileWriter = new FileWriter(projectPath.resolve("pom.xml").toFile())) { + template.process(root, fileWriter); + } catch (TemplateException e) { + throw new RuntimeException(e); + } + } + + private String getPackage(String fileContent) { + Matcher matcher = PACKAGE_PATTERN.matcher(fileContent); + if (matcher.find()) { + return matcher.group(1); + } + + return null; + } + + private void createDirectory(File directory) { + if (!directory.exists()) { + directory.mkdirs(); + } + } +} diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/generator/CamelJbangGenerator.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/generator/CamelJbangGenerator.java new file mode 100644 index 0000000..a7709e4 --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/generator/CamelJbangGenerator.java @@ -0,0 +1,33 @@ +/* + * 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.generator; + +import java.nio.file.Path; +import java.util.List; + +public interface CamelJbangGenerator { + + Path getPropertyFileLocation(); + + String getPropertyFileContent(String name); + + List<PomProperty> getPomProperties(); + + String getTemplate(); + + List<PomDependency> getPomDependencies(); +} diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/generator/PomDependency.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/generator/PomDependency.java new file mode 100644 index 0000000..33dcf9f --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/generator/PomDependency.java @@ -0,0 +1,74 @@ +/* + * 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.generator; + +public class PomDependency { + private String groupId; + private String artifactId; + private String version; + + public PomDependency(String artifactId) { + this.artifactId = artifactId; + this.groupId = "org.apache.camel.quarkus"; + } + + public PomDependency(String groupId, String artifactId) { + this.groupId = groupId; + this.artifactId = artifactId; + } + + public PomDependency(String groupId, String artifactId, String version) { + this.groupId = groupId; + this.artifactId = artifactId; + this.version = version; + } + + public static PomDependency of(String dependency) { + String[] gav = dependency.split(":"); + if (gav.length == 3) { + return new PomDependency(gav[0], gav[1], gav[2]); + } else if (gav.length == 2) { + return new PomDependency(gav[0], gav[1]); + } else { + return new PomDependency(dependency); + } + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getGroupId() { + return groupId; + } + + public void setGroupId(String groupId) { + this.groupId = groupId; + } + + public String getArtifactId() { + return artifactId; + } + + public void setArtifactId(String artifactId) { + this.artifactId = artifactId; + } +} diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/generator/PomProperty.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/generator/PomProperty.java new file mode 100644 index 0000000..295549b --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/generator/PomProperty.java @@ -0,0 +1,43 @@ +/* + * 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.generator; + +public class PomProperty { + private String key; + private String value; + + public PomProperty(String key, String value) { + this.key = key; + this.value = value; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/generator/QuarkusGenerator.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/generator/QuarkusGenerator.java new file mode 100644 index 0000000..8bbebc4 --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/generator/QuarkusGenerator.java @@ -0,0 +1,67 @@ +/* + * 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.generator; + +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +public class QuarkusGenerator implements CamelJbangGenerator { + + private List<String> dependencies; + private String bomVersion; + + public QuarkusGenerator(List<String> dependencies, String bomVersion) { + this.dependencies = dependencies; + this.bomVersion = bomVersion; + } + + @Override + public Path getPropertyFileLocation() { + return Paths.get("src", "main", "resources", "application.properties"); + } + + @Override + public String getPropertyFileContent(String name) { + StringBuilder sb = new StringBuilder(); + sb.append("quarkus.banner.enabled = false\n"); + sb.append("quarkus.log.file.enable = true\n"); + sb.append("camel.context.name = ").append(name).append("\n"); + sb.append("camel.main.routes-include-pattern= classpath:routes/*"); + + return sb.toString(); + } + + @Override + public List<PomProperty> getPomProperties() { + return Arrays.asList( + new PomProperty("quarkus.platform.version", bomVersion)); + } + + public String getTemplate() { + return "quarkus-pom.ftl"; + } + + @Override + public List<PomDependency> getPomDependencies() { + return dependencies.stream() + .map(PomDependency::of) + .collect(Collectors.toList()); + } +} diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/resources/generator/quarkus-pom.ftl b/dsl/camel-jbang/camel-jbang-core/src/main/resources/generator/quarkus-pom.ftl new file mode 100644 index 0000000..c0a804e --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-core/src/main/resources/generator/quarkus-pom.ftl @@ -0,0 +1,259 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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>${groupId}</groupId> + <version>1.0.0-SNAPSHOT</version> + + <name>${name}</name> + + <properties> + <#list pomProperties as property> + <${property.key}>${property.value}</${property.key}> + </#list> + <camel-quarkus.platform.version>${r"${quarkus.platform.version}"}</camel-quarkus.platform.version> + + <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id> + <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id> + <camel-quarkus.platform.group-id>${r"${quarkus.platform.group-id}"}</camel-quarkus.platform.group-id> + <camel-quarkus.platform.artifact-id>quarkus-camel-bom</camel-quarkus.platform.artifact-id> + + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + <maven.compiler.target>11</maven.compiler.target> + <maven.compiler.source>11</maven.compiler.source> + <maven.compiler.testTarget>${r"${maven.compiler.target}"}</maven.compiler.testTarget> + <maven.compiler.testSource>${r"${maven.compiler.source}"}</maven.compiler.testSource> + + <formatter-maven-plugin.version>2.11.0</formatter-maven-plugin.version> + <impsort-maven-plugin.version>1.3.2</impsort-maven-plugin.version> + <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version> + <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version> + <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version> + <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version> + <mycila-license.version>3.0</mycila-license.version> + </properties> + + <dependencyManagement> + <dependencies> + <!-- Import BOM --> + <dependency> + <groupId>${r"${quarkus.platform.group-id}"}</groupId> + <artifactId>${r"${quarkus.platform.artifact-id}"}</artifactId> + <version>${r"${quarkus.platform.version}"}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + <dependency> + <groupId>${r"${camel-quarkus.platform.group-id}"}</groupId> + <artifactId>${r"${camel-quarkus.platform.artifact-id}"}</artifactId> + <version>${r"${camel-quarkus.platform.version}"}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <#list pomDependencies as dependency> + <dependency> + <groupId>${dependency.groupId}</groupId> + <artifactId>${dependency.artifactId}</artifactId> + <#if dependency.version??> + <version>${dependency.version}</version> + </#if> + </dependency> + </#list> + + <!-- Test --> + <dependency> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-junit5</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.awaitility</groupId> + <artifactId>awaitility</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <pluginManagement> + <plugins> + + <plugin> + <groupId>net.revelc.code.formatter</groupId> + <artifactId>formatter-maven-plugin</artifactId> + <version>${r"${formatter-maven-plugin.version}"}</version> + </plugin> + + <plugin> + <groupId>net.revelc.code</groupId> + <artifactId>impsort-maven-plugin</artifactId> + <version>${r"${impsort-maven-plugin.version}"}</version> + <configuration> + <groups>java.,javax.,org.w3c.,org.xml.,junit.</groups> + <removeUnused>true</removeUnused> + <staticAfter>true</staticAfter> + <staticGroups>java.,javax.,org.w3c.,org.xml.,junit.</staticGroups> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>${r"${maven-compiler-plugin.version}"}</version> + <configuration> + <showDeprecation>true</showDeprecation> + <showWarnings>true</showWarnings> + <compilerArgs> + <arg>-Xlint:unchecked</arg> + </compilerArgs> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>${r"${maven-surefire-plugin.version}"}</version> + <configuration> + <failIfNoTests>false</failIfNoTests> + <systemProperties> + <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> + </systemProperties> + </configuration> + </plugin> + + <plugin> + <groupId>${r"${quarkus.platform.group-id}"}</groupId> + <artifactId>quarkus-maven-plugin</artifactId> + <version>${r"${quarkus.platform.version}"}</version> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <version>${r"${maven-surefire-plugin.version}"}</version> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>${r"${maven-jar-plugin.version}"}</version> + </plugin> + + <plugin> + <groupId>com.mycila</groupId> + <artifactId>license-maven-plugin</artifactId> + <version>${r"${mycila-license.version}"}</version> + <configuration> + <failIfUnknown>true</failIfUnknown> + <header>${r"${maven.multiModuleProjectDirectory}"}/header.txt</header> + <excludes> + <exclude>**/*.adoc</exclude> + <exclude>**/*.txt</exclude> + <exclude>**/LICENSE.txt</exclude> + <exclude>**/LICENSE</exclude> + <exclude>**/NOTICE.txt</exclude> + <exclude>**/NOTICE</exclude> + <exclude>**/README</exclude> + <exclude>**/pom.xml.versionsBackup</exclude> + </excludes> + <mapping> + <java>SLASHSTAR_STYLE</java> + <properties>CAMEL_PROPERTIES_STYLE</properties> + <kt>SLASHSTAR_STYLE</kt> + </mapping> + <headerDefinitions> + <headerDefinition>${r"${maven.multiModuleProjectDirectory}"}/license-properties-headerdefinition.xml</headerDefinition> + </headerDefinitions> + </configuration> + </plugin> + </plugins> + </pluginManagement> + + <plugins> + <plugin> + <groupId>${r"${quarkus.platform.group-id}"}</groupId> + <artifactId>quarkus-maven-plugin</artifactId> + <executions> + <execution> + <id>build</id> + <goals> + <goal>build</goal> + </goals> + </execution> + </executions> + <configuration> + <workingDir>${r"${project.basedir}"}</workingDir> + </configuration> + </plugin> + + <plugin> + <groupId>net.revelc.code.formatter</groupId> + <artifactId>formatter-maven-plugin</artifactId> + <executions> + <execution> + <id>format</id> + <goals> + <goal>format</goal> + </goals> + <phase>process-sources</phase> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>net.revelc.code</groupId> + <artifactId>impsort-maven-plugin</artifactId> + <executions> + <execution> + <id>sort-imports</id> + <goals> + <goal>sort</goal> + </goals> + <phase>process-sources</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>native</id> + <activation> + <property> + <name>native</name> + </property> + </activation> + <properties> + <quarkus.package.type>native</quarkus.package.type> + </properties> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>integration-test</goal> + <goal>verify</goal> + </goals> + <configuration> + <systemPropertyVariables> + <quarkus.package.type>${r"${quarkus.package.type}"}</quarkus.package.type> + </systemPropertyVariables> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> + +</project> \ No newline at end of file diff --git a/dsl/camel-kamelet-main/pom.xml b/dsl/camel-kamelet-main/pom.xml index fe412cc..41b0f45 100644 --- a/dsl/camel-kamelet-main/pom.xml +++ b/dsl/camel-kamelet-main/pom.xml @@ -64,6 +64,10 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-freemarker</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-grape</artifactId> </dependency> <dependency>