This is an automated email from the ASF dual-hosted git repository.

ppalaga pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


The following commit(s) were added to refs/heads/main by this push:
     new 75bc1a9  Qute component improperly classified as other in Camel 
Quarkus Catalog #2508
75bc1a9 is described below

commit 75bc1a9252aeb807c8aeaed1dc1b92a559574c28
Author: Peter Palaga <ppal...@redhat.com>
AuthorDate: Fri Apr 23 17:31:14 2021 +0200

    Qute component improperly classified as other in Camel Quarkus Catalog #2508
---
 extensions/qute/runtime/pom.xml                         |  1 +
 .../camel/quarkus/maven/CamelQuarkusExtension.java      | 17 +++++++++++++++--
 .../camel/quarkus/maven/PrepareCatalogQuarkusMojo.java  | 12 +++++++++++-
 3 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/extensions/qute/runtime/pom.xml b/extensions/qute/runtime/pom.xml
index 1deb5db..9b32cf0 100644
--- a/extensions/qute/runtime/pom.xml
+++ b/extensions/qute/runtime/pom.xml
@@ -33,6 +33,7 @@
     <properties>
         <camel.quarkus.jvmSince>1.0.0</camel.quarkus.jvmSince>
         <camel.quarkus.nativeSince>1.0.0</camel.quarkus.nativeSince>
+        <camel.quarkus.kind>component</camel.quarkus.kind>
     </properties>
 
     <dependencyManagement>
diff --git 
a/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/CamelQuarkusExtension.java
 
b/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/CamelQuarkusExtension.java
index 0c9ad43..b4c288f 100644
--- 
a/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/CamelQuarkusExtension.java
+++ 
b/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/CamelQuarkusExtension.java
@@ -26,6 +26,7 @@ import java.util.List;
 import java.util.Optional;
 import java.util.Properties;
 
+import org.apache.camel.catalog.Kind;
 import org.apache.maven.model.Dependency;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
@@ -38,6 +39,7 @@ public class CamelQuarkusExtension {
 
     public static final String CAMEL_QUARKUS_JVM_SINCE = 
"camel.quarkus.jvmSince";
     public static final String CAMEL_QUARKUS_NATIVE_SINCE = 
"camel.quarkus.nativeSince";
+    public static final String CAMEL_QUARKUS_KIND = "camel.quarkus.kind";
 
     public static CamelQuarkusExtension read(Path runtimePomXmlPath) {
         try (Reader runtimeReader = Files.newBufferedReader(runtimePomXmlPath, 
StandardCharsets.UTF_8)) {
@@ -74,6 +76,9 @@ public class CamelQuarkusExtension {
             final boolean unlisted = !nativeSupported
                     || 
Boolean.parseBoolean(props.getProperty("quarkus.metadata.unlisted", "false"));
 
+            final String rawKind = (String) props.get(CAMEL_QUARKUS_KIND);
+            final Kind kind = rawKind == null ? null : Kind.valueOf(rawKind);
+
             return new CamelQuarkusExtension(
                     runtimePomXmlPath,
                     camelComponentArtifactId,
@@ -87,7 +92,8 @@ public class CamelQuarkusExtension {
                     nativeSupported,
                     status,
                     unlisted,
-                    deps == null ? Collections.emptyList() : 
Collections.unmodifiableList(deps));
+                    deps == null ? Collections.emptyList() : 
Collections.unmodifiableList(deps),
+                    kind);
         } catch (IOException | XmlPullParserException e) {
             throw new RuntimeException("Could not read " + runtimePomXmlPath, 
e);
         }
@@ -106,6 +112,7 @@ public class CamelQuarkusExtension {
     private final List<Dependency> dependencies;
     private final ExtensionStatus status;
     private final boolean unlisted;
+    private final Kind kind;
 
     public CamelQuarkusExtension(
             Path runtimePomXmlPath,
@@ -120,7 +127,8 @@ public class CamelQuarkusExtension {
             boolean nativeSupported,
             ExtensionStatus status,
             boolean unlisted,
-            List<Dependency> dependencies) {
+            List<Dependency> dependencies,
+            Kind kind) {
         super();
         this.runtimePomXmlPath = runtimePomXmlPath;
         this.camelComponentArtifactId = camelComponentArtifactId;
@@ -135,6 +143,7 @@ public class CamelQuarkusExtension {
         this.status = status;
         this.unlisted = unlisted;
         this.dependencies = dependencies;
+        this.kind = kind;
     }
 
     public String getVersion() {
@@ -193,4 +202,8 @@ public class CamelQuarkusExtension {
         return unlisted;
     }
 
+    public Kind getKind() {
+        return kind;
+    }
+
 }
diff --git 
a/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/PrepareCatalogQuarkusMojo.java
 
b/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/PrepareCatalogQuarkusMojo.java
index 873e667..6e02e04 100644
--- 
a/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/PrepareCatalogQuarkusMojo.java
+++ 
b/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/PrepareCatalogQuarkusMojo.java
@@ -94,7 +94,17 @@ public class PrepareCatalogQuarkusMojo extends AbstractMojo {
                                 final CamelQuarkusExtension ext = 
CamelQuarkusExtension.read(runtimePomXmlPath);
                                 final boolean nativeSupported = 
ext.isNativeSupported();
                                 if (models.isEmpty()) {
-                                    final OtherModel model = new OtherModel();
+                                    final ArtifactModel<?> model;
+                                    final Kind extKind = ext.getKind();
+                                    if (extKind == Kind.component) {
+                                        model = new ComponentModel();
+                                    } else if (extKind == Kind.language) {
+                                        model = new LanguageModel();
+                                    } else if (extKind == Kind.dataformat) {
+                                        model = new DataFormatModel();
+                                    } else {
+                                        model = new OtherModel();
+                                    }
                                     final String name = 
ext.getRuntimeArtifactId().replace("camel-quarkus-", "");
                                     model.setName(name);
                                     final String title = 
ext.getName().orElseThrow(() -> new RuntimeException(

Reply via email to