You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2020/05/20 11:52:41 UTC
[camel-k-runtime] 03/03: cron: create a quarkus extension
This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git
commit 5eb22f321f1e4bb1a6af017f6b921014925a6693
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Wed May 20 12:23:56 2020 +0200
cron: create a quarkus extension
---
.github/workflows/pr-build.yml | 1 +
.../quarkus/deployment/DeploymentProcessor.java | 19 ++-
.../it/src/main/resources/application.properties | 1 +
.../it/src/test/resources/application.properties | 21 ---
.../{ => camel-k-quarkus-cron/deployment}/pom.xml | 46 +++---
.../camel/k/quarkus/cron/deployment/Feature.java | 29 ++++
camel-k-quarkus/camel-k-quarkus-cron/it/pom.xml | 159 +++++++++++++++++++++
.../k/quarkus/cron/deployment/Application.java | 46 ++++++
.../it/src/main/resources/application.properties | 3 +-
.../k/quarkus/cron/deployment/ExtensionIT.java | 23 +++
.../k/quarkus/cron/deployment/ExtensionTest.java | 38 +++++
camel-k-quarkus/{ => camel-k-quarkus-cron}/pom.xml | 30 +---
.../camel-k-quarkus-cron/runtime/pom.xml | 86 +++++++++++
.../it/src/main/resources/application.properties | 1 +
.../it/src/test/resources/application.properties | 21 ---
.../it/src/main/resources/application.properties | 1 +
.../it/src/test/resources/application.properties | 21 ---
.../it/src/main/resources/application.properties | 1 +
.../it/src/test/resources/application.properties | 21 ---
camel-k-quarkus/pom.xml | 1 +
camel-k-runtime-bom/pom.xml | 10 ++
.../camel/k/cron/CronSourceLoaderInterceptor.java | 4 +-
pom.xml | 26 ++++
.../src/it/generate-catalog-main/verify.groovy | 2 +
.../src/it/generate-catalog-quarkus/verify.groovy | 2 +
.../camel/k/tooling/maven/GenerateCatalogMojo.java | 2 +-
26 files changed, 480 insertions(+), 135 deletions(-)
diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml
index 5e3b8ff..31262d8 100644
--- a/.github/workflows/pr-build.yml
+++ b/.github/workflows/pr-build.yml
@@ -61,6 +61,7 @@ jobs:
matrix:
native-image-project:
- :camel-k-quarkus-core-it
+ - :camel-k-quarkus-cron-it
- :camel-k-quarkus-loader-xml-it
- :camel-k-quarkus-loader-yaml-it
- :camel-k-runtime-example-quarkus-xml
diff --git a/camel-k-quarkus/camel-k-quarkus-core/deployment/src/main/java/org/apache/camel/k/core/quarkus/deployment/DeploymentProcessor.java b/camel-k-quarkus/camel-k-quarkus-core/deployment/src/main/java/org/apache/camel/k/core/quarkus/deployment/DeploymentProcessor.java
index c097c66..167daca 100644
--- a/camel-k-quarkus/camel-k-quarkus-core/deployment/src/main/java/org/apache/camel/k/core/quarkus/deployment/DeploymentProcessor.java
+++ b/camel-k-quarkus/camel-k-quarkus-core/deployment/src/main/java/org/apache/camel/k/core/quarkus/deployment/DeploymentProcessor.java
@@ -40,12 +40,19 @@ import static org.apache.camel.k.core.quarkus.deployment.DeploymentSupport.getAl
public class DeploymentProcessor {
@BuildStep
- CamelServicePatternBuildItem servicePatterns() {
- return new CamelServicePatternBuildItem(
- CamelServicePatternBuildItem.CamelServiceDestination.REGISTRY,
- true,
- Constants.SOURCE_LOADER_RESOURCE_PATH + "/*",
- Constants.CONTEXT_CUSTOMIZER_RESOURCE_PATH + "/*");
+ List<CamelServicePatternBuildItem> servicePatterns() {
+ return List.of(
+ new CamelServicePatternBuildItem(
+ CamelServicePatternBuildItem.CamelServiceDestination.REGISTRY,
+ true,
+ Constants.SOURCE_LOADER_RESOURCE_PATH + "/*",
+ Constants.CONTEXT_CUSTOMIZER_RESOURCE_PATH + "/*"),
+ new CamelServicePatternBuildItem(
+ CamelServicePatternBuildItem.CamelServiceDestination.DISCOVERY,
+ true,
+ Constants.SOURCE_LOADER_INTERCEPTOR_RESOURCE_PATH + "/*")
+ );
+
}
@BuildStep
diff --git a/camel-k-quarkus/camel-k-quarkus-core/it/src/main/resources/application.properties b/camel-k-quarkus/camel-k-quarkus-core/it/src/main/resources/application.properties
index 876ce6b..d43bc0b 100644
--- a/camel-k-quarkus/camel-k-quarkus-core/it/src/main/resources/application.properties
+++ b/camel-k-quarkus/camel-k-quarkus-core/it/src/main/resources/application.properties
@@ -19,6 +19,7 @@
#
quarkus.log.file.enable = false
quarkus.log.console.enable = false
+quarkus.banner.enabled = false
#
# Camel
diff --git a/camel-k-quarkus/camel-k-quarkus-core/it/src/test/resources/application.properties b/camel-k-quarkus/camel-k-quarkus-core/it/src/test/resources/application.properties
deleted file mode 100644
index a35368c..0000000
--- a/camel-k-quarkus/camel-k-quarkus-core/it/src/test/resources/application.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-## ---------------------------------------------------------------------------
-## 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.
-## ---------------------------------------------------------------------------
-#
-# Quarkus
-#
-quarkus.log.file.enable = false
-quarkus.log.console.enable = false
\ No newline at end of file
diff --git a/camel-k-quarkus/pom.xml b/camel-k-quarkus/camel-k-quarkus-cron/deployment/pom.xml
similarity index 56%
copy from camel-k-quarkus/pom.xml
copy to camel-k-quarkus/camel-k-quarkus-cron/deployment/pom.xml
index 5643159..f8d594f 100644
--- a/camel-k-quarkus/pom.xml
+++ b/camel-k-quarkus/camel-k-quarkus-cron/deployment/pom.xml
@@ -20,19 +20,18 @@
<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">
<parent>
<groupId>org.apache.camel.k</groupId>
- <artifactId>camel-k-runtime-parent</artifactId>
+ <artifactId>camel-k-quarkus-cron-parent</artifactId>
<version>1.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <packaging>pom</packaging>
- <artifactId>camel-k-quarkus</artifactId>
+ <artifactId>camel-k-quarkus-cron-deployment</artifactId>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-bom</artifactId>
+ <artifactId>camel-quarkus-bom-deployment</artifactId>
<version>${camel-quarkus.version}</version>
<type>pom</type>
<scope>import</scope>
@@ -40,18 +39,33 @@
</dependencies>
</dependencyManagement>
- <modules>
- <module>camel-k-quarkus-loader-xml</module>
- <module>camel-k-quarkus-loader-js</module>
- <module>camel-k-quarkus-loader-yaml</module>
- <module>camel-k-quarkus-loader-java</module>
- <module>camel-k-quarkus-loader-groovy</module>
- <module>camel-k-quarkus-loader-kotlin</module>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.k</groupId>
+ <artifactId>camel-k-quarkus-core-deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.k</groupId>
+ <artifactId>camel-k-quarkus-cron</artifactId>
+ </dependency>
+ </dependencies>
- <module>camel-k-quarkus-core</module>
- <module>camel-k-quarkus-knative</module>
-
- <module>camel-k-runtime-quarkus</module>
- </modules>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <annotationProcessorPaths>
+ <path>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-extension-processor</artifactId>
+ <version>${quarkus.version}</version>
+ </path>
+ </annotationProcessorPaths>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/camel-k-quarkus/camel-k-quarkus-cron/deployment/src/main/java/org/apache/camel/k/quarkus/cron/deployment/Feature.java b/camel-k-quarkus/camel-k-quarkus-cron/deployment/src/main/java/org/apache/camel/k/quarkus/cron/deployment/Feature.java
new file mode 100644
index 0000000..b8c60d3
--- /dev/null
+++ b/camel-k-quarkus/camel-k-quarkus-cron/deployment/src/main/java/org/apache/camel/k/quarkus/cron/deployment/Feature.java
@@ -0,0 +1,29 @@
+/*
+ * 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.k.quarkus.cron.deployment;
+
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+
+public class Feature {
+ private static final String FEATURE = "camel-k-runtime-cron";
+
+ @BuildStep
+ FeatureBuildItem feature() {
+ return new FeatureBuildItem(FEATURE);
+ }
+}
diff --git a/camel-k-quarkus/camel-k-quarkus-cron/it/pom.xml b/camel-k-quarkus/camel-k-quarkus-cron/it/pom.xml
new file mode 100644
index 0000000..7724032
--- /dev/null
+++ b/camel-k-quarkus/camel-k-quarkus-cron/it/pom.xml
@@ -0,0 +1,159 @@
+<?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">
+ <parent>
+ <groupId>org.apache.camel.k</groupId>
+ <artifactId>camel-k-quarkus-cron-parent</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>camel-k-quarkus-cron-it</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.k</groupId>
+ <artifactId>camel-k-quarkus-cron</artifactId>
+ </dependency>
+
+ <!-- quarkus dependencies -->
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jsonb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy-jsonb</artifactId>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>rest-assured</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>${build-helper-maven-plugin.version}</version>
+ <executions>
+ <execution>
+ <id>reserve-network-port</id>
+ <goals>
+ <goal>reserve-network-port</goal>
+ </goals>
+ <phase>process-resources</phase>
+ <configuration>
+ <portNames>
+ <portName>test.http.port.jvm</portName>
+ <portName>test.http.port.native</portName>
+ </portNames>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-maven-plugin</artifactId>
+ <version>${quarkus.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+ <quarkus.http.test-port>${test.http.port.jvm}</quarkus.http.test-port>
+ <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.package.type>native</quarkus.package.type>
+ <quarkus.native.additional-build-args>--language:js</quarkus.native.additional-build-args>
+ </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>
+ <systemProperties>
+ <quarkus.http.test-port>${test.http.port.native}</quarkus.http.test-port>
+ <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+
+</project>
diff --git a/camel-k-quarkus/camel-k-quarkus-cron/it/src/main/java/org/apache/camel/k/quarkus/cron/deployment/Application.java b/camel-k-quarkus/camel-k-quarkus-cron/it/src/main/java/org/apache/camel/k/quarkus/cron/deployment/Application.java
new file mode 100644
index 0000000..3d8cb21
--- /dev/null
+++ b/camel-k-quarkus/camel-k-quarkus-cron/it/src/main/java/org/apache/camel/k/quarkus/cron/deployment/Application.java
@@ -0,0 +1,46 @@
+/*
+ * 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.k.quarkus.cron.deployment;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ExtendedCamelContext;
+import org.apache.camel.k.Constants;
+
+@Path("/test")
+@ApplicationScoped
+public class Application {
+ @Inject
+ CamelContext context;
+
+ @GET
+ @Path("/find-cron-interceptor")
+ @Produces(MediaType.TEXT_PLAIN)
+ public String findCronInterceptor() {
+ return context.adapt(ExtendedCamelContext.class)
+ .getFactoryFinder(Constants.SOURCE_LOADER_INTERCEPTOR_RESOURCE_PATH)
+ .findClass("cron")
+ .map(Class::getName)
+ .orElse("");
+ }
+}
diff --git a/camel-k-quarkus/camel-k-quarkus-loader-js/it/src/main/resources/application.properties b/camel-k-quarkus/camel-k-quarkus-cron/it/src/main/resources/application.properties
similarity index 94%
copy from camel-k-quarkus/camel-k-quarkus-loader-js/it/src/main/resources/application.properties
copy to camel-k-quarkus/camel-k-quarkus-cron/it/src/main/resources/application.properties
index 3dff777..2958915 100644
--- a/camel-k-quarkus/camel-k-quarkus-loader-js/it/src/main/resources/application.properties
+++ b/camel-k-quarkus/camel-k-quarkus-cron/it/src/main/resources/application.properties
@@ -18,7 +18,8 @@
# Quarkus
#
quarkus.log.file.enable = false
-quarkus.log.console.enable = false
+quarkus.log.console.enable = true
+quarkus.banner.enabled = false
#
# Quarkus :: Camel
diff --git a/camel-k-quarkus/camel-k-quarkus-cron/it/src/test/java/org/apache/camel/k/quarkus/cron/deployment/ExtensionIT.java b/camel-k-quarkus/camel-k-quarkus-cron/it/src/test/java/org/apache/camel/k/quarkus/cron/deployment/ExtensionIT.java
new file mode 100644
index 0000000..9039b12
--- /dev/null
+++ b/camel-k-quarkus/camel-k-quarkus-cron/it/src/test/java/org/apache/camel/k/quarkus/cron/deployment/ExtensionIT.java
@@ -0,0 +1,23 @@
+/*
+ * 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.k.quarkus.cron.deployment;
+
+import io.quarkus.test.junit.NativeImageTest;
+
+@NativeImageTest
+public class ExtensionIT extends ExtensionTest {
+}
\ No newline at end of file
diff --git a/camel-k-quarkus/camel-k-quarkus-cron/it/src/test/java/org/apache/camel/k/quarkus/cron/deployment/ExtensionTest.java b/camel-k-quarkus/camel-k-quarkus-cron/it/src/test/java/org/apache/camel/k/quarkus/cron/deployment/ExtensionTest.java
new file mode 100644
index 0000000..8d0def1
--- /dev/null
+++ b/camel-k-quarkus/camel-k-quarkus-cron/it/src/test/java/org/apache/camel/k/quarkus/cron/deployment/ExtensionTest.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.k.quarkus.cron.deployment;
+
+import java.io.IOException;
+
+import io.quarkus.test.junit.QuarkusTest;
+import org.apache.camel.k.cron.CronSourceLoaderInterceptor;
+import org.junit.jupiter.api.Test;
+
+import static io.restassured.RestAssured.when;
+import static org.hamcrest.Matchers.is;
+
+@QuarkusTest
+public class ExtensionTest {
+ @Test
+ public void cronInterceptorIsRegistered() throws IOException {
+ when()
+ .get("/test/find-cron-interceptor")
+ .then()
+ .statusCode(200)
+ .body(is(CronSourceLoaderInterceptor.class.getName()));
+ }
+}
diff --git a/camel-k-quarkus/pom.xml b/camel-k-quarkus/camel-k-quarkus-cron/pom.xml
similarity index 57%
copy from camel-k-quarkus/pom.xml
copy to camel-k-quarkus/camel-k-quarkus-cron/pom.xml
index 5643159..9ae1a12 100644
--- a/camel-k-quarkus/pom.xml
+++ b/camel-k-quarkus/camel-k-quarkus-cron/pom.xml
@@ -20,38 +20,18 @@
<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">
<parent>
<groupId>org.apache.camel.k</groupId>
- <artifactId>camel-k-runtime-parent</artifactId>
+ <artifactId>camel-k-quarkus</artifactId>
<version>1.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
- <artifactId>camel-k-quarkus</artifactId>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-bom</artifactId>
- <version>${camel-quarkus.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
+ <artifactId>camel-k-quarkus-cron-parent</artifactId>
<modules>
- <module>camel-k-quarkus-loader-xml</module>
- <module>camel-k-quarkus-loader-js</module>
- <module>camel-k-quarkus-loader-yaml</module>
- <module>camel-k-quarkus-loader-java</module>
- <module>camel-k-quarkus-loader-groovy</module>
- <module>camel-k-quarkus-loader-kotlin</module>
-
- <module>camel-k-quarkus-core</module>
- <module>camel-k-quarkus-knative</module>
-
- <module>camel-k-runtime-quarkus</module>
+ <module>runtime</module>
+ <module>deployment</module>
+ <module>it</module>
</modules>
</project>
diff --git a/camel-k-quarkus/camel-k-quarkus-cron/runtime/pom.xml b/camel-k-quarkus/camel-k-quarkus-cron/runtime/pom.xml
new file mode 100644
index 0000000..73a889b
--- /dev/null
+++ b/camel-k-quarkus/camel-k-quarkus-cron/runtime/pom.xml
@@ -0,0 +1,86 @@
+<?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">
+ <parent>
+ <groupId>org.apache.camel.k</groupId>
+ <artifactId>camel-k-quarkus-cron-parent</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>camel-k-quarkus-cron</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.k</groupId>
+ <artifactId>camel-k-quarkus-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.k</groupId>
+ <artifactId>camel-k-runtime-cron</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-bootstrap-maven-plugin</artifactId>
+ <version>${quarkus.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>extension-descriptor</goal>
+ </goals>
+ <configuration>
+ <deployment>${project.groupId}:${project.artifactId}-deployment:${project.version}</deployment>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <annotationProcessorPaths>
+ <path>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-extension-processor</artifactId>
+ <version>${quarkus.version}</version>
+ </path>
+ </annotationProcessorPaths>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.jboss.jandex</groupId>
+ <artifactId>jandex-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>make-index</id>
+ <goals>
+ <goal>jandex</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/camel-k-quarkus/camel-k-quarkus-loader-js/it/src/main/resources/application.properties b/camel-k-quarkus/camel-k-quarkus-loader-js/it/src/main/resources/application.properties
index 3dff777..b4cc6d4 100644
--- a/camel-k-quarkus/camel-k-quarkus-loader-js/it/src/main/resources/application.properties
+++ b/camel-k-quarkus/camel-k-quarkus-loader-js/it/src/main/resources/application.properties
@@ -19,6 +19,7 @@
#
quarkus.log.file.enable = false
quarkus.log.console.enable = false
+quarkus.banner.enabled = false
#
# Quarkus :: Camel
diff --git a/camel-k-quarkus/camel-k-quarkus-loader-js/it/src/test/resources/application.properties b/camel-k-quarkus/camel-k-quarkus-loader-js/it/src/test/resources/application.properties
deleted file mode 100644
index a35368c..0000000
--- a/camel-k-quarkus/camel-k-quarkus-loader-js/it/src/test/resources/application.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-## ---------------------------------------------------------------------------
-## 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.
-## ---------------------------------------------------------------------------
-#
-# Quarkus
-#
-quarkus.log.file.enable = false
-quarkus.log.console.enable = false
\ No newline at end of file
diff --git a/camel-k-quarkus/camel-k-quarkus-loader-xml/it/src/main/resources/application.properties b/camel-k-quarkus/camel-k-quarkus-loader-xml/it/src/main/resources/application.properties
index d277fd6..73b0e70 100644
--- a/camel-k-quarkus/camel-k-quarkus-loader-xml/it/src/main/resources/application.properties
+++ b/camel-k-quarkus/camel-k-quarkus-loader-xml/it/src/main/resources/application.properties
@@ -19,6 +19,7 @@
#
quarkus.log.file.enable = false
quarkus.log.console.enable = false
+quarkus.banner.enabled = false
#
# Quarkus :: Camel
diff --git a/camel-k-quarkus/camel-k-quarkus-loader-xml/it/src/test/resources/application.properties b/camel-k-quarkus/camel-k-quarkus-loader-xml/it/src/test/resources/application.properties
deleted file mode 100644
index a35368c..0000000
--- a/camel-k-quarkus/camel-k-quarkus-loader-xml/it/src/test/resources/application.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-## ---------------------------------------------------------------------------
-## 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.
-## ---------------------------------------------------------------------------
-#
-# Quarkus
-#
-quarkus.log.file.enable = false
-quarkus.log.console.enable = false
\ No newline at end of file
diff --git a/camel-k-quarkus/camel-k-quarkus-loader-yaml/it/src/main/resources/application.properties b/camel-k-quarkus/camel-k-quarkus-loader-yaml/it/src/main/resources/application.properties
index 3dff777..b4cc6d4 100644
--- a/camel-k-quarkus/camel-k-quarkus-loader-yaml/it/src/main/resources/application.properties
+++ b/camel-k-quarkus/camel-k-quarkus-loader-yaml/it/src/main/resources/application.properties
@@ -19,6 +19,7 @@
#
quarkus.log.file.enable = false
quarkus.log.console.enable = false
+quarkus.banner.enabled = false
#
# Quarkus :: Camel
diff --git a/camel-k-quarkus/camel-k-quarkus-loader-yaml/it/src/test/resources/application.properties b/camel-k-quarkus/camel-k-quarkus-loader-yaml/it/src/test/resources/application.properties
deleted file mode 100644
index a35368c..0000000
--- a/camel-k-quarkus/camel-k-quarkus-loader-yaml/it/src/test/resources/application.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-## ---------------------------------------------------------------------------
-## 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.
-## ---------------------------------------------------------------------------
-#
-# Quarkus
-#
-quarkus.log.file.enable = false
-quarkus.log.console.enable = false
\ No newline at end of file
diff --git a/camel-k-quarkus/pom.xml b/camel-k-quarkus/pom.xml
index 5643159..539bbbf 100644
--- a/camel-k-quarkus/pom.xml
+++ b/camel-k-quarkus/pom.xml
@@ -50,6 +50,7 @@
<module>camel-k-quarkus-core</module>
<module>camel-k-quarkus-knative</module>
+ <module>camel-k-quarkus-cron</module>
<module>camel-k-runtime-quarkus</module>
</modules>
diff --git a/camel-k-runtime-bom/pom.xml b/camel-k-runtime-bom/pom.xml
index fdf21cb..8051ed4 100644
--- a/camel-k-runtime-bom/pom.xml
+++ b/camel-k-runtime-bom/pom.xml
@@ -255,6 +255,16 @@
<artifactId>camel-k-quarkus-knative-deployment</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.k</groupId>
+ <artifactId>camel-k-quarkus-cron</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.k</groupId>
+ <artifactId>camel-k-quarkus-cron-deployment</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<!-- loaders -->
diff --git a/camel-k-runtime-cron/src/main/java/org/apache/camel/k/cron/CronSourceLoaderInterceptor.java b/camel-k-runtime-cron/src/main/java/org/apache/camel/k/cron/CronSourceLoaderInterceptor.java
index 04585e9..e97eaee 100644
--- a/camel-k-runtime-cron/src/main/java/org/apache/camel/k/cron/CronSourceLoaderInterceptor.java
+++ b/camel-k-runtime-cron/src/main/java/org/apache/camel/k/cron/CronSourceLoaderInterceptor.java
@@ -85,8 +85,8 @@ public class CronSourceLoaderInterceptor implements SourceLoader.Interceptor, Ru
return;
}
- CamelContext context = runtime.getCamelContext();
- String[] components = overridableComponents.split(",", -1);
+ final CamelContext context = runtime.getCamelContext();
+ final String[] components = overridableComponents.split(",", -1);
for (RouteDefinition def : builder.getRouteCollection().getRoutes()) {
String uri = def.getInput() != null ? def.getInput().getUri() : null;
diff --git a/pom.xml b/pom.xml
index 7edbcd9..10ff851 100644
--- a/pom.xml
+++ b/pom.xml
@@ -66,6 +66,7 @@
<jandex.version>2.1.3.Final</jandex.version>
<javapoet.version>1.11.1</javapoet.version>
<rest-assured.version>4.3.0</rest-assured.version>
+ <hamcrest.version>2.2</hamcrest.version>
<gmavenplus-plugin.version>1.9.0</gmavenplus-plugin.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
@@ -362,6 +363,16 @@
<artifactId>camel-k-runtime-knative</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.k</groupId>
+ <artifactId>camel-k-runtime-cron</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.k</groupId>
+ <artifactId>camel-k-runtime-master</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<!-- runtime - quarkus -->
<dependency>
@@ -454,6 +465,16 @@
<artifactId>camel-k-quarkus-knative-deployment</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.k</groupId>
+ <artifactId>camel-k-quarkus-cron</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.k</groupId>
+ <artifactId>camel-k-quarkus-knative-cron</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<!-- loaders -->
<dependency>
@@ -564,6 +585,11 @@
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-core</artifactId>
+ <version>${hamcrest.version}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
diff --git a/tooling/camel-k-maven-plugin/src/it/generate-catalog-main/verify.groovy b/tooling/camel-k-maven-plugin/src/it/generate-catalog-main/verify.groovy
index 21d246b..b08a066 100644
--- a/tooling/camel-k-maven-plugin/src/it/generate-catalog-main/verify.groovy
+++ b/tooling/camel-k-maven-plugin/src/it/generate-catalog-main/verify.groovy
@@ -24,6 +24,8 @@ new File(basedir, "catalog.yaml").withReader {
assert catalog.spec.runtime.metadata['quarkus.version'] == quarkusVersion
assert catalog.spec.runtime.metadata['camel-quarkus.version'] == camelQuarkusVersion
+ assert catalog.spec.runtime.capabilities['cron'].dependencies[0].groupId == 'org.apache.camel.k'
+ assert catalog.spec.runtime.capabilities['cron'].dependencies[0].artifactId == 'camel-k-runtime-cron'
assert catalog.spec.runtime.capabilities['health'].dependencies[0].groupId == 'org.apache.camel.k'
assert catalog.spec.runtime.capabilities['health'].dependencies[0].artifactId == 'camel-k-runtime-health'
assert catalog.spec.runtime.capabilities['rest'].dependencies[0].groupId == 'org.apache.camel'
diff --git a/tooling/camel-k-maven-plugin/src/it/generate-catalog-quarkus/verify.groovy b/tooling/camel-k-maven-plugin/src/it/generate-catalog-quarkus/verify.groovy
index 9a450a0..5ad4fe2 100644
--- a/tooling/camel-k-maven-plugin/src/it/generate-catalog-quarkus/verify.groovy
+++ b/tooling/camel-k-maven-plugin/src/it/generate-catalog-quarkus/verify.groovy
@@ -24,6 +24,8 @@ new File(basedir, "catalog.yaml").withReader {
assert catalog.spec.runtime.metadata['quarkus.version'] == quarkusVersion
assert catalog.spec.runtime.metadata['camel-quarkus.version'] == camelQuarkusVersion
+ assert catalog.spec.runtime.capabilities['cron'].dependencies[0].groupId == 'org.apache.camel.k'
+ assert catalog.spec.runtime.capabilities['cron'].dependencies[0].artifactId == 'camel-k-quarkus-cron'
assert catalog.spec.runtime.capabilities['health'].dependencies[0].groupId == 'org.apache.camel.quarkus'
assert catalog.spec.runtime.capabilities['health'].dependencies[0].artifactId == 'camel-quarkus-microprofile-health'
assert catalog.spec.runtime.capabilities['rest'].dependencies[0].groupId == 'org.apache.camel.quarkus'
diff --git a/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateCatalogMojo.java b/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateCatalogMojo.java
index 99de096..c63fae0 100644
--- a/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateCatalogMojo.java
+++ b/tooling/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateCatalogMojo.java
@@ -145,7 +145,7 @@ public class GenerateCatalogMojo extends AbstractMojo {
runtimeSpec.addDependency("org.apache.camel.k", "camel-k-runtime-quarkus");
runtimeSpec.putCapability(
"cron",
- CamelCapability.forArtifact("org.apache.camel.k", "camel-k-runtime-cron"));
+ CamelCapability.forArtifact("org.apache.camel.k", "camel-k-quarkus-cron"));
runtimeSpec.putCapability(
"health",
CamelCapability.forArtifact("org.apache.camel.quarkus", "camel-quarkus-microprofile-health"));