You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pp...@apache.org on 2020/03/06 15:01:10 UTC
[camel-quarkus] branch master updated: add camel-jaxb into
extensions
This is an automated email from the ASF dual-hosted git repository.
ppalaga pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/master by this push:
new 79b58b6 add camel-jaxb into extensions
79b58b6 is described below
commit 79b58b61093f39f3e67d36c1539a7af555099d61
Author: mmelko <mm...@redhat.com>
AuthorDate: Thu Mar 5 15:31:30 2020 +0100
add camel-jaxb into extensions
---
.github/workflows/pr-build.yaml | 3 +-
.../pages/list-of-camel-quarkus-extensions.adoc | 8 +-
extensions/jaxb/deployment/pom.xml | 79 +++++++++++++
.../component/jaxb/deployment/JaxbProcessor.java | 38 ++++++
extensions/jaxb/pom.xml | 50 ++++++++
extensions/jaxb/runtime/pom.xml | 86 ++++++++++++++
.../main/resources/META-INF/quarkus-extension.yaml | 28 +++++
extensions/pom.xml | 1 +
extensions/readme.adoc | 8 +-
integration-tests/jaxb/pom.xml | 127 +++++++++++++++++++++
.../quarkus/component/jaxb/it/JaxbResource.java | 102 +++++++++++++++++
.../camel/quarkus/component/jaxb/it/JaxbRoute.java | 51 +++++++++
.../component/jaxb/it/model/ObjectFactory.java | 37 ++++++
.../quarkus/component/jaxb/it/model/Person.java | 116 +++++++++++++++++++
.../jaxb/src/main/resources/application.properties | 25 ++++
.../jaxb/src/main/resources/person.xsd | 35 ++++++
.../camel/quarkus/component/jaxb/it/JaxbIT.java | 24 ++++
.../camel/quarkus/component/jaxb/it/JaxbTest.java | 74 ++++++++++++
integration-tests/pom.xml | 1 +
poms/bom-deployment/pom.xml | 5 +
poms/bom/pom.xml | 10 ++
21 files changed, 901 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml
index fa80602..1aa17f7 100644
--- a/.github/workflows/pr-build.yaml
+++ b/.github/workflows/pr-build.yaml
@@ -245,7 +245,8 @@ jobs:
-pl :camel-quarkus-integration-test-base64 \
-pl :camel-quarkus-integration-test-bindy \
-pl :camel-quarkus-integration-test-csv \
- -pl :camel-quarkus-integration-test-dataformat
+ -pl :camel-quarkus-integration-test-dataformat \
+ -pl :camel-quarkus-integration-test-jaxb
networking:
runs-on: ubuntu-latest
needs: build
diff --git a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
index 8c8a103..437f9e3 100644
--- a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
+++ b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
@@ -243,7 +243,7 @@ Number of Camel components: 71 in 61 JAR artifacts (0 deprecated)
== Camel Data Formats
// dataformats: START
-Number of Camel data formats: 20 in 16 JAR artifacts (0 deprecated)
+Number of Camel data formats: 21 in 17 JAR artifacts (0 deprecated)
[width="100%",cols="4,1,5",options="header"]
|===
@@ -269,6 +269,8 @@ Number of Camel data formats: 20 in 16 JAR artifacts (0 deprecated)
| link:https://camel.apache.org/components/latest/jacksonxml-dataformat.html[JacksonXML] (camel-quarkus-jacksonxml) | 1.0.0-M5 | JacksonXML data format is used for unmarshal a XML payload to POJO or to marshal POJO back to XML payload.
+| link:https://camel.apache.org/components/latest/jaxb-dataformat.html[JAXB] (camel-quarkus-jaxb) | 1.0.0-M5 | JAXB data format uses the JAXB2 XML marshalling standard to unmarshal an XML payload into Java objects or to marshal Java objects into an XML payload.
+
| link:https://camel.apache.org/components/latest/json-gson-dataformat.html[JSon GSon] (camel-quarkus-gson) | 1.0.0-M4 | JSon data format is used for unmarshal a JSon payload to POJO or to marshal POJO back to JSon payload.
| link:https://camel.apache.org/components/latest/json-jackson-dataformat.html[JSon Jackson] (camel-quarkus-jackson) | 0.3.0 | JSon data format is used for unmarshal a JSon payload to POJO or to marshal POJO back to JSon payload.
@@ -349,8 +351,8 @@ Number of miscellaneous extensions: 10 in 10 JAR artifacts (0 deprecated)
| (camel-quarkus-reactive-executor) | 0.3.0 | Reactive Executor for camel-core using Vert.x
-| (camel-quarkus-xml-io) | 1.0.0-M5 | Includes implementations of Camel's fast and lightweight XML parse
+| (camel-quarkus-xml-io) | 1.0.0-M5 | An XML stack for parsing XML route definitions. A fast an light weight alternative to camel-quarkus-xml-jaxp
-| (camel-quarkus-xml-jaxb) | 1.0.0-M5 | Includes implementations of Java Architecture for XML Binding (JAXB)
+| (camel-quarkus-xml-jaxb) | 1.0.0-M5 | An XML stack for parsing XML route definitions. A legacy alternative to the fast an light weight camel-quarkus-xml-io
|===
// others: END
diff --git a/extensions/jaxb/deployment/pom.xml b/extensions/jaxb/deployment/pom.xml
new file mode 100644
index 0000000..5df0272
--- /dev/null
+++ b/extensions/jaxb/deployment/pom.xml
@@ -0,0 +1,79 @@
+<?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>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jaxb-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-jaxb-deployment</artifactId>
+ <name>Camel Quarkus :: JAXB extension :: Deployment</name>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bom-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-core-deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jaxb-deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jaxb</artifactId>
+ </dependency>
+ </dependencies>
+
+ <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/extensions/jaxb/deployment/src/main/java/org/apache/camel/quarkus/component/jaxb/deployment/JaxbProcessor.java b/extensions/jaxb/deployment/src/main/java/org/apache/camel/quarkus/component/jaxb/deployment/JaxbProcessor.java
new file mode 100644
index 0000000..8808ea6
--- /dev/null
+++ b/extensions/jaxb/deployment/src/main/java/org/apache/camel/quarkus/component/jaxb/deployment/JaxbProcessor.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.quarkus.component.jaxb.deployment;
+
+import com.sun.xml.bind.v2.runtime.output.FastInfosetStreamWriterOutput;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
+
+class JaxbProcessor {
+
+ private static final String FEATURE = "camel-jaxb";
+
+ @BuildStep
+ FeatureBuildItem feature() {
+ return new FeatureBuildItem(FEATURE);
+ }
+
+ @BuildStep
+ RuntimeInitializedClassBuildItem fastInfosetStreamWriterOutput() {
+ return new RuntimeInitializedClassBuildItem(FastInfosetStreamWriterOutput.class.getCanonicalName());
+ }
+
+}
diff --git a/extensions/jaxb/pom.xml b/extensions/jaxb/pom.xml
new file mode 100644
index 0000000..6cf0293
--- /dev/null
+++ b/extensions/jaxb/pom.xml
@@ -0,0 +1,50 @@
+<?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>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-build-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../../poms/build-parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-jaxb-parent</artifactId>
+ <name>Camel Quarkus :: JAXB extension</name>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>deployment</module>
+ <module>runtime</module>
+ </modules>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-bom-deployment</artifactId>
+ <version>${quarkus.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+</project>
diff --git a/extensions/jaxb/runtime/pom.xml b/extensions/jaxb/runtime/pom.xml
new file mode 100644
index 0000000..84a84bc
--- /dev/null
+++ b/extensions/jaxb/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">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jaxb-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-jaxb</artifactId>
+ <name>Camel Quarkus :: JAXB extension :: Runtime</name>
+
+ <properties>
+ <firstVersion>1.0.0-M5</firstVersion>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bom</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-jaxb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jaxb</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-bootstrap-maven-plugin</artifactId>
+ </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>
+ </plugins>
+ </build>
+</project>
diff --git a/extensions/jaxb/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/jaxb/runtime/src/main/resources/META-INF/quarkus-extension.yaml
new file mode 100644
index 0000000..97454f3
--- /dev/null
+++ b/extensions/jaxb/runtime/src/main/resources/META-INF/quarkus-extension.yaml
@@ -0,0 +1,28 @@
+#
+# 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.
+#
+
+---
+name: "Camel Quarkus JAXB dataformat"
+description: "Camel JAXB dataformat support"
+metadata:
+ keywords:
+ - "camel"
+ - "jaxb"
+ - "transformation"
+ guide: "https://quarkus.io/guides/camel"
+ categories:
+ - "integration"
diff --git a/extensions/pom.xml b/extensions/pom.xml
index e6d2088..1af4391 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -84,6 +84,7 @@
<module>infinispan</module>
<module>jackson</module>
<module>jacksonxml</module>
+ <module>jaxb</module>
<module>jdbc</module>
<module>jira</module>
<module>jms</module>
diff --git a/extensions/readme.adoc b/extensions/readme.adoc
index 3b5fe61..dbe7988 100644
--- a/extensions/readme.adoc
+++ b/extensions/readme.adoc
@@ -231,7 +231,7 @@ Number of Camel components: 71 in 61 JAR artifacts (0 deprecated)
== Camel Data Formats
// dataformats: START
-Number of Camel data formats: 20 in 16 JAR artifacts (0 deprecated)
+Number of Camel data formats: 21 in 17 JAR artifacts (0 deprecated)
[width="100%",cols="4,1,5",options="header"]
|===
@@ -257,6 +257,8 @@ Number of Camel data formats: 20 in 16 JAR artifacts (0 deprecated)
| link:https://camel.apache.org/components/latest/jacksonxml-dataformat.html[JacksonXML] (camel-quarkus-jacksonxml) | 1.0.0-M5 | JacksonXML data format is used for unmarshal a XML payload to POJO or to marshal POJO back to XML payload.
+| link:https://camel.apache.org/components/latest/jaxb-dataformat.html[JAXB] (camel-quarkus-jaxb) | 1.0.0-M5 | JAXB data format uses the JAXB2 XML marshalling standard to unmarshal an XML payload into Java objects or to marshal Java objects into an XML payload.
+
| link:https://camel.apache.org/components/latest/json-gson-dataformat.html[JSon GSon] (camel-quarkus-gson) | 1.0.0-M4 | JSon data format is used for unmarshal a JSon payload to POJO or to marshal POJO back to JSon payload.
| link:https://camel.apache.org/components/latest/json-jackson-dataformat.html[JSon Jackson] (camel-quarkus-jackson) | 0.3.0 | JSon data format is used for unmarshal a JSon payload to POJO or to marshal POJO back to JSon payload.
@@ -339,9 +341,9 @@ Number of miscellaneous extensions: 10 in 10 JAR artifacts (0 deprecated)
| (camel-quarkus-reactive-executor) | 0.3.0 | Reactive Executor for camel-core using Vert.x
-| (camel-quarkus-xml-io) | 1.0.0-M5 | Includes implementations of Camel's fast and lightweight XML parse
+| (camel-quarkus-xml-io) | 1.0.0-M5 | An XML stack for parsing XML route definitions. A fast an light weight alternative to camel-quarkus-xml-jaxp
-| (camel-quarkus-xml-jaxb) | 1.0.0-M5 | Includes implementations of Java Architecture for XML Binding (JAXB)
+| (camel-quarkus-xml-jaxb) | 1.0.0-M5 | An XML stack for parsing XML route definitions. A legacy alternative to the fast an light weight camel-quarkus-xml-io
|===
// others: END
diff --git a/integration-tests/jaxb/pom.xml b/integration-tests/jaxb/pom.xml
new file mode 100644
index 0000000..31ecb12
--- /dev/null
+++ b/integration-tests/jaxb/pom.xml
@@ -0,0 +1,127 @@
+<?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>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-quarkus-integration-test-jaxb</artifactId>
+ <name>Camel Quarkus :: Integration Tests :: JAXB extension</name>
+ <description>Integration tests for Camel Quarkus JAXB extension</description>
+
+ <properties>
+ <!-- mvnd, a.k.a. Maven Daemon: https://github.com/gnodet/mvnd -->
+ <!-- The following rule tells mvnd to build the listed deployment modules before this module. -->
+ <!-- This is important because mvnd builds modules in parallel by default. The deployment modules are not -->
+ <!-- explicit dependencies of this module in the Maven sense, although they are required by the Quarkus Maven plugin. -->
+ <!-- Please update rule whenever you change the dependencies of this module by running -->
+ <!-- mvn process-resources -Pformat from the root directory -->
+ <mvnd.builder.rule>camel-quarkus-direct-deployment,camel-quarkus-jaxb-deployment,camel-quarkus-support-policy-deployment</mvnd.builder.rule>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jaxb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy</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>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ </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>
+ <systemProperties>
+ <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/integration-tests/jaxb/src/main/java/org/apache/camel/quarkus/component/jaxb/it/JaxbResource.java b/integration-tests/jaxb/src/main/java/org/apache/camel/quarkus/component/jaxb/it/JaxbResource.java
new file mode 100644
index 0000000..6c37679
--- /dev/null
+++ b/integration-tests/jaxb/src/main/java/org/apache/camel/quarkus/component/jaxb/it/JaxbResource.java
@@ -0,0 +1,102 @@
+/*
+ * 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.quarkus.component.jaxb.it;
+
+import java.net.URI;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.quarkus.component.jaxb.it.model.Person;
+import org.jboss.logging.Logger;
+
+@Path("/jaxb")
+@ApplicationScoped
+public class JaxbResource {
+
+ private static final Logger LOG = Logger.getLogger(JaxbResource.class);
+
+ @Inject
+ ProducerTemplate producerTemplate;
+
+ @Path("/unmarshal-lastname")
+ @POST
+ @Consumes(MediaType.APPLICATION_XML)
+ @Produces(MediaType.TEXT_PLAIN)
+ public Response unmarshalLastNameFromXml(String message) throws Exception {
+ LOG.infof("Sending to jaxb: %s", message);
+ final Person response = producerTemplate.requestBody("direct:unmarshal", message, Person.class);
+ LOG.infof("Got response from jaxb: %s", response);
+ return Response
+ .created(new URI("https://camel.apache.org/"))
+ .entity(response.getLastName())
+ .build();
+ }
+
+ @Path("/unmarshal-firstname")
+ @POST
+ @Consumes(MediaType.APPLICATION_XML)
+ @Produces(MediaType.TEXT_PLAIN)
+ public Response unmarshalFirstNameFromXml(String message) throws Exception {
+ LOG.infof("Sending to jaxb: %s", message);
+ final Person response = producerTemplate.requestBody("direct:unmarshal-2", message, Person.class);
+ LOG.infof("Got response from jaxb: %s", response);
+ return Response
+ .created(new URI("https://camel.apache.org/"))
+ .entity(response.getFirstName())
+ .build();
+ }
+
+ @Path("/marshal-firstname")
+ @POST
+ @Consumes(MediaType.TEXT_PLAIN)
+ @Produces(MediaType.APPLICATION_XML)
+ public Response marshallFirstName(String name) throws Exception {
+ Person p = new Person();
+ p.setFirstName(name);
+
+ String response = producerTemplate.requestBody("direct:marshal", p, String.class);
+ LOG.infof("Got response from jaxb=>: %s", response);
+ return Response
+ .created(new URI("https://camel.apache.org/"))
+ .entity(response)
+ .build();
+ }
+
+ @Path("/marshal-lastname")
+ @POST
+ @Consumes(MediaType.TEXT_PLAIN)
+ @Produces(MediaType.APPLICATION_XML)
+ public Response marshallLastName(String name) throws Exception {
+ Person p = new Person();
+ p.setLastName(name);
+
+ String response = producerTemplate.requestBody("direct:marshal-2", p, String.class);
+ LOG.infof("Got response from jaxb=>: %s", response);
+ return Response
+ .created(new URI("https://camel.apache.org/"))
+ .entity(response)
+ .build();
+ }
+}
diff --git a/integration-tests/jaxb/src/main/java/org/apache/camel/quarkus/component/jaxb/it/JaxbRoute.java b/integration-tests/jaxb/src/main/java/org/apache/camel/quarkus/component/jaxb/it/JaxbRoute.java
new file mode 100644
index 0000000..1ed2874
--- /dev/null
+++ b/integration-tests/jaxb/src/main/java/org/apache/camel/quarkus/component/jaxb/it/JaxbRoute.java
@@ -0,0 +1,51 @@
+/*
+ * 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.quarkus.component.jaxb.it;
+
+import javax.xml.bind.JAXBContext;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.converter.jaxb.JaxbDataFormat;
+import org.apache.camel.quarkus.component.jaxb.it.model.Person;
+
+public class JaxbRoute extends RouteBuilder {
+
+ @Override
+ public void configure() throws Exception {
+ JaxbDataFormat jaxb = new JaxbDataFormat("org.apache.camel.quarkus.component.jaxb.it.model");
+
+ JaxbDataFormat xml = new JaxbDataFormat();
+ JAXBContext context = JAXBContext.newInstance(Person.class);
+ xml.setContext(context);
+
+ JaxbDataFormat jaxbFromScheme = new JaxbDataFormat();
+ jaxbFromScheme.setSchema("classpath:person.xsd");
+
+ from("direct:unmarshal")
+ .unmarshal(jaxb);
+
+ from("direct:unmarshal-2")
+ .unmarshal(xml);
+
+ from("direct:marshal")
+ .marshal(jaxbFromScheme);
+
+ from("direct:marshal-2")
+ .marshal(xml);
+
+ }
+}
diff --git a/integration-tests/jaxb/src/main/java/org/apache/camel/quarkus/component/jaxb/it/model/ObjectFactory.java b/integration-tests/jaxb/src/main/java/org/apache/camel/quarkus/component/jaxb/it/model/ObjectFactory.java
new file mode 100644
index 0000000..46f83ef
--- /dev/null
+++ b/integration-tests/jaxb/src/main/java/org/apache/camel/quarkus/component/jaxb/it/model/ObjectFactory.java
@@ -0,0 +1,37 @@
+/*
+ * 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.quarkus.component.jaxb.it.model;
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+@XmlRegistry
+public class ObjectFactory {
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package:
+ * org.apache.camel.converter.jaxb.person
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link Person }
+ */
+ public Person createPerson() {
+ return new Person();
+ }
+}
diff --git a/integration-tests/jaxb/src/main/java/org/apache/camel/quarkus/component/jaxb/it/model/Person.java b/integration-tests/jaxb/src/main/java/org/apache/camel/quarkus/component/jaxb/it/model/Person.java
new file mode 100644
index 0000000..cd5f8d4
--- /dev/null
+++ b/integration-tests/jaxb/src/main/java/org/apache/camel/quarkus/component/jaxb/it/model/Person.java
@@ -0,0 +1,116 @@
+/*
+ * 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.quarkus.component.jaxb.it.model;
+
+import javax.xml.bind.annotation.*;
+
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = { "firstName", "lastName", "age" })
+@XmlRootElement(name = "person")
+public class Person {
+
+ @XmlElement(required = true)
+ protected String firstName = "John";
+ @XmlElement(required = true)
+ protected String lastName = "Doe";
+ @XmlElement(required = true, type = Integer.class, nillable = true)
+ protected Integer age = 33;
+
+ /**
+ * Gets the value of the firstName property.
+ *
+ * @return possible object is
+ * {@link String }
+ */
+ public String getFirstName() {
+ return firstName;
+ }
+
+ /**
+ * Sets the value of the firstName property.
+ *
+ * @param value allowed object is
+ * {@link String }
+ */
+ public void setFirstName(String value) {
+ this.firstName = value;
+ }
+
+ /**
+ * Gets the value of the lastName property.
+ *
+ * @return possible object is
+ * {@link String }
+ */
+ public String getLastName() {
+ return lastName;
+ }
+
+ /**
+ * Sets the value of the lastName property.
+ *
+ * @param value allowed object is
+ * {@link String }
+ */
+ public void setLastName(String value) {
+ this.lastName = value;
+ }
+
+ /**
+ * Gets the value of the age property.
+ *
+ * @return possible object is
+ * {@link Integer }
+ */
+ public Integer getAge() {
+ return age;
+ }
+
+ /**
+ * Sets the value of the age property.
+ *
+ * @param value allowed object is
+ * {@link Integer }
+ */
+ public void setAge(Integer value) {
+ this.age = value;
+ }
+
+ public Person withFirstName(String value) {
+ setFirstName(value);
+ return this;
+ }
+
+ public Person withLastName(String value) {
+ setLastName(value);
+ return this;
+ }
+
+ public Person withAge(Integer value) {
+ setAge(value);
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ return "Person{" +
+ "firstName='" + firstName + '\'' +
+ ", lastName='" + lastName + '\'' +
+ ", age=" + age +
+ '}';
+ }
+}
diff --git a/integration-tests/jaxb/src/main/resources/application.properties b/integration-tests/jaxb/src/main/resources/application.properties
new file mode 100644
index 0000000..893b78d
--- /dev/null
+++ b/integration-tests/jaxb/src/main/resources/application.properties
@@ -0,0 +1,25 @@
+
+## ---------------------------------------------------------------------------
+## 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
+
+## include xml routes and scheme
+quarkus.native.additional-build-args = -H:IncludeResources=person.xsd
+
diff --git a/integration-tests/jaxb/src/main/resources/person.xsd b/integration-tests/jaxb/src/main/resources/person.xsd
new file mode 100644
index 0000000..eb83a46
--- /dev/null
+++ b/integration-tests/jaxb/src/main/resources/person.xsd
@@ -0,0 +1,35 @@
+<?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.
+
+-->
+<xs:schema attributeFormDefault="unqualified"
+ elementFormDefault="qualified"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:a="address.jaxb.converter.camel.apache.org"
+ targetNamespace="person.jaxb.converter.camel.apache.org">
+
+ <xs:element name="person">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstName" type="xs:string" minOccurs="1" />
+ <xs:element name="lastName" type="xs:string" minOccurs="1"/>
+ <xs:element name="age" type="xs:int" nillable="true" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+</xs:schema>
\ No newline at end of file
diff --git a/integration-tests/jaxb/src/test/java/org/apache/camel/quarkus/component/jaxb/it/JaxbIT.java b/integration-tests/jaxb/src/test/java/org/apache/camel/quarkus/component/jaxb/it/JaxbIT.java
new file mode 100644
index 0000000..f332250
--- /dev/null
+++ b/integration-tests/jaxb/src/test/java/org/apache/camel/quarkus/component/jaxb/it/JaxbIT.java
@@ -0,0 +1,24 @@
+/*
+ * 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.quarkus.component.jaxb.it;
+
+import io.quarkus.test.junit.NativeImageTest;
+
+@NativeImageTest
+class JaxbIT extends JaxbTest {
+
+}
diff --git a/integration-tests/jaxb/src/test/java/org/apache/camel/quarkus/component/jaxb/it/JaxbTest.java b/integration-tests/jaxb/src/test/java/org/apache/camel/quarkus/component/jaxb/it/JaxbTest.java
new file mode 100644
index 0000000..97f9b1c
--- /dev/null
+++ b/integration-tests/jaxb/src/test/java/org/apache/camel/quarkus/component/jaxb/it/JaxbTest.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.quarkus.component.jaxb.it;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.http.ContentType;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+@QuarkusTest
+class JaxbTest {
+
+ @Test
+ public void testUnmarshalLastName() {
+ String response = RestAssured.given().contentType(ContentType.XML)
+ .body(getPersonXml("Foo", "Bar", 22))
+ .post("/jaxb/unmarshal-lastname")
+ .then().statusCode(201).extract().asString();
+ assertThat(response).isEqualTo("Bar");
+ }
+
+ @Test
+ public void testUnmarshalFirstName() {
+ String response = RestAssured.given().contentType(ContentType.XML)
+ .body(getPersonXml("Foo", "Bar", 22))
+ .post("/jaxb/unmarshal-firstname")
+ .then().statusCode(201).extract().asString();
+ assertThat(response).isEqualTo("Foo");
+ }
+
+ @Test
+ public void testMarshallFirstName() {
+ String name = RestAssured.given().contentType(ContentType.TEXT)
+ .body("Foo")
+ .post("/jaxb/marshal-firstname")
+ .then().statusCode(201).extract().asString();
+ assertThat(name).contains("<firstName>Foo</firstName>");
+ }
+
+ @Test
+ public void testMarshallLasttName() {
+ String name = RestAssured.given().contentType(ContentType.TEXT)
+ .body("Bar")
+ .post("/jaxb/marshal-lastname")
+ .then().statusCode(201).extract().asString();
+ assertThat(name).contains("<lastName>Bar</lastName>");
+ }
+
+ private static String getPersonXml(String name, String lastName, Integer age) {
+ return String.format(
+ "<person>" +
+ "<firstName>%s</firstName>" +
+ "<lastName>%s</lastName>" +
+ "<age>%d</age>" +
+ "</person>",
+ name, lastName, age);
+ }
+}
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 2680741..f433521 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -186,6 +186,7 @@
<module>http</module>
<module>hystrix</module>
<module>infinispan</module>
+ <module>jaxb</module>
<module>jdbc</module>
<module>jira</module>
<module>jsonpath</module>
diff --git a/poms/bom-deployment/pom.xml b/poms/bom-deployment/pom.xml
index d4117c5..e673e57 100644
--- a/poms/bom-deployment/pom.xml
+++ b/poms/bom-deployment/pom.xml
@@ -276,6 +276,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jaxb-deployment</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jdbc-deployment</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>
diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml
index 27a1858..5dda722 100644
--- a/poms/bom/pom.xml
+++ b/poms/bom/pom.xml
@@ -345,6 +345,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-jaxb</artifactId>
+ <version>${camel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-jdbc</artifactId>
<version>${camel.version}</version>
</dependency>
@@ -886,6 +891,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jaxb</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jdbc</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>