You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2026/06/25 11:06:47 UTC
(camel-quarkus) 03/10: Fixes #8592. Add camel-quarkus-jsoup extension with native support
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch camel-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit e4358b6bdff02b90ca3d751030cd7abff9f8b063
Author: Jomin <30...@users.noreply.github.com>
AuthorDate: Fri May 8 07:09:14 2026 +0100
Fixes #8592. Add camel-quarkus-jsoup extension with native support
Co-authored-by: jomin mathew <>
---
catalog/pom.xml | 13 ++
.../ROOT/examples/components/iec60870-client.yml | 2 +-
.../ROOT/examples/components/iec60870-server.yml | 2 +-
docs/modules/ROOT/examples/others/jsoup.yml | 13 ++
docs/modules/ROOT/nav.adoc | 1 +
.../ROOT/pages/reference/extensions/iec60870.adoc | 6 +-
.../ROOT/pages/reference/extensions/jsoup.adoc | 45 ++++++
extensions/jsoup/deployment/pom.xml | 61 ++++++++
.../component/jsoup/deployment/JsoupProcessor.java | 31 ++++
extensions/jsoup/pom.xml | 37 +++++
extensions/jsoup/runtime/pom.xml | 70 +++++++++
.../main/resources/META-INF/quarkus-extension.yaml | 36 +++++
extensions/pom.xml | 1 +
integration-tests/jsoup/pom.xml | 144 ++++++++++++++++++
.../quarkus/component/jsoup/it/JsoupResource.java | 91 ++++++++++++
.../component/jsoup/it/JsoupRouteBuilder.java | 50 +++++++
.../src/main/resources/application.properties | 17 +++
.../src/main/resources/yaml/jsoup-routes.yaml | 40 +++++
.../camel/quarkus/component/jsoup/it/JsoupIT.java | 23 +++
.../quarkus/component/jsoup/it/JsoupTest.java | 161 +++++++++++++++++++++
integration-tests/pom.xml | 1 +
poms/bom/pom.xml | 34 +++++
tooling/scripts/test-categories.yaml | 1 +
23 files changed, 875 insertions(+), 5 deletions(-)
diff --git a/catalog/pom.xml b/catalog/pom.xml
index 9853fc8ef5..3eac29e9ac 100644
--- a/catalog/pom.xml
+++ b/catalog/pom.xml
@@ -2359,6 +2359,19 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jsoup</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jt400</artifactId>
diff --git a/docs/modules/ROOT/examples/components/iec60870-client.yml b/docs/modules/ROOT/examples/components/iec60870-client.yml
index e1e21e5382..5f9fd3479b 100644
--- a/docs/modules/ROOT/examples/components/iec60870-client.yml
+++ b/docs/modules/ROOT/examples/components/iec60870-client.yml
@@ -4,7 +4,7 @@ cqArtifactId: camel-quarkus-iec60870
cqArtifactIdBase: iec60870
cqNativeSupported: false
cqStatus: Preview
-cqDeprecated: false
+cqDeprecated: true
cqJvmSince: 1.1.0
cqNativeSince: n/a
cqCamelPartName: iec60870-client
diff --git a/docs/modules/ROOT/examples/components/iec60870-server.yml b/docs/modules/ROOT/examples/components/iec60870-server.yml
index 23c30e4aa0..78522e2aed 100644
--- a/docs/modules/ROOT/examples/components/iec60870-server.yml
+++ b/docs/modules/ROOT/examples/components/iec60870-server.yml
@@ -4,7 +4,7 @@ cqArtifactId: camel-quarkus-iec60870
cqArtifactIdBase: iec60870
cqNativeSupported: false
cqStatus: Preview
-cqDeprecated: false
+cqDeprecated: true
cqJvmSince: 1.1.0
cqNativeSince: n/a
cqCamelPartName: iec60870-server
diff --git a/docs/modules/ROOT/examples/others/jsoup.yml b/docs/modules/ROOT/examples/others/jsoup.yml
new file mode 100644
index 0000000000..f12e935c12
--- /dev/null
+++ b/docs/modules/ROOT/examples/others/jsoup.yml
@@ -0,0 +1,13 @@
+# Do not edit directly!
+# This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
+cqArtifactId: camel-quarkus-jsoup
+cqArtifactIdBase: jsoup
+cqNativeSupported: true
+cqStatus: Stable
+cqDeprecated: false
+cqJvmSince: 3.36.0
+cqNativeSince: 3.36.0
+cqCamelPartName: jsoup
+cqCamelPartTitle: Jsoup
+cqCamelPartDescription: Cleanup HTML content
+cqExtensionPageTitle: Jsoup
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index d36bcdd0e0..1a5629540b 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -198,6 +198,7 @@
*** xref:reference/extensions/jira.adoc[Jira]
*** xref:reference/extensions/jolokia.adoc[Jolokia]
*** xref:reference/extensions/json-patch.adoc[JsonPatch]
+*** xref:reference/extensions/jsoup.adoc[Jsoup]
*** xref:reference/extensions/kafka.adoc[Kafka]
*** xref:reference/extensions/kamelet.adoc[Kamelet]
*** xref:reference/extensions/keycloak.adoc[Keycloak]
diff --git a/docs/modules/ROOT/pages/reference/extensions/iec60870.adoc b/docs/modules/ROOT/pages/reference/extensions/iec60870.adoc
index 34c4bf9e63..3a5f28563a 100644
--- a/docs/modules/ROOT/pages/reference/extensions/iec60870.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/iec60870.adoc
@@ -6,15 +6,15 @@
:cq-artifact-id: camel-quarkus-iec60870
:cq-native-supported: false
:cq-status: Preview
-:cq-status-deprecation: Preview
+:cq-status-deprecation: Preview Deprecated
:cq-description: IEC 60870 supervisory control and data acquisition (SCADA) client using NeoSCADA implementation.
-:cq-deprecated: false
+:cq-deprecated: true
:cq-jvm-since: 1.1.0
:cq-native-since: n/a
ifeval::[{doc-show-badges} == true]
[.badges]
-[.badge-key]##JVM since##[.badge-supported]##1.1.0## [.badge-key]##Native##[.badge-unsupported]##unsupported##
+[.badge-key]##JVM since##[.badge-supported]##1.1.0## [.badge-key]##Native##[.badge-unsupported]##unsupported## [.badge-key]##⚠️##[.badge-unsupported]##Deprecated##
endif::[]
IEC 60870 supervisory control and data acquisition (SCADA) client using NeoSCADA implementation.
diff --git a/docs/modules/ROOT/pages/reference/extensions/jsoup.adoc b/docs/modules/ROOT/pages/reference/extensions/jsoup.adoc
new file mode 100644
index 0000000000..5f30aa7434
--- /dev/null
+++ b/docs/modules/ROOT/pages/reference/extensions/jsoup.adoc
@@ -0,0 +1,45 @@
+// Do not edit directly!
+// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
+[id="extensions-jsoup"]
+= Jsoup
+:linkattrs:
+:cq-artifact-id: camel-quarkus-jsoup
+:cq-native-supported: true
+:cq-status: Stable
+:cq-status-deprecation: Stable
+:cq-description: Parse HTML using jsoup
+:cq-deprecated: false
+:cq-jvm-since: 3.36.0
+:cq-native-since: 3.36.0
+
+ifeval::[{doc-show-badges} == true]
+[.badges]
+[.badge-key]##JVM since##[.badge-supported]##3.36.0## [.badge-key]##Native since##[.badge-supported]##3.36.0##
+endif::[]
+
+Parse HTML using jsoup
+
+[id="extensions-jsoup-whats-inside"]
+== What's inside
+
+* xref:{cq-camel-components}:others:jsoup.adoc[Jsoup]
+
+Please refer to the above link for usage and configuration details.
+
+[id="extensions-jsoup-maven-coordinates"]
+== Maven coordinates
+
+https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-jsoup[Create a new project with this extension on {link-quarkus-code-generator}, window="_blank"]
+
+Or add the coordinates to your existing project:
+
+[source,xml]
+----
+<dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jsoup</artifactId>
+</dependency>
+----
+ifeval::[{doc-show-user-guide-link} == true]
+Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
+endif::[]
diff --git a/extensions/jsoup/deployment/pom.xml b/extensions/jsoup/deployment/pom.xml
new file mode 100644
index 0000000000..dfe53ed8b4
--- /dev/null
+++ b/extensions/jsoup/deployment/pom.xml
@@ -0,0 +1,61 @@
+<?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-jsoup-parent</artifactId>
+ <version>3.37.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-jsoup-deployment</artifactId>
+ <name>Camel Quarkus :: Jsoup :: Deployment</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-core-deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jsoup</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/jsoup/deployment/src/main/java/org/apache/camel/quarkus/component/jsoup/deployment/JsoupProcessor.java b/extensions/jsoup/deployment/src/main/java/org/apache/camel/quarkus/component/jsoup/deployment/JsoupProcessor.java
new file mode 100644
index 0000000000..5ea9f5f77c
--- /dev/null
+++ b/extensions/jsoup/deployment/src/main/java/org/apache/camel/quarkus/component/jsoup/deployment/JsoupProcessor.java
@@ -0,0 +1,31 @@
+/*
+ * 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.jsoup.deployment;
+
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+
+class JsoupProcessor {
+
+ private static final String FEATURE = "camel-jsoup";
+
+ @BuildStep
+ FeatureBuildItem feature() {
+ return new FeatureBuildItem(FEATURE);
+ }
+
+}
diff --git a/extensions/jsoup/pom.xml b/extensions/jsoup/pom.xml
new file mode 100644
index 0000000000..13e71722ae
--- /dev/null
+++ b/extensions/jsoup/pom.xml
@@ -0,0 +1,37 @@
+<?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-extensions</artifactId>
+ <version>3.37.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-jsoup-parent</artifactId>
+ <name>Camel Quarkus :: Jsoup</name>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>deployment</module>
+ <module>runtime</module>
+ </modules>
+</project>
diff --git a/extensions/jsoup/runtime/pom.xml b/extensions/jsoup/runtime/pom.xml
new file mode 100644
index 0000000000..3e50cff2cc
--- /dev/null
+++ b/extensions/jsoup/runtime/pom.xml
@@ -0,0 +1,70 @@
+<?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-jsoup-parent</artifactId>
+ <version>3.37.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-jsoup</artifactId>
+ <name>Camel Quarkus :: Jsoup :: Runtime</name>
+ <description>Parse HTML using jsoup</description>
+
+ <properties>
+ <camel.quarkus.jvmSince>3.36.0</camel.quarkus.jvmSince>
+ <camel.quarkus.nativeSince>3.36.0</camel.quarkus.nativeSince>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-jsoup</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-extension-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/jsoup/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/jsoup/runtime/src/main/resources/META-INF/quarkus-extension.yaml
new file mode 100644
index 0000000000..ee8a026b2d
--- /dev/null
+++ b/extensions/jsoup/runtime/src/main/resources/META-INF/quarkus-extension.yaml
@@ -0,0 +1,36 @@
+#
+# 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.
+#
+
+# This is a generated file. Do not edit directly!
+# To re-generate, run the following command from the top level directory:
+#
+# mvn -N cq:update-quarkus-metadata
+#
+---
+name: "Camel Jsoup"
+description: "Parse HTML using jsoup"
+metadata:
+ icon-url: "https://raw.githubusercontent.com/apache/camel-website/main/antora-ui-camel/src/img/logo-d.svg"
+ sponsor: "Apache Software Foundation"
+ guide: "https://camel.apache.org/camel-quarkus/latest/reference/extensions/jsoup.html"
+ categories:
+ - "integration"
+ status: "stable"
+ integrates:
+ - name: "Camel"
+ artifact: "org.apache.camel:camel-base"
+ version: "${camel.version}"
\ No newline at end of file
diff --git a/extensions/pom.xml b/extensions/pom.xml
index f709ba8fef..58a1390b6b 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -171,6 +171,7 @@
<module>jsonata</module>
<module>jsonb</module>
<module>jsonpath</module>
+ <module>jsoup</module>
<module>jt400</module>
<module>jta</module>
<module>kafka</module>
diff --git a/integration-tests/jsoup/pom.xml b/integration-tests/jsoup/pom.xml
new file mode 100644
index 0000000000..fd7d980ebc
--- /dev/null
+++ b/integration-tests/jsoup/pom.xml
@@ -0,0 +1,144 @@
+<?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-it</artifactId>
+ <version>3.37.0-SNAPSHOT</version>
+ <relativePath>../../poms/build-parent-it/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-integration-test-jsoup</artifactId>
+ <name>Camel Quarkus :: Integration Tests :: Jsoup</name>
+ <description>Integration tests for Camel Quarkus Jsoup extension</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jsoup</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-yaml-dsl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit</artifactId>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>rest-assured</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.native.enabled>true</quarkus.native.enabled>
+ </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>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>virtualDependencies</id>
+ <activation>
+ <property>
+ <name>!noVirtualDependencies</name>
+ </property>
+ </activation>
+ <dependencies>
+ <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jsoup-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-yaml-dsl-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/integration-tests/jsoup/src/main/java/org/apache/camel/quarkus/component/jsoup/it/JsoupResource.java b/integration-tests/jsoup/src/main/java/org/apache/camel/quarkus/component/jsoup/it/JsoupResource.java
new file mode 100644
index 0000000000..50477ae14c
--- /dev/null
+++ b/integration-tests/jsoup/src/main/java/org/apache/camel/quarkus/component/jsoup/it/JsoupResource.java
@@ -0,0 +1,91 @@
+/*
+ * 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.jsoup.it;
+
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Inject;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MediaType;
+import org.apache.camel.ProducerTemplate;
+
+@Path("/jsoup")
+@ApplicationScoped
+public class JsoupResource {
+
+ @Inject
+ ProducerTemplate producerTemplate;
+
+ @Path("/clean")
+ @POST
+ @Consumes(MediaType.TEXT_HTML)
+ @Produces(MediaType.TEXT_HTML)
+ public String clean(String html) {
+ return producerTemplate.requestBody("direct:clean", html, String.class);
+ }
+
+ @Path("/decode")
+ @POST
+ @Consumes(MediaType.TEXT_HTML)
+ @Produces(MediaType.TEXT_PLAIN)
+ public String decode(String html) {
+ return producerTemplate.requestBody("direct:decode", html, String.class);
+ }
+
+ @Path("/parse-title")
+ @POST
+ @Consumes(MediaType.TEXT_HTML)
+ @Produces(MediaType.TEXT_PLAIN)
+ public String parseTitle(String html) {
+ return producerTemplate.requestBody("direct:parse-title", html, String.class);
+ }
+
+ @Path("/select-css")
+ @POST
+ @Consumes(MediaType.TEXT_HTML)
+ @Produces(MediaType.TEXT_PLAIN)
+ public String selectCss(String html) {
+ return producerTemplate.requestBody("direct:select-css", html, String.class);
+ }
+
+ @Path("/clean-yaml")
+ @POST
+ @Consumes(MediaType.TEXT_HTML)
+ @Produces(MediaType.TEXT_HTML)
+ public String cleanYaml(String html) {
+ return producerTemplate.requestBody("direct:clean-yaml", html, String.class);
+ }
+
+ @Path("/decode-yaml")
+ @POST
+ @Consumes(MediaType.TEXT_HTML)
+ @Produces(MediaType.TEXT_PLAIN)
+ public String decodeYaml(String html) {
+ return producerTemplate.requestBody("direct:decode-yaml", html, String.class);
+ }
+
+ @Path("/parse-yaml")
+ @POST
+ @Consumes(MediaType.TEXT_HTML)
+ @Produces(MediaType.TEXT_HTML)
+ public String parseYaml(String html) {
+ org.jsoup.nodes.Document doc = producerTemplate.requestBody("direct:parse-yaml", html, org.jsoup.nodes.Document.class);
+ return doc != null ? doc.outerHtml() : "";
+ }
+}
diff --git a/integration-tests/jsoup/src/main/java/org/apache/camel/quarkus/component/jsoup/it/JsoupRouteBuilder.java b/integration-tests/jsoup/src/main/java/org/apache/camel/quarkus/component/jsoup/it/JsoupRouteBuilder.java
new file mode 100644
index 0000000000..53ba193fd5
--- /dev/null
+++ b/integration-tests/jsoup/src/main/java/org/apache/camel/quarkus/component/jsoup/it/JsoupRouteBuilder.java
@@ -0,0 +1,50 @@
+/*
+ * 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.jsoup.it;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.jsoup.nodes.Document;
+
+public class JsoupRouteBuilder extends RouteBuilder {
+ @Override
+ public void configure() {
+ // Test htmlClean() function
+ from("direct:clean")
+ .transform().simple("${htmlClean()}");
+
+ // Test htmlDecode() function
+ from("direct:decode")
+ .transform().simple("${htmlDecode()}");
+
+ // Test htmlParse() function - extract title
+ from("direct:parse-title")
+ .transform().simple("${htmlParse()}")
+ .process(exchange -> {
+ Document doc = exchange.getMessage().getBody(Document.class);
+ exchange.getMessage().setBody(doc.title());
+ });
+
+ // Test htmlParse() with CSS selection
+ from("direct:select-css")
+ .transform().simple("${htmlParse()}")
+ .process(exchange -> {
+ Document doc = exchange.getMessage().getBody(Document.class);
+ String text = doc.select("p").text();
+ exchange.getMessage().setBody(text);
+ });
+ }
+}
diff --git a/integration-tests/jsoup/src/main/resources/application.properties b/integration-tests/jsoup/src/main/resources/application.properties
new file mode 100644
index 0000000000..695ae2f5f3
--- /dev/null
+++ b/integration-tests/jsoup/src/main/resources/application.properties
@@ -0,0 +1,17 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+camel.main.routes-include-pattern = classpath:yaml/jsoup-routes.yaml
diff --git a/integration-tests/jsoup/src/main/resources/yaml/jsoup-routes.yaml b/integration-tests/jsoup/src/main/resources/yaml/jsoup-routes.yaml
new file mode 100644
index 0000000000..c41fbc7394
--- /dev/null
+++ b/integration-tests/jsoup/src/main/resources/yaml/jsoup-routes.yaml
@@ -0,0 +1,40 @@
+#
+# 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.
+#
+
+- route:
+ id: "clean-yaml"
+ from:
+ uri: "direct:clean-yaml"
+ steps:
+ - setBody:
+ simple: "${htmlClean()}"
+
+- route:
+ id: "decode-yaml"
+ from:
+ uri: "direct:decode-yaml"
+ steps:
+ - setBody:
+ simple: "${htmlDecode()}"
+
+- route:
+ id: "parse-yaml"
+ from:
+ uri: "direct:parse-yaml"
+ steps:
+ - setBody:
+ simple: "${htmlParse()}"
diff --git a/integration-tests/jsoup/src/test/java/org/apache/camel/quarkus/component/jsoup/it/JsoupIT.java b/integration-tests/jsoup/src/test/java/org/apache/camel/quarkus/component/jsoup/it/JsoupIT.java
new file mode 100644
index 0000000000..ec130d2e54
--- /dev/null
+++ b/integration-tests/jsoup/src/test/java/org/apache/camel/quarkus/component/jsoup/it/JsoupIT.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.quarkus.component.jsoup.it;
+
+import io.quarkus.test.junit.QuarkusIntegrationTest;
+
+@QuarkusIntegrationTest
+class JsoupIT extends JsoupTest {
+}
diff --git a/integration-tests/jsoup/src/test/java/org/apache/camel/quarkus/component/jsoup/it/JsoupTest.java b/integration-tests/jsoup/src/test/java/org/apache/camel/quarkus/component/jsoup/it/JsoupTest.java
new file mode 100644
index 0000000000..90701c5af7
--- /dev/null
+++ b/integration-tests/jsoup/src/test/java/org/apache/camel/quarkus/component/jsoup/it/JsoupTest.java
@@ -0,0 +1,161 @@
+/*
+ * 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.jsoup.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.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.not;
+
+@QuarkusTest
+class JsoupTest {
+
+ @Test
+ void testHtmlClean() {
+ String maliciousHtml = "<p><a href='https://example.com/' onclick='stealCookies()'>Link</a></p>";
+
+ RestAssured.given()
+ .contentType(ContentType.HTML)
+ .body(maliciousHtml)
+ .post("/jsoup/clean")
+ .then()
+ .statusCode(200)
+ .body(containsString("<a href=\"https://example.com/\""))
+ .body(containsString("Link"))
+ .body(not(containsString("onclick")));
+ }
+
+ @Test
+ void testHtmlDecode() {
+ String html = "<html><title>My Camel</title><body><p>Some blah blah</p></body></html>";
+
+ RestAssured.given()
+ .contentType(ContentType.HTML)
+ .body(html)
+ .post("/jsoup/decode")
+ .then()
+ .statusCode(200)
+ .body(equalTo("My Camel Some blah blah"));
+ }
+
+ @Test
+ void testHtmlParseTitle() {
+ String html = "<html><title>Test Title</title><body><p>Content</p></body></html>";
+
+ RestAssured.given()
+ .contentType(ContentType.HTML)
+ .body(html)
+ .post("/jsoup/parse-title")
+ .then()
+ .statusCode(200)
+ .body(equalTo("Test Title"));
+ }
+
+ @Test
+ void testCssSelection() {
+ String html = "<html><body><p>First paragraph</p><p>Second paragraph</p></body></html>";
+
+ RestAssured.given()
+ .contentType(ContentType.HTML)
+ .body(html)
+ .post("/jsoup/select-css")
+ .then()
+ .statusCode(200)
+ .body(equalTo("First paragraph Second paragraph"));
+ }
+
+ @Test
+ void testHtmlCleanYaml() {
+ String maliciousHtml = "<p><a href='https://example.com/' onclick='stealCookies()'>Link</a></p>";
+
+ RestAssured.given()
+ .contentType(ContentType.HTML)
+ .body(maliciousHtml)
+ .post("/jsoup/clean-yaml")
+ .then()
+ .statusCode(200)
+ .body(containsString("<a href=\"https://example.com/\""))
+ .body(containsString("Link"))
+ .body(not(containsString("onclick")));
+ }
+
+ @Test
+ void testHtmlDecodeYaml() {
+ String html = "<html><title>My Camel</title><body><p>Some blah blah</p></body></html>";
+
+ RestAssured.given()
+ .contentType(ContentType.HTML)
+ .body(html)
+ .post("/jsoup/decode-yaml")
+ .then()
+ .statusCode(200)
+ .body(equalTo("My Camel Some blah blah"));
+ }
+
+ @Test
+ void testHtmlParseYaml() {
+ String html = "<html><title>Test Title</title><body><p>Content</p></body></html>";
+
+ RestAssured.given()
+ .contentType(ContentType.HTML)
+ .body(html)
+ .post("/jsoup/parse-yaml")
+ .then()
+ .statusCode(200)
+ .body(containsString("<title>Test Title</title>"))
+ .body(containsString("<p>Content</p>"));
+ }
+
+ @Test
+ void testHtmlCleanEmptyInput() {
+ RestAssured.given()
+ .contentType(ContentType.HTML)
+ .body("")
+ .post("/jsoup/clean")
+ .then()
+ .statusCode(200)
+ .body(equalTo(""));
+ }
+
+ @Test
+ void testHtmlDecodeEmptyInput() {
+ RestAssured.given()
+ .contentType(ContentType.HTML)
+ .body("")
+ .post("/jsoup/decode")
+ .then()
+ .statusCode(200)
+ .body(equalTo(""));
+ }
+
+ @Test
+ void testHtmlParseNullBody() {
+ String html = "<html><body></body></html>";
+
+ RestAssured.given()
+ .contentType(ContentType.HTML)
+ .body(html)
+ .post("/jsoup/parse-title")
+ .then()
+ .statusCode(200)
+ .body(equalTo(""));
+ }
+}
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 8d17f9bc01..66c9e445b4 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -143,6 +143,7 @@
<module>json-validator</module>
<module>jsonata</module>
<module>jsonpath</module>
+ <module>jsoup</module>
<module>jt400</module>
<module>jt400-mocked</module>
<module>jta</module>
diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml
index 7269c3786f..53451d648f 100644
--- a/poms/bom/pom.xml
+++ b/poms/bom/pom.xml
@@ -1979,6 +1979,11 @@
<artifactId>camel-jsonpath</artifactId>
<version>${camel.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-jsoup</artifactId>
+ <version>${camel.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jt400</artifactId>
@@ -5164,6 +5169,16 @@
<artifactId>camel-quarkus-jsonpath-deployment</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jsoup</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jsoup-deployment</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jt400</artifactId>
@@ -7265,6 +7280,25 @@
<artifactId>org.hl7.fhir.utilities</artifactId>
<version>${hapi-fhir-core.version}</version>
</dependency>
+ <dependency>
+ <groupId>com.atlassian.jira</groupId>
+ <artifactId>jira-rest-java-client-core</artifactId>
+ <version>${jira-rest-client.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>com.atlassian.sal</groupId>
+ <artifactId>sal-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.codehaus.jettison</groupId>
+ <artifactId>jettison</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<dependency>
<groupId>com.dylibso.chicory</groupId>
<artifactId>runtime</artifactId>
diff --git a/tooling/scripts/test-categories.yaml b/tooling/scripts/test-categories.yaml
index a8fc7b6e6f..83e2a615ef 100644
--- a/tooling/scripts/test-categories.yaml
+++ b/tooling/scripts/test-categories.yaml
@@ -210,6 +210,7 @@ group-11:
- google-secret-manager
- grok
- jolt
+ - jsoup
- jsonata
- langchain4j-tokenizer
- milo