You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2019/11/04 16:10:24 UTC

[camel-k] branch master updated (98b0698 -> 4f6886a)

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

astefanutti pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git.


    from 98b0698  fix(dev): Update Operator SDK module checksum mismatch
     new bbf9b3a  feat(quarkus): Initial Quarkus support
     new 57cfaac  chore(build): Load Camel catalog as builder step
     new 57f134e  chore(catalog): Move DefaultCatalog method into camel package
     new 7b8eddc  feat(quarkus): Setup Camel Quarkus catalog generate command
     new 5267041  feat(quarkus): Add initial Camel Quarkus catalog
     new 02288f6  feat(quarkus): Introduce Runtime Provider API
     new e6f0281  feat(quarkus): Support loading Camel Quarkus catalog
     new a453b66  feat(quarkus): Sanitize Camel Quarkus dependencies
     new c4f37cf  fix(quarkus): Catalog exact matching logic should take runtime provider into account
     new bf77dc8  feat(quarkus): Only load catalogs matching the specified runtime provider
     new ca9810b  feat(quarkus): Fix reported artifact IDs
     new 139e9da  feat(quarkus): Do not contribute artifacts to classpath
     new d9380d0  feat(quarkus): Start shaping a runtime trait interface
     new 131108d  feat(quarkus): Support the camel-quarkus dependency protocol
     new 768b56d  feat(quarkus): Use the camel-quarkus protocol for language dependencies
     new 171fef5  feat(quarkus): Support mapping source dependencies to Camel Quarkus extensions
     new dcfb8a3  fix(build): Set build with Camel catalog runtime version for exact matching
     new 081e3e6  feat(quarkus): Add Camel Quarkus and Quarkus versions trait configuration options
     new 8e62c25  feat(quarkus): Rely on Build runtime properties to source dependencies versions
     new 495c620  fix(quarkus): Avoid nil pointer dereference panic on catalog lookup
     new 2e3c089  feat(quarkus): Add default values for Camel Quarkus / Quarkus versions and constraints
     new a50369e  chore(quarkus): Move LocalRepository field to MavenSpec
     new bc20fe1  chore(quarkus): Factorize Camel catalog runtime generation logic
     new 86df7cf  feat(quarkus): Support generating Camel Quarkus catalog on the flight
     new 35e53f3  chore(test): Remove redundant type conversions
     new 1066a89  fix(lint): Use regexp.MustCompile
     new 9ff6f5b  fix(Quarkus): Fix on the flight Camel catalog generation
     new 0423106  feat(quarkus): Filter kits based on integration or catalog runtime provider info
     new fb6d637  feat(quarkus): Use runtime provider label selector to list kits
     new f9bdc9e  feat(quarkus): Add Quarkus trait documentation
     new 1c7ca96  feat(quarkus): Add Camel Quarkus dependency to catalog generation profile
     new 0bf9b81  feat(quarkus): Add Camel Quarkus dependency to on-the-flight catalog generation
     new b1fd43b  fix(quarkus): Let Camel Quarkus drive the Camel version for catalog generation
     new 5a0d37b  feat(quarkus): Upgrade Camel Quarkus to version 0.3.0 and Quarkus to version 0.26.1
     new 9ec0333  feat(quarkus): Update Camel Quarkus catalog
     new ced7f5f  feat(quarkus): Prepare catalogs for Camel runtime version 1.0.7
     new 21778fe  feat(quarkus): Fix camel catalog names
     new 4f6886a  feat(quarkus): Use the Camel K runtime plugin to list runtime dependencies

The 38 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 assets/json-schema/CamelCatalog.json               |   26 +
 assets/json-schema/Integration.json                |   26 +
 assets/json-schema/IntegrationKit.json             |   26 +
 build/maven/pom-catalog.xml                        |  166 +-
 ...=> camel-catalog-3.0.0-RC1-1.0.7-SNAPSHOT.yaml} |    6 +-
 ...camel-catalog-quarkus-0.3.0-1.0.7-SNAPSHOT.yaml |  337 +++
 deploy/resources.go                                | 2557 ++++++++++++++++++++
 docs/modules/ROOT/pages/traits.adoc                |   18 +
 pkg/apis/camel/v1alpha1/build_types.go             |   21 +-
 pkg/apis/camel/v1alpha1/camelcatalog_types.go      |    7 +-
 pkg/apis/camel/v1alpha1/common_types.go            |   16 +-
 pkg/apis/camel/v1alpha1/integration_types.go       |    1 +
 .../camel/v1alpha1/integration_types_support.go    |    4 +-
 pkg/apis/camel/v1alpha1/integrationkit_types.go    |   23 +-
 .../camel/v1alpha1/integrationplatform_types.go    |    2 +-
 pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go   |   62 +
 pkg/builder/builder.go                             |   10 -
 pkg/builder/builder_steps.go                       |  176 +-
 pkg/builder/builder_steps_test.go                  |  182 +-
 pkg/builder/builder_test.go                        |    7 +-
 pkg/builder/builder_utils.go                       |   65 -
 pkg/builder/builder_utils_test.go                  |   87 -
 pkg/builder/kaniko/kaniko.go                       |   10 +-
 pkg/builder/runtime/main.go                        |  125 +
 .../main_test.go}                                  |  263 +-
 pkg/builder/runtime/quarkus.go                     |  149 ++
 .../{kaniko/kaniko.go => runtime/runtime.go}       |   55 +-
 pkg/builder/s2i/s2i.go                             |   10 +-
 pkg/cmd/completion_bash.go                         |    4 +-
 pkg/cmd/describe_platform.go                       |    2 +-
 pkg/cmd/install.go                                 |    2 +-
 pkg/cmd/kit_create.go                              |    2 +
 pkg/controller/integration/build_kit.go            |    4 +
 pkg/controller/integration/util.go                 |   64 +-
 pkg/controller/integrationkit/build.go             |   16 +-
 pkg/controller/integrationplatform/initialize.go   |    6 +-
 pkg/metadata/metadata_dependencies_test.go         |   69 +-
 pkg/metadata/metadata_http_test.go                 |   24 +-
 pkg/metadata/metadata_uri_test.go                  |   20 +-
 pkg/trait/builder.go                               |   17 +-
 pkg/trait/builder_test.go                          |   23 +-
 pkg/trait/camel.go                                 |  200 +-
 pkg/trait/camel_test.go                            |   32 +-
 pkg/trait/classpath.go                             |   15 +-
 pkg/trait/container_test.go                        |   21 +-
 pkg/trait/debug_test.go                            |   10 +-
 pkg/trait/dependencies.go                          |   51 +-
 pkg/trait/dependencies_test.go                     |   18 +-
 pkg/trait/environment.go                           |    8 +-
 pkg/trait/environment_test.go                      |   15 +-
 pkg/trait/gc.go                                    |   11 +-
 pkg/trait/istio_test.go                            |   11 +-
 pkg/trait/knative_service_test.go                  |   22 +-
 pkg/trait/knative_test.go                          |   20 +-
 pkg/trait/owner_test.go                            |    2 +-
 pkg/trait/quarkus.go                               |  216 ++
 pkg/trait/rest-dsl.go                              |    8 +-
 pkg/trait/route_test.go                            |   25 +-
 pkg/trait/service_test.go                          |   33 +-
 pkg/trait/trait_catalog.go                         |    6 +
 pkg/trait/trait_test.go                            |   52 +-
 pkg/trait/trait_types.go                           |   34 -
 pkg/trait/util.go                                  |    2 +
 pkg/util/camel/camel_runtime.go                    |   30 +-
 pkg/util/camel/camel_runtime_catalog.go            |    6 +-
 pkg/util/camel/camel_util.go                       |   60 +-
 pkg/util/camel/camel_util_test.go                  |   20 +-
 pkg/util/camel/catalog.go                          |  172 ++
 pkg/util/camel/catalog_test.go                     |   47 +
 .../controller/util.go}                            |   13 +-
 pkg/util/defaults/defaults.go                      |   12 +
 pkg/util/maven/maven.go                            |   11 +-
 pkg/util/maven/maven_types.go                      |    2 +
 pkg/util/source/inspector.go                       |   48 +-
 pkg/util/test/catalog.go                           |   47 -
 pkg/util/test/catalog_test.go                      |    7 +-
 script/Makefile                                    |   19 +-
 script/build_catalog.sh                            |   21 +-
 78 files changed, 4708 insertions(+), 1309 deletions(-)
 copy deploy/{camel-catalog-3.0.0-RC1-1.0.5.yaml => camel-catalog-3.0.0-RC1-1.0.7-SNAPSHOT.yaml} (99%)
 create mode 100644 deploy/camel-catalog-quarkus-0.3.0-1.0.7-SNAPSHOT.yaml
 delete mode 100644 pkg/builder/builder_utils_test.go
 create mode 100644 pkg/builder/runtime/main.go
 copy pkg/builder/{builder_steps_test.go => runtime/main_test.go} (53%)
 create mode 100644 pkg/builder/runtime/quarkus.go
 copy pkg/builder/{kaniko/kaniko.go => runtime/runtime.go} (50%)
 create mode 100644 pkg/trait/quarkus.go
 create mode 100644 pkg/util/camel/catalog.go
 create mode 100644 pkg/util/camel/catalog_test.go
 copy pkg/{controller/add_integrationkit.go => util/controller/util.go} (76%)
 delete mode 100644 pkg/util/test/catalog.go


[camel-k] 20/38: fix(quarkus): Avoid nil pointer dereference panic on catalog lookup

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 495c620abe1dee672fface09829ae118fe644083
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Thu Oct 24 18:33:51 2019 +0200

    fix(quarkus): Avoid nil pointer dereference panic on catalog lookup
---
 pkg/metadata/metadata_dependencies_test.go | 1 +
 pkg/util/camel/camel_util.go               | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/pkg/metadata/metadata_dependencies_test.go b/pkg/metadata/metadata_dependencies_test.go
index a3654f9..2268cfb 100644
--- a/pkg/metadata/metadata_dependencies_test.go
+++ b/pkg/metadata/metadata_dependencies_test.go
@@ -131,6 +131,7 @@ func TestDependenciesQuarkus(t *testing.T) {
 
 	catalog, err := camel.QuarkusCatalog()
 	assert.Nil(t, err)
+	assert.NotNil(t, catalog)
 
 	meta := Extract(catalog, code)
 
diff --git a/pkg/util/camel/camel_util.go b/pkg/util/camel/camel_util.go
index a368284..e3949ef 100644
--- a/pkg/util/camel/camel_util.go
+++ b/pkg/util/camel/camel_util.go
@@ -56,6 +56,9 @@ func findBestMatch(catalogs []v1alpha1.CamelCatalog, camelVersion string, runtim
 			return nil, nil
 		}
 		for _, c := range cc {
+			if c.Catalog.Spec.RuntimeProvider == nil || c.Catalog.Spec.RuntimeProvider.Quarkus == nil {
+				continue
+			}
 			qv, err := semver.NewVersion(c.Catalog.Spec.RuntimeProvider.Quarkus.QuarkusVersion)
 			if err != nil {
 				log.Debugf("Invalid semver version (quarkus) %s", qv)


[camel-k] 16/38: feat(quarkus): Support mapping source dependencies to Camel Quarkus extensions

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 171fef512c81a7bef745d35e2ffd15da706c1402
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Oct 23 16:27:04 2019 +0200

    feat(quarkus): Support mapping source dependencies to Camel Quarkus extensions
---
 pkg/util/source/inspector.go | 45 ++++++++++++++++++++++++++++++--------------
 1 file changed, 31 insertions(+), 14 deletions(-)

diff --git a/pkg/util/source/inspector.go b/pkg/util/source/inspector.go
index 4ee8897..aae2df7 100644
--- a/pkg/util/source/inspector.go
+++ b/pkg/util/source/inspector.go
@@ -37,20 +37,31 @@ var (
 	doubleQuotedToF  = regexp.MustCompile(`\.toF\s*\(\s*"([a-zA-Z0-9-]+:[^"]+)"`)
 	languageRegexp   = regexp.MustCompile(`language\s*\(\s*["|']([a-zA-Z0-9-]+[^"|']+)["|']\s*,.*\)`)
 
-	additionalDependencies = map[string]string{
-		`.*JsonLibrary\.Jackson.*`:                         "camel:jackson",
-		`.*\.hystrix().*`:                                  "camel:hystrix",
-		`.*restConfiguration().*`:                          "camel:rest",
-		`.*rest(("[a-zA-Z0-9-/]+")*).*`:                    "camel:rest",
-		`^\s*rest\s*{.*`:                                   "camel:rest",
-		`.*\.groovy\s*\(.*\).*`:                            "camel:groovy",
-		`.*\.?(jsonpath|jsonpathWriteAsString)\s*\(.*\).*`: "camel:jsonpath",
-		`.*\.ognl\s*\(.*\).*`:                              "camel:ognl",
-		`.*\.mvel\s*\(.*\).*`:                              "camel:mvel",
-		`.*\.?simple\s*\(.*\).*`:                           "camel:bean",
-		`.*\.xquery\s*\(.*\).*`:                            "camel:saxon",
-		`.*\.?xpath\s*\(.*\).*`:                            "camel:xpath",
-		`.*\.xtokenize\s*\(.*\).*`:                         "camel:jaxp",
+	sourceDependencies = struct {
+		main    map[string]string
+		quarkus map[string]string
+	}{
+		main: map[string]string{
+			`.*JsonLibrary\.Jackson.*`:                         "camel:jackson",
+			`.*\.hystrix().*`:                                  "camel:hystrix",
+			`.*restConfiguration().*`:                          "camel:rest",
+			`.*rest(("[a-zA-Z0-9-/]+")*).*`:                    "camel:rest",
+			`^\s*rest\s*{.*`:                                   "camel:rest",
+			`.*\.groovy\s*\(.*\).*`:                            "camel:groovy",
+			`.*\.?(jsonpath|jsonpathWriteAsString)\s*\(.*\).*`: "camel:jsonpath",
+			`.*\.ognl\s*\(.*\).*`:                              "camel:ognl",
+			`.*\.mvel\s*\(.*\).*`:                              "camel:mvel",
+			`.*\.?simple\s*\(.*\).*`:                           "camel:bean",
+			`.*\.xquery\s*\(.*\).*`:                            "camel:saxon",
+			`.*\.?xpath\s*\(.*\).*`:                            "camel:xpath",
+			`.*\.xtokenize\s*\(.*\).*`:                         "camel:jaxp",
+		},
+		quarkus: map[string]string{
+			`.*restConfiguration().*`:       "camel-quarkus:rest",
+			`.*rest(("[a-zA-Z0-9-/]+")*).*`: "camel-quarkus:rest",
+			`^\s*rest\s*{.*`:                "camel-quarkus:rest",
+			`.*\.?simple\s*\(.*\).*`:        "camel-quarkus:bean",
+		},
 	}
 )
 
@@ -121,6 +132,12 @@ func (i *baseInspector) discoverDependencies(source v1alpha1.SourceSpec, meta *M
 		}
 	}
 
+	var additionalDependencies map[string]string
+	if i.catalog.RuntimeProvider != nil && i.catalog.RuntimeProvider.Quarkus != nil {
+		additionalDependencies = sourceDependencies.quarkus
+	} else {
+		additionalDependencies = sourceDependencies.main
+	}
 	for pattern, dep := range additionalDependencies {
 		pat := regexp.MustCompile(pattern)
 		if pat.MatchString(source.Content) {


[camel-k] 12/38: feat(quarkus): Do not contribute artifacts to classpath

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 139e9dac0a160754b52801265532d79ce8bc9b22
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Oct 23 12:19:28 2019 +0200

    feat(quarkus): Do not contribute artifacts to classpath
---
 pkg/trait/classpath.go | 15 ++++++++++-----
 pkg/trait/quarkus.go   |  4 ++++
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/pkg/trait/classpath.go b/pkg/trait/classpath.go
index fba666c..b050e61 100644
--- a/pkg/trait/classpath.go
+++ b/pkg/trait/classpath.go
@@ -22,13 +22,13 @@ import (
 	"sort"
 	"strings"
 
-	"github.com/apache/camel-k/pkg/util/envvar"
-
-	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/pkg/errors"
 	"github.com/scylladb/go-set/strset"
 
 	k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
+
+	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/util/envvar"
 )
 
 type classpathTrait struct {
@@ -78,8 +78,13 @@ func (t *classpathTrait) Apply(e *Environment) error {
 	e.Classpath.Add("/etc/camel/resources")
 	e.Classpath.Add("./resources")
 
-	for _, artifact := range kit.Status.Artifacts {
-		e.Classpath.Add(artifact.Target)
+	quarkus := e.Catalog.GetTrait("quarkus").(*quarkusTrait)
+	if quarkus.isEnabled() {
+		quarkus.addClasspath(e)
+	} else {
+		for _, artifact := range kit.Status.Artifacts {
+			e.Classpath.Add(artifact.Target)
+		}
 	}
 
 	if kit.Labels["camel.apache.org/kit.type"] == v1alpha1.IntegrationKitTypeExternal {
diff --git a/pkg/trait/quarkus.go b/pkg/trait/quarkus.go
index 2be0cac..37085ed 100644
--- a/pkg/trait/quarkus.go
+++ b/pkg/trait/quarkus.go
@@ -78,6 +78,10 @@ func (t *quarkusTrait) addBuildSteps(e *Environment) {
 	e.Steps = append(e.Steps, runtime.QuarkusSteps...)
 }
 
+func (t *quarkusTrait) addClasspath(e *Environment) {
+	// No-op as we rely on the Quarkus runner
+}
+
 func (t *quarkusTrait) addRuntimeDependencies(e *Environment, dependencies *[]string) error {
 	for _, s := range e.Integration.Sources() {
 		meta := metadata.Extract(e.CamelCatalog, s)


[camel-k] 14/38: feat(quarkus): Support the camel-quarkus dependency protocol

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 131108db6aa97753d6334731c53de1576dc63ab2
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Oct 23 15:29:17 2019 +0200

    feat(quarkus): Support the camel-quarkus dependency protocol
---
 pkg/apis/camel/v1alpha1/integration_types_support.go | 4 +++-
 pkg/builder/builder_steps.go                         | 8 ++++++++
 pkg/cmd/kit_create.go                                | 2 ++
 pkg/metadata/metadata_dependencies_test.go           | 4 ++--
 pkg/util/source/inspector.go                         | 3 +++
 5 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/pkg/apis/camel/v1alpha1/integration_types_support.go b/pkg/apis/camel/v1alpha1/integration_types_support.go
index 9a63d8f..0f4891e 100644
--- a/pkg/apis/camel/v1alpha1/integration_types_support.go
+++ b/pkg/apis/camel/v1alpha1/integration_types_support.go
@@ -86,7 +86,9 @@ func (in *IntegrationSpec) AddDependency(dependency string) {
 		in.Dependencies = make([]string, 0)
 	}
 	newDep := dependency
-	if strings.HasPrefix(newDep, "camel-") {
+	if strings.HasPrefix(newDep, "camel-quarkus") {
+		newDep = "camel-quarkus:" + strings.TrimPrefix(dependency, "camel-quarkus-")
+	} else if strings.HasPrefix(newDep, "camel-") {
 		newDep = "camel:" + strings.TrimPrefix(dependency, "camel-")
 	}
 	for _, d := range in.Dependencies {
diff --git a/pkg/builder/builder_steps.go b/pkg/builder/builder_steps.go
index 878ef56..23d15be 100644
--- a/pkg/builder/builder_steps.go
+++ b/pkg/builder/builder_steps.go
@@ -152,6 +152,14 @@ func injectDependencies(ctx *Context) error {
 			}
 
 			ctx.Maven.Project.AddDependencyGAV("org.apache.camel.k", artifactID, "")
+		case strings.HasPrefix(d, "camel-quarkus:"):
+			artifactID := strings.TrimPrefix(d, "camel-quarkus:")
+
+			if !strings.HasPrefix(artifactID, "camel-quarkus-") {
+				artifactID = "camel-quarkus-" + artifactID
+			}
+
+			ctx.Maven.Project.AddDependencyGAV("org.apache.camel.quarkus", artifactID, "")
 		case strings.HasPrefix(d, "mvn:"):
 			mid := strings.TrimPrefix(d, "mvn:")
 			gav := strings.Replace(mid, "/", ":", -1)
diff --git a/pkg/cmd/kit_create.go b/pkg/cmd/kit_create.go
index 1b8d89a..f9475ef 100644
--- a/pkg/cmd/kit_create.go
+++ b/pkg/cmd/kit_create.go
@@ -142,6 +142,8 @@ func (command *kitCreateCommand) run(_ *cobra.Command, args []string) error {
 			ctx.Spec.Dependencies = append(ctx.Spec.Dependencies, item)
 		case strings.HasPrefix(item, "file:"):
 			ctx.Spec.Dependencies = append(ctx.Spec.Dependencies, item)
+		case strings.HasPrefix(item, "camel-quarkus-"):
+			ctx.Spec.Dependencies = append(ctx.Spec.Dependencies, "camel-quarkus:"+strings.TrimPrefix(item, "camel-quarkus-"))
 		case strings.HasPrefix(item, "camel-"):
 			ctx.Spec.Dependencies = append(ctx.Spec.Dependencies, "camel:"+strings.TrimPrefix(item, "camel-"))
 		}
diff --git a/pkg/metadata/metadata_dependencies_test.go b/pkg/metadata/metadata_dependencies_test.go
index bd1ceea..a3654f9 100644
--- a/pkg/metadata/metadata_dependencies_test.go
+++ b/pkg/metadata/metadata_dependencies_test.go
@@ -136,8 +136,8 @@ func TestDependenciesQuarkus(t *testing.T) {
 
 	assert.ElementsMatch(t,
 		[]string{
-			"mvn:org.apache.camel.quarkus:camel-quarkus-log:",
-			"mvn:org.apache.camel.quarkus:camel-quarkus-twitter:",
+			"camel-quarkus:log",
+			"camel-quarkus:twitter",
 		},
 		meta.Dependencies.List())
 }
diff --git a/pkg/util/source/inspector.go b/pkg/util/source/inspector.go
index 942900b..4ee8897 100644
--- a/pkg/util/source/inspector.go
+++ b/pkg/util/source/inspector.go
@@ -148,6 +148,9 @@ func (i *baseInspector) decodeComponent(uri string) string {
 		if component.GroupID == "org.apache.camel" && strings.HasPrefix(artifactID, "camel-") {
 			return "camel:" + artifactID[6:]
 		}
+		if component.GroupID == "org.apache.camel.quarkus" && strings.HasPrefix(artifactID, "camel-quarkus-") {
+			return "camel-quarkus:" + artifactID[14:]
+		}
 		return "mvn:" + component.GroupID + ":" + artifactID + ":" + component.Version
 	}
 	return ""


[camel-k] 04/38: feat(quarkus): Setup Camel Quarkus catalog generate command

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 7b8eddccf68e90f140a8ac4bbc61062c120f7f66
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Tue Oct 22 15:20:01 2019 +0200

    feat(quarkus): Setup Camel Quarkus catalog generate command
---
 build/maven/pom-catalog.xml | 164 ++++++++++++++++++++++++++------------------
 script/Makefile             |   4 +-
 script/build_catalog.sh     |  21 +++---
 3 files changed, 113 insertions(+), 76 deletions(-)

diff --git a/build/maven/pom-catalog.xml b/build/maven/pom-catalog.xml
index a1ec921..51d24a3 100644
--- a/build/maven/pom-catalog.xml
+++ b/build/maven/pom-catalog.xml
@@ -21,37 +21,109 @@
          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>
     <groupId>org.apache.camel.k</groupId>
     <artifactId>camel-k-catalog-generator</artifactId>
     <version>1.0.0</version>
 
-    <build>
-        <defaultGoal>generate-resources</defaultGoal>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.camel.k</groupId>
-                <artifactId>camel-k-maven-plugin</artifactId>
-                <version>${runtime.version}</version>
-                <executions>
-                    <execution>
-                        <id>generate-catalog</id>
-                        <goals>
-                            <goal>generate-catalog</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <dependencies>
-                    <dependency>
-                        <groupId>org.apache.camel</groupId>
-                        <artifactId>camel-catalog</artifactId>
-                        <version>${camel.version}</version>
-                    </dependency>
-                </dependencies>
-            </plugin>
-        </plugins>
-    </build>
+    <profiles>
+        <profile>
+            <id>main</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <build>
+                <defaultGoal>generate-resources</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.camel.k</groupId>
+                        <artifactId>camel-k-maven-plugin</artifactId>
+                        <version>${runtime.version}</version>
+                        <executions>
+                            <execution>
+                                <id>generate-catalog</id>
+                                <goals>
+                                    <goal>generate-catalog</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                        <dependencies>
+                            <dependency>
+                                <groupId>org.apache.camel</groupId>
+                                <artifactId>camel-catalog</artifactId>
+                                <version>${camel.version}</version>
+                            </dependency>
+                        </dependencies>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>quarkus</id>
+            <build>
+                <defaultGoal>generate-resources</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.camel.k</groupId>
+                        <artifactId>camel-k-maven-plugin</artifactId>
+                        <version>${runtime.version}</version>
+                        <executions>
+                            <execution>
+                                <id>generate-catalog</id>
+                                <goals>
+                                    <goal>generate-catalog</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                        <dependencies>
+                            <dependency>
+                                <groupId>org.apache.camel</groupId>
+                                <artifactId>camel-catalog</artifactId>
+                                <version>${camel.version}</version>
+                            </dependency>
+                            <dependency>
+                                <groupId>org.apache.camel.quarkus</groupId>
+                                <artifactId>camel-catalog-quarkus</artifactId>
+                                <version>${camel-quarkus.version}</version>
+                            </dependency>
+                        </dependencies>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>staging</id>
+            <activation>
+                <property>
+                    <name>staging.repo</name>
+                </property>
+            </activation>
+            <repositories>
+                <repository>
+                    <id>staging</id>
+                    <url>${staging.repo}</url>
+                    <releases>
+                        <enabled>true</enabled>
+                    </releases>
+                    <snapshots>
+                        <enabled>false</enabled>
+                    </snapshots>
+                </repository>
+            </repositories>
+            <pluginRepositories>
+                <pluginRepository>
+                    <id>staging</id>
+                    <url>${staging.repo}</url>
+                    <releases>
+                        <enabled>true</enabled>
+                    </releases>
+                    <snapshots>
+                        <enabled>false</enabled>
+                    </snapshots>
+                </pluginRepository>
+            </pluginRepositories>
+        </profile>
+    </profiles>
 
     <repositories>
         <repository>
@@ -99,44 +171,4 @@
         </pluginRepository>
     </pluginRepositories>
 
-
-    <profiles>
-        <profile>
-            <id>staging</id>
-            <activation>
-                <property>
-                    <name>staging.repo</name>
-                </property>
-            </activation>
-
-            <repositories>
-                <repository>
-                    <id>staging</id>
-                    <url>${staging.repo}</url>
-                    <releases>
-                        <enabled>true</enabled>
-                    </releases>
-                    <snapshots>
-                        <enabled>false</enabled>
-                    </snapshots>
-                </repository>
-            </repositories>
-
-            <pluginRepositories>
-                <pluginRepository>
-                    <id>staging</id>
-                    <url>${staging.repo}</url>
-                    <releases>
-                        <enabled>true</enabled>
-                    </releases>
-                    <snapshots>
-                        <enabled>false</enabled>
-                    </snapshots>
-                </pluginRepository>
-            </pluginRepositories>
-
-        </profile>
-    </profiles>
-
-
 </project>
diff --git a/script/Makefile b/script/Makefile
index a89df30..e639858 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -20,6 +20,7 @@ RUNTIME_VERSION := 1.0.6
 RUNTIME_VERSION_CONSTRAINT := >=1.0.5
 CAMEL_VERSION := 3.0.0-RC1
 CAMEL_VERSION_CONSTRAINT := >=3.0.0-RC1
+CAMEL_QUARKUS_VERSION := 0.2.1-SNAPSHOT
 KANIKO_VERSION := 0.9.0
 BASE_IMAGE := fabric8/s2i-java:3.0-java8
 LOCAL_REPOSITORY := /tmp/artifacts/m2
@@ -123,7 +124,8 @@ build-kamel:
 	go build $(GOFLAGS) -o kamel ./cmd/kamel/*.go
 
 build-resources:
-	./script/build_catalog.sh $(CAMEL_VERSION) $(RUNTIME_VERSION) $(STAGING_RUNTIME_REPO)
+	./script/build_catalog.sh $(CAMEL_VERSION) $(RUNTIME_VERSION) -Dstaging.repo=$(STAGING_RUNTIME_REPO) -Pmain -Dcatalog.file=camel-catalog-$(CAMEL_VERSION)-$(RUNTIME_VERSION).yaml
+	./script/build_catalog.sh $(CAMEL_VERSION) $(RUNTIME_VERSION) -Dstaging.repo=$(STAGING_RUNTIME_REPO) -Pquarkus -Dcatalog.runtime=quarkus -Dcamel-quarkus.version=$(CAMEL_QUARKUS_VERSION) -Dcatalog.file=camel-catalog-quarkus-$(CAMEL_QUARKUS_VERSION)-$(RUNTIME_VERSION).yaml
 	./script/embed_resources.sh deploy
 	go run cmd/util/json-schema-gen/jsonschemagen.go --out=./assets/json-schema
 
diff --git a/script/build_catalog.sh b/script/build_catalog.sh
index c0eb9c6..f4b2ae4 100755
--- a/script/build_catalog.sh
+++ b/script/build_catalog.sh
@@ -18,14 +18,17 @@
 location=$(dirname $0)
 rootdir=$location/../
 
-if [ "$#" -lt 2 ] || [ "$#" -gt 3 ]; then
-    echo "usage: $0 catalog.version runtime.version [staging.repo]"
-    exit 1
-fi
-
-$rootdir/mvnw -q \
+if [ "$#" -ge 2 ]; then
+  camelVersion="$1"
+  runtimeVersion="$2"
+  shift 2
+  $rootdir/mvnw -q \
     -f ${rootdir}/build/maven/pom-catalog.xml \
     -Dcatalog.path=${rootdir}/deploy \
-    -Dcamel.version=$1 \
-    -Druntime.version=$2 \
-    -Dstaging.repo=$3
+    -Dcamel.version=$camelVersion \
+    -Druntime.version=$runtimeVersion \
+    "$@"
+else
+  echo "usage: $0 catalog.version runtime.version catalog.runtime [staging.repo]"
+  exit 1
+fi


[camel-k] 03/38: chore(catalog): Move DefaultCatalog method into camel package

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 57f134e35bdeed74eeeb4612f1ae810631803878
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Mon Oct 21 17:07:46 2019 +0200

    chore(catalog): Move DefaultCatalog method into camel package
---
 pkg/builder/builder_steps_test.go          | 11 ++++----
 pkg/builder/builder_test.go                |  7 ++---
 pkg/builder/runtime/main_test.go           | 10 +++----
 pkg/cmd/completion_bash.go                 |  4 +--
 pkg/metadata/metadata_dependencies_test.go | 42 +++++++++++++++---------------
 pkg/metadata/metadata_http_test.go         | 24 ++++++++---------
 pkg/metadata/metadata_uri_test.go          | 20 +++++++-------
 pkg/trait/builder_test.go                  | 11 ++++----
 pkg/trait/container_test.go                | 13 +++++----
 pkg/trait/debug_test.go                    | 10 +++----
 pkg/trait/dependencies_test.go             | 13 ++++-----
 pkg/trait/environment_test.go              | 15 +++++------
 pkg/trait/istio_test.go                    | 11 ++++----
 pkg/trait/knative_service_test.go          | 16 ++++++------
 pkg/trait/knative_test.go                  | 20 +++++++-------
 pkg/trait/route_test.go                    | 13 +++++----
 pkg/trait/service_test.go                  | 15 +++++------
 pkg/trait/trait_test.go                    | 12 ++++-----
 pkg/util/camel/camel_runtime.go            |  2 +-
 pkg/util/camel/camel_util.go               | 16 +++++-------
 pkg/util/camel/camel_util_test.go          | 20 +++++++-------
 pkg/util/{test => camel}/catalog.go        | 11 ++++----
 pkg/util/test/catalog_test.go              |  7 ++---
 23 files changed, 160 insertions(+), 163 deletions(-)

diff --git a/pkg/builder/builder_steps_test.go b/pkg/builder/builder_steps_test.go
index c950477..1985dee 100644
--- a/pkg/builder/builder_steps_test.go
+++ b/pkg/builder/builder_steps_test.go
@@ -20,14 +20,15 @@ package builder
 import (
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/util/camel"
 	"github.com/apache/camel-k/pkg/util/cancellable"
 	"github.com/apache/camel-k/pkg/util/test"
-
-	"github.com/stretchr/testify/assert"
 )
 
 type testSteps struct {
@@ -50,7 +51,7 @@ func TestRegisterDuplicatedSteps(t *testing.T) {
 }
 
 func TestMavenSettingsFromConfigMap(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	c, err := test.NewFakeClient(
@@ -102,7 +103,7 @@ func TestMavenSettingsFromConfigMap(t *testing.T) {
 }
 
 func TestMavenSettingsFromSecret(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	c, err := test.NewFakeClient(
@@ -154,7 +155,7 @@ func TestMavenSettingsFromSecret(t *testing.T) {
 }
 
 func TestListPublishedImages(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	c, err := test.NewFakeClient(
diff --git a/pkg/builder/builder_test.go b/pkg/builder/builder_test.go
index ca899ae..3ef98aa 100644
--- a/pkg/builder/builder_test.go
+++ b/pkg/builder/builder_test.go
@@ -21,10 +21,11 @@ import (
 	"errors"
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/util/camel"
 	"github.com/apache/camel-k/pkg/util/test"
-
-	"github.com/stretchr/testify/assert"
 )
 
 type errorTestSteps struct {
@@ -33,7 +34,7 @@ type errorTestSteps struct {
 }
 
 func TestFailure(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	c, err := test.NewFakeClient()
diff --git a/pkg/builder/runtime/main_test.go b/pkg/builder/runtime/main_test.go
index e98b813..89c3d56 100644
--- a/pkg/builder/runtime/main_test.go
+++ b/pkg/builder/runtime/main_test.go
@@ -24,12 +24,12 @@ import (
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/builder"
+	"github.com/apache/camel-k/pkg/util/camel"
 	"github.com/apache/camel-k/pkg/util/maven"
-	"github.com/apache/camel-k/pkg/util/test"
 )
 
 func TestNewProject(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	ctx := builder.Context{
@@ -91,7 +91,7 @@ func TestNewProject(t *testing.T) {
 }
 
 func TestGenerateJvmProject(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	ctx := builder.Context{
@@ -148,7 +148,7 @@ func TestGenerateJvmProject(t *testing.T) {
 }
 
 func TestGenerateGroovyProject(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	ctx := builder.Context{
@@ -209,7 +209,7 @@ func TestGenerateGroovyProject(t *testing.T) {
 }
 
 func TestSanitizeDependencies(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	ctx := builder.Context{
diff --git a/pkg/cmd/completion_bash.go b/pkg/cmd/completion_bash.go
index ee53550..0cdc16c 100644
--- a/pkg/cmd/completion_bash.go
+++ b/pkg/cmd/completion_bash.go
@@ -25,8 +25,6 @@ import (
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 
-	"github.com/apache/camel-k/pkg/util/test"
-
 	"github.com/apache/camel-k/pkg/platform"
 
 	"github.com/apache/camel-k/pkg/trait"
@@ -254,7 +252,7 @@ func configureBashAnnotationForFlag(command *cobra.Command, flagName string, ann
 }
 
 func computeCamelDependencies() string {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	if err != nil || catalog == nil {
 		catalog = camel.NewRuntimeCatalog(v1alpha1.CamelCatalog{}.Spec)
 	}
diff --git a/pkg/metadata/metadata_dependencies_test.go b/pkg/metadata/metadata_dependencies_test.go
index cb86863..d0919b5 100644
--- a/pkg/metadata/metadata_dependencies_test.go
+++ b/pkg/metadata/metadata_dependencies_test.go
@@ -20,10 +20,10 @@ package metadata
 import (
 	"testing"
 
-	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
-	"github.com/apache/camel-k/pkg/util/test"
-
 	"github.com/stretchr/testify/assert"
+
+	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/util/camel"
 )
 
 func TestDependenciesJavaSource(t *testing.T) {
@@ -41,7 +41,7 @@ func TestDependenciesJavaSource(t *testing.T) {
 		Language: v1alpha1.LanguageJavaSource,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -63,7 +63,7 @@ func TestDependenciesJavaScript(t *testing.T) {
 		Language: v1alpha1.LanguageJavaScript,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -87,7 +87,7 @@ func TestDependenciesGroovy(t *testing.T) {
 		Language: v1alpha1.LanguageGroovy,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -108,7 +108,7 @@ func TestDependencies(t *testing.T) {
 		Language: v1alpha1.LanguageJavaSource,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -127,7 +127,7 @@ func TestJacksonDependency(t *testing.T) {
 		Language: v1alpha1.LanguageJavaSource,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -154,7 +154,7 @@ func TestLanguageDependencies(t *testing.T) {
 		Language: v1alpha1.LanguageJavaSource,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -177,7 +177,7 @@ func TestLanguageDependenciesTransformExpression(t *testing.T) {
 		Language: v1alpha1.LanguageJavaSource,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -199,7 +199,7 @@ func TestHystrixDependency(t *testing.T) {
 		Language: v1alpha1.LanguageGroovy,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -222,7 +222,7 @@ func TestRestDependency(t *testing.T) {
 		Language: v1alpha1.LanguageGroovy,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -245,7 +245,7 @@ func TestRestWithPathDependency(t *testing.T) {
 		Language: v1alpha1.LanguageGroovy,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -267,7 +267,7 @@ func TestRestConfigurationDependency(t *testing.T) {
 		Language: v1alpha1.LanguageGroovy,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -289,7 +289,7 @@ func TestRestClosureDependency(t *testing.T) {
 		Language: v1alpha1.LanguageGroovy,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -315,7 +315,7 @@ func TestXMLHystrixDependency(t *testing.T) {
 		Language: v1alpha1.LanguageXML,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -345,7 +345,7 @@ func TestXMLRestDependency(t *testing.T) {
 		Language: v1alpha1.LanguageXML,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -394,7 +394,7 @@ func TestXMLLanguageDependencies(t *testing.T) {
 		Language: v1alpha1.LanguageXML,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -453,7 +453,7 @@ func TestYAMLRestDependency(t *testing.T) {
 		Language: v1alpha1.LanguageYaml,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -471,7 +471,7 @@ func TestYAMLHystrixDependency(t *testing.T) {
 		Language: v1alpha1.LanguageYaml,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -488,7 +488,7 @@ func TestYAMLLanguageDependencies(t *testing.T) {
 		Language: v1alpha1.LanguageYaml,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
diff --git a/pkg/metadata/metadata_http_test.go b/pkg/metadata/metadata_http_test.go
index edf80b7..2bbaa3d 100644
--- a/pkg/metadata/metadata_http_test.go
+++ b/pkg/metadata/metadata_http_test.go
@@ -20,10 +20,10 @@ package metadata
 import (
 	"testing"
 
-	"github.com/apache/camel-k/pkg/util/test"
+	"github.com/stretchr/testify/assert"
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
-	"github.com/stretchr/testify/assert"
+	"github.com/apache/camel-k/pkg/util/camel"
 )
 
 func TestHttpJavaSource(t *testing.T) {
@@ -39,7 +39,7 @@ func TestHttpJavaSource(t *testing.T) {
 		Language: v1alpha1.LanguageJavaSource,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -62,7 +62,7 @@ func TestHttpOnlyJavaSource(t *testing.T) {
 		Language: v1alpha1.LanguageJavaSource,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -83,7 +83,7 @@ func TestHttpOnlyJavaSourceRest(t *testing.T) {
 		Language: v1alpha1.LanguageJavaSource,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -104,7 +104,7 @@ func TestHttpOnlyJavaSourceRest2(t *testing.T) {
 		Language: v1alpha1.LanguageJavaSource,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -126,7 +126,7 @@ func TestNoHttpGroovySource(t *testing.T) {
 		Language: v1alpha1.LanguageGroovy,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -148,7 +148,7 @@ func TestHttpOnlyGroovySource(t *testing.T) {
 		Language: v1alpha1.LanguageGroovy,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -170,7 +170,7 @@ func TestHttpXMLSource(t *testing.T) {
 		Language: v1alpha1.LanguageXML,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -193,7 +193,7 @@ func TestHttpOnlyXMLSource(t *testing.T) {
 		Language: v1alpha1.LanguageXML,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := Extract(catalog, code)
@@ -227,7 +227,7 @@ func TestMultilangHTTPOnlySource(t *testing.T) {
 		},
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := ExtractAll(catalog, codes)
@@ -263,7 +263,7 @@ func TestMultilangHTTPSource(t *testing.T) {
 		},
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	meta := ExtractAll(catalog, codes)
diff --git a/pkg/metadata/metadata_uri_test.go b/pkg/metadata/metadata_uri_test.go
index 74d6133..16c8e33 100644
--- a/pkg/metadata/metadata_uri_test.go
+++ b/pkg/metadata/metadata_uri_test.go
@@ -20,10 +20,10 @@ package metadata
 import (
 	"testing"
 
-	"github.com/apache/camel-k/pkg/util/test"
+	"github.com/stretchr/testify/assert"
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
-	"github.com/stretchr/testify/assert"
+	"github.com/apache/camel-k/pkg/util/camel"
 )
 
 func TestJava1(t *testing.T) {
@@ -46,7 +46,7 @@ func TestJava1(t *testing.T) {
 		Language: v1alpha1.LanguageJavaSource,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	metadata := Extract(catalog, source)
@@ -83,7 +83,7 @@ func TestJava2(t *testing.T) {
 		Language: v1alpha1.LanguageJavaSource,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	metadata := Extract(catalog, source)
@@ -115,7 +115,7 @@ func TestGroovy1(t *testing.T) {
 		Language: v1alpha1.LanguageGroovy,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	metadata := Extract(catalog, source)
@@ -145,7 +145,7 @@ func TestGroovy2(t *testing.T) {
 		Language: v1alpha1.LanguageGroovy,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	metadata := Extract(catalog, source)
@@ -180,7 +180,7 @@ func TestXml1(t *testing.T) {
 		Language: v1alpha1.LanguageXML,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	metadata := Extract(catalog, source)
@@ -214,7 +214,7 @@ func TestKotlin1(t *testing.T) {
 		Language: v1alpha1.LanguageKotlin,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	metadata := Extract(catalog, source)
@@ -245,7 +245,7 @@ func TestJavascript1(t *testing.T) {
 		Language: v1alpha1.LanguageJavaScript,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	metadata := Extract(catalog, source)
@@ -281,7 +281,7 @@ func TestJYaml(t *testing.T) {
 		Language: v1alpha1.LanguageYaml,
 	}
 
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	metadata := Extract(catalog, source)
diff --git a/pkg/trait/builder_test.go b/pkg/trait/builder_test.go
index e3ae69e..651d522 100644
--- a/pkg/trait/builder_test.go
+++ b/pkg/trait/builder_test.go
@@ -21,6 +21,9 @@ import (
 	"context"
 	"testing"
 
+	"github.com/scylladb/go-set/strset"
+	"github.com/stretchr/testify/assert"
+
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 
@@ -28,13 +31,9 @@ import (
 	"github.com/apache/camel-k/pkg/builder"
 	"github.com/apache/camel-k/pkg/builder/kaniko"
 	"github.com/apache/camel-k/pkg/builder/s2i"
+	"github.com/apache/camel-k/pkg/util/camel"
 	"github.com/apache/camel-k/pkg/util/defaults"
 	"github.com/apache/camel-k/pkg/util/kubernetes"
-	"github.com/apache/camel-k/pkg/util/test"
-
-	"github.com/stretchr/testify/assert"
-
-	"github.com/scylladb/go-set/strset"
 )
 
 func TestBuilderTraitNotAppliedBecauseOfNilKit(t *testing.T) {
@@ -120,7 +119,7 @@ func TestKanikoBuilderTrait(t *testing.T) {
 }
 
 func createBuilderTestEnv(cluster v1alpha1.IntegrationPlatformCluster, strategy v1alpha1.IntegrationPlatformBuildPublishStrategy) *Environment {
-	c, err := test.DefaultCatalog()
+	c, err := camel.DefaultCatalog()
 	if err != nil {
 		panic(err)
 	}
diff --git a/pkg/trait/container_test.go b/pkg/trait/container_test.go
index f5793cc..10e8787 100644
--- a/pkg/trait/container_test.go
+++ b/pkg/trait/container_test.go
@@ -22,19 +22,18 @@ import (
 	"testing"
 
 	"github.com/scylladb/go-set/strset"
-
-	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
-	"github.com/apache/camel-k/pkg/util/kubernetes"
-	"github.com/apache/camel-k/pkg/util/test"
+	"github.com/stretchr/testify/assert"
 
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 
-	"github.com/stretchr/testify/assert"
+	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/util/camel"
+	"github.com/apache/camel-k/pkg/util/kubernetes"
 )
 
 func TestContainerWithDefaults(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	traitCatalog := NewCatalog(context.TODO(), nil)
@@ -89,7 +88,7 @@ func TestContainerWithDefaults(t *testing.T) {
 }
 
 func TestContainerWithCustomName(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	traitCatalog := NewCatalog(context.TODO(), nil)
diff --git a/pkg/trait/debug_test.go b/pkg/trait/debug_test.go
index b01fdd0..4968b1f 100644
--- a/pkg/trait/debug_test.go
+++ b/pkg/trait/debug_test.go
@@ -20,17 +20,17 @@ package trait
 import (
 	"testing"
 
-	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
-	"github.com/apache/camel-k/pkg/util/envvar"
-	"github.com/apache/camel-k/pkg/util/test"
-
 	"github.com/stretchr/testify/assert"
 
 	corev1 "k8s.io/api/core/v1"
+
+	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/util/camel"
+	"github.com/apache/camel-k/pkg/util/envvar"
 )
 
 func TestDebugTraitApplicability(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	env := Environment{
diff --git a/pkg/trait/dependencies_test.go b/pkg/trait/dependencies_test.go
index 8e75159..fe3bed8 100644
--- a/pkg/trait/dependencies_test.go
+++ b/pkg/trait/dependencies_test.go
@@ -20,9 +20,10 @@ package trait
 import (
 	"testing"
 
-	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
-	"github.com/apache/camel-k/pkg/util/test"
 	"github.com/stretchr/testify/assert"
+
+	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/util/camel"
 )
 
 func TestDependenciesTraitApplicability(t *testing.T) {
@@ -48,7 +49,7 @@ func TestDependenciesTraitApplicability(t *testing.T) {
 }
 
 func TestIntegrationDefaultDeps(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	e := &Environment{
@@ -91,7 +92,7 @@ func TestIntegrationDefaultDeps(t *testing.T) {
 }
 
 func TestIntegrationCustomDeps(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	e := &Environment{
@@ -139,7 +140,7 @@ func TestIntegrationCustomDeps(t *testing.T) {
 }
 
 func TestIntegrationAutoGeneratedDeps(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	e := &Environment{
@@ -193,7 +194,7 @@ func TestIntegrationAutoGeneratedDeps(t *testing.T) {
 }
 
 func TestIntegrationCustomLoader(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	e := &Environment{
diff --git a/pkg/trait/environment_test.go b/pkg/trait/environment_test.go
index ca5929d..977ab4b 100644
--- a/pkg/trait/environment_test.go
+++ b/pkg/trait/environment_test.go
@@ -22,20 +22,19 @@ import (
 	"testing"
 
 	"github.com/scylladb/go-set/strset"
-
-	"github.com/apache/camel-k/pkg/util/test"
-
-	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
-	"github.com/apache/camel-k/pkg/util/kubernetes"
 	"github.com/stretchr/testify/assert"
 
 	appsv1 "k8s.io/api/apps/v1"
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/util/camel"
+	"github.com/apache/camel-k/pkg/util/kubernetes"
 )
 
 func TestDefaultEnvironment(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	env := Environment{
@@ -96,7 +95,7 @@ func TestDefaultEnvironment(t *testing.T) {
 }
 
 func TestEnabledContainerMetaDataEnvVars(t *testing.T) {
-	c, err := test.DefaultCatalog()
+	c, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	env := Environment{
@@ -164,7 +163,7 @@ func TestEnabledContainerMetaDataEnvVars(t *testing.T) {
 }
 
 func TestDisabledContainerMetaDataEnvVars(t *testing.T) {
-	c, err := test.DefaultCatalog()
+	c, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	env := Environment{
diff --git a/pkg/trait/istio_test.go b/pkg/trait/istio_test.go
index cd5830f..3671420 100644
--- a/pkg/trait/istio_test.go
+++ b/pkg/trait/istio_test.go
@@ -20,21 +20,22 @@ package trait
 import (
 	"testing"
 
-	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
-	"github.com/apache/camel-k/pkg/util/kubernetes"
-	"github.com/apache/camel-k/pkg/util/test"
-
 	"github.com/stretchr/testify/assert"
 
 	appsv1 "k8s.io/api/apps/v1"
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
 	servingv1 "knative.dev/serving/pkg/apis/serving/v1"
 	serving "knative.dev/serving/pkg/apis/serving/v1beta1"
+
+	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/util/camel"
+	"github.com/apache/camel-k/pkg/util/kubernetes"
 )
 
 func NewIstioTestEnv(t *testing.T, d *appsv1.Deployment, s *serving.Service, enabled bool) Environment {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	env := Environment{
diff --git a/pkg/trait/knative_service_test.go b/pkg/trait/knative_service_test.go
index 0af56d9..da9708d 100644
--- a/pkg/trait/knative_service_test.go
+++ b/pkg/trait/knative_service_test.go
@@ -22,17 +22,17 @@ import (
 	"testing"
 
 	"github.com/scylladb/go-set/strset"
-
-	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
-	"github.com/apache/camel-k/pkg/util/envvar"
-	"github.com/apache/camel-k/pkg/util/kubernetes"
-	"github.com/apache/camel-k/pkg/util/test"
+	"github.com/stretchr/testify/assert"
 
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	serving "knative.dev/serving/pkg/apis/serving/v1beta1"
 
-	"github.com/stretchr/testify/assert"
+	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/util/camel"
+	"github.com/apache/camel-k/pkg/util/envvar"
+	"github.com/apache/camel-k/pkg/util/kubernetes"
+	"github.com/apache/camel-k/pkg/util/test"
 )
 
 const (
@@ -41,7 +41,7 @@ const (
 )
 
 func TestKnativeService(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	traitCatalog := NewCatalog(context.TODO(), nil)
@@ -183,7 +183,7 @@ func TestKnativeService(t *testing.T) {
 }
 
 func TestKnativeServiceWithCustomContainerName(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	traitCatalog := NewCatalog(context.TODO(), nil)
diff --git a/pkg/trait/knative_test.go b/pkg/trait/knative_test.go
index 8cf3084..13038e5 100644
--- a/pkg/trait/knative_test.go
+++ b/pkg/trait/knative_test.go
@@ -21,28 +21,30 @@ import (
 	"context"
 	"testing"
 
-	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
-	"github.com/apache/camel-k/pkg/client"
-	"github.com/apache/camel-k/pkg/util/envvar"
-	"github.com/apache/camel-k/pkg/util/test"
-
 	"github.com/scylladb/go-set/strset"
 	"github.com/stretchr/testify/assert"
 
-	knativeapi "github.com/apache/camel-k/pkg/apis/camel/v1alpha1/knative"
-	k8sutils "github.com/apache/camel-k/pkg/util/kubernetes"
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
 	messaging "knative.dev/eventing/pkg/apis/messaging/v1alpha1"
 	"knative.dev/pkg/apis"
 	duckv1 "knative.dev/pkg/apis/duck/v1"
 	duckv1alpha1 "knative.dev/pkg/apis/duck/v1alpha1"
 	servingv1 "knative.dev/serving/pkg/apis/serving/v1"
 	serving "knative.dev/serving/pkg/apis/serving/v1beta1"
+
+	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	knativeapi "github.com/apache/camel-k/pkg/apis/camel/v1alpha1/knative"
+	"github.com/apache/camel-k/pkg/client"
+	"github.com/apache/camel-k/pkg/util/camel"
+	"github.com/apache/camel-k/pkg/util/envvar"
+	k8sutils "github.com/apache/camel-k/pkg/util/kubernetes"
+	"github.com/apache/camel-k/pkg/util/test"
 )
 
 func TestKnativeEnvConfigurationFromTrait(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	traitCatalog := NewCatalog(context.TODO(), nil)
@@ -141,7 +143,7 @@ func TestKnativeEnvConfigurationFromTrait(t *testing.T) {
 }
 
 func TestKnativeEnvConfigurationFromSource(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	traitCatalog := NewCatalog(context.TODO(), nil)
diff --git a/pkg/trait/route_test.go b/pkg/trait/route_test.go
index 0d270fc..6e7e74b 100644
--- a/pkg/trait/route_test.go
+++ b/pkg/trait/route_test.go
@@ -22,22 +22,21 @@ import (
 	"testing"
 
 	"github.com/rs/xid"
-
 	"github.com/scylladb/go-set/strset"
-
-	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
-	"github.com/apache/camel-k/pkg/util/kubernetes"
-	"github.com/apache/camel-k/pkg/util/test"
-
 	"github.com/stretchr/testify/assert"
 
 	routev1 "github.com/openshift/api/route/v1"
+
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/util/camel"
+	"github.com/apache/camel-k/pkg/util/kubernetes"
 )
 
 func createTestRouteEnvironment(t *testing.T, name string) *Environment {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	return &Environment{
diff --git a/pkg/trait/service_test.go b/pkg/trait/service_test.go
index fb5f6f5..095ab00 100644
--- a/pkg/trait/service_test.go
+++ b/pkg/trait/service_test.go
@@ -22,16 +22,15 @@ import (
 	"testing"
 
 	"github.com/scylladb/go-set/strset"
-
-	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
-	"github.com/apache/camel-k/pkg/util/kubernetes"
-	"github.com/apache/camel-k/pkg/util/test"
+	"github.com/stretchr/testify/assert"
 
 	appsv1 "k8s.io/api/apps/v1"
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 
-	"github.com/stretchr/testify/assert"
+	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/util/camel"
+	"github.com/apache/camel-k/pkg/util/kubernetes"
 )
 
 const (
@@ -40,7 +39,7 @@ const (
 )
 
 func TestServiceWithDefaults(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	traitCatalog := NewCatalog(context.TODO(), nil)
@@ -128,7 +127,7 @@ func TestServiceWithDefaults(t *testing.T) {
 }
 
 func TestService(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	traitCatalog := NewCatalog(context.TODO(), nil)
@@ -226,7 +225,7 @@ func TestService(t *testing.T) {
 }
 
 func TestServiceWithCustomContainerName(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	traitCatalog := NewCatalog(context.TODO(), nil)
diff --git a/pkg/trait/trait_test.go b/pkg/trait/trait_test.go
index 44ddda6..3729e0d 100644
--- a/pkg/trait/trait_test.go
+++ b/pkg/trait/trait_test.go
@@ -22,17 +22,17 @@ import (
 	"testing"
 
 	"github.com/scylladb/go-set/strset"
-
-	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
-	"github.com/apache/camel-k/pkg/util/kubernetes"
-	"github.com/apache/camel-k/pkg/util/test"
+	"github.com/stretchr/testify/assert"
 
 	routev1 "github.com/openshift/api/route/v1"
-	"github.com/stretchr/testify/assert"
 
 	appsv1 "k8s.io/api/apps/v1"
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/util/camel"
+	"github.com/apache/camel-k/pkg/util/kubernetes"
 )
 
 const (
@@ -391,7 +391,7 @@ func processTestEnv(t *testing.T, env *Environment) *kubernetes.Collection {
 }
 
 func createTestEnv(t *testing.T, cluster v1alpha1.IntegrationPlatformCluster, script string) *Environment {
-	catalog, err := test.DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	return &Environment{
diff --git a/pkg/util/camel/camel_runtime.go b/pkg/util/camel/camel_runtime.go
index 71bac5f..a0d502a 100644
--- a/pkg/util/camel/camel_runtime.go
+++ b/pkg/util/camel/camel_runtime.go
@@ -38,7 +38,7 @@ func LoadCatalog(ctx context.Context, client client.Client, namespace string, ca
 		return nil, err
 	}
 
-	catalog, err = FindBestMatch(list.Items, camelVersion, runtimeVersion)
+	catalog, err = findBestMatch(list.Items, camelVersion, runtimeVersion)
 	if err != nil {
 		return nil, err
 	}
diff --git a/pkg/util/camel/camel_util.go b/pkg/util/camel/camel_util.go
index 4741222..ae80ac7 100644
--- a/pkg/util/camel/camel_util.go
+++ b/pkg/util/camel/camel_util.go
@@ -21,25 +21,25 @@ import (
 	"sort"
 
 	"github.com/Masterminds/semver"
+
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/util/log"
 )
 
-// FindBestMatch --
-func FindBestMatch(catalogs []v1alpha1.CamelCatalog, camelVersion string, runtimeVersion string) (*RuntimeCatalog, error) {
+func findBestMatch(catalogs []v1alpha1.CamelCatalog, camelVersion string, runtimeVersion string) (*RuntimeCatalog, error) {
 	for _, catalog := range catalogs {
 		if catalog.Spec.Version == camelVersion && catalog.Spec.RuntimeVersion == runtimeVersion {
 			return NewRuntimeCatalog(catalog.Spec), nil
 		}
 	}
 
-	vc := NewSemVerConstraint(camelVersion)
-	rc := NewSemVerConstraint(runtimeVersion)
+	vc := newSemVerConstraint(camelVersion)
+	rc := newSemVerConstraint(runtimeVersion)
 	if vc == nil || rc == nil {
 		return nil, nil
 	}
 
-	cc := NewCatalogVersionCollection(catalogs)
+	cc := newCatalogVersionCollection(catalogs)
 	for _, x := range cc {
 		if vc.Check(x.Version) && rc.Check(x.RuntimeVersion) {
 			return NewRuntimeCatalog(x.Catalog.Spec), nil
@@ -49,8 +49,7 @@ func FindBestMatch(catalogs []v1alpha1.CamelCatalog, camelVersion string, runtim
 	return nil, nil
 }
 
-// NewSemVerConstraint --
-func NewSemVerConstraint(versionConstraint string) *semver.Constraints {
+func newSemVerConstraint(versionConstraint string) *semver.Constraints {
 	constraint, err := semver.NewConstraint(versionConstraint)
 	if err != nil || constraint == nil {
 		if err != nil {
@@ -64,8 +63,7 @@ func NewSemVerConstraint(versionConstraint string) *semver.Constraints {
 	return constraint
 }
 
-// NewCatalogVersionCollection --
-func NewCatalogVersionCollection(catalogs []v1alpha1.CamelCatalog) CatalogVersionCollection {
+func newCatalogVersionCollection(catalogs []v1alpha1.CamelCatalog) CatalogVersionCollection {
 	versions := make([]CatalogVersion, 0, len(catalogs))
 
 	for i := range catalogs {
diff --git a/pkg/util/camel/camel_util_test.go b/pkg/util/camel/camel_util_test.go
index 5dff8ab..456556a 100644
--- a/pkg/util/camel/camel_util_test.go
+++ b/pkg/util/camel/camel_util_test.go
@@ -32,7 +32,7 @@ func TestFindBestMatch_Camel(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := FindBestMatch(catalogs, "~2.23.x", "1.0.0")
+	c, err := findBestMatch(catalogs, "~2.23.x", "1.0.0")
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.1", c.Version)
@@ -45,7 +45,7 @@ func TestFindBestMatch_Runtime(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := FindBestMatch(catalogs, "2.23.0", "~1.0.x")
+	c, err := findBestMatch(catalogs, "2.23.0", "~1.0.x")
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.0", c.Version)
@@ -60,7 +60,7 @@ func TestFindBestMatch(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := FindBestMatch(catalogs, "~2.23.x", "~1.0.x")
+	c, err := findBestMatch(catalogs, "~2.23.x", "~1.0.x")
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.1", c.Version)
@@ -74,7 +74,7 @@ func TestFindExactSemVerMatch_Camel(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := FindBestMatch(catalogs, "2.23.0", "1.0.0")
+	c, err := findBestMatch(catalogs, "2.23.0", "1.0.0")
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.0", c.Version)
@@ -87,7 +87,7 @@ func TestFindExactSemVerMatch_Runtime(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := FindBestMatch(catalogs, "2.23.0", "1.0.0")
+	c, err := findBestMatch(catalogs, "2.23.0", "1.0.0")
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.0", c.Version)
@@ -102,7 +102,7 @@ func TestFindExactMatch_Camel(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := FindBestMatch(catalogs, "2.23.1-tag-00001", "1.0.0")
+	c, err := findBestMatch(catalogs, "2.23.1-tag-00001", "1.0.0")
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.1-tag-00001", c.Version)
@@ -116,7 +116,7 @@ func TestFindExactMatch_Runtime(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := FindBestMatch(catalogs, "2.23.1-tag-00001", "1.0.1")
+	c, err := findBestMatch(catalogs, "2.23.1-tag-00001", "1.0.1")
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.1-tag-00001", c.Version)
@@ -131,7 +131,7 @@ func TestFindRangeMatch_Camel(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := FindBestMatch(catalogs, ">= 2.23.0, < 2.23.2", "1.0.0")
+	c, err := findBestMatch(catalogs, ">= 2.23.0, < 2.23.2", "1.0.0")
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.1", c.Version)
@@ -146,7 +146,7 @@ func TestFindRangeMatch_Runtime(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := FindBestMatch(catalogs, "2.23.0", "> 1.0.1, < 1.0.3")
+	c, err := findBestMatch(catalogs, "2.23.0", "> 1.0.1, < 1.0.3")
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.0", c.Version)
@@ -163,7 +163,7 @@ func TestFindRangeMatch(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := FindBestMatch(catalogs, ">= 2.23.0, < 2.23.2", "> 1.0.1, < 1.0.3")
+	c, err := findBestMatch(catalogs, ">= 2.23.0, < 2.23.2", "> 1.0.1, < 1.0.3")
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.1", c.Version)
diff --git a/pkg/util/test/catalog.go b/pkg/util/camel/catalog.go
similarity index 85%
rename from pkg/util/test/catalog.go
rename to pkg/util/camel/catalog.go
index b20b9c3..4b8df56 100644
--- a/pkg/util/test/catalog.go
+++ b/pkg/util/camel/catalog.go
@@ -15,21 +15,20 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-package test
+package camel
 
 import (
 	"strings"
 
+	yaml2 "gopkg.in/yaml.v2"
+
 	"github.com/apache/camel-k/deploy"
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
-	"github.com/apache/camel-k/pkg/util/camel"
 	"github.com/apache/camel-k/pkg/util/defaults"
-
-	yaml2 "gopkg.in/yaml.v2"
 )
 
 // DefaultCatalog --
-func DefaultCatalog() (*camel.RuntimeCatalog, error) {
+func DefaultCatalog() (*RuntimeCatalog, error) {
 	catalogs := make([]v1alpha1.CamelCatalog, 0)
 
 	for name, content := range deploy.Resources {
@@ -43,5 +42,5 @@ func DefaultCatalog() (*camel.RuntimeCatalog, error) {
 		}
 	}
 
-	return camel.FindBestMatch(catalogs, defaults.DefaultCamelVersion, defaults.DefaultRuntimeVersion)
+	return findBestMatch(catalogs, defaults.DefaultCamelVersion, defaults.DefaultRuntimeVersion)
 }
diff --git a/pkg/util/test/catalog_test.go b/pkg/util/test/catalog_test.go
index a93e1cf..5e3e420 100644
--- a/pkg/util/test/catalog_test.go
+++ b/pkg/util/test/catalog_test.go
@@ -20,13 +20,14 @@ package test
 import (
 	"testing"
 
-	"github.com/apache/camel-k/pkg/util/defaults"
-
 	"github.com/stretchr/testify/assert"
+
+	"github.com/apache/camel-k/pkg/util/camel"
+	"github.com/apache/camel-k/pkg/util/defaults"
 )
 
 func TestRuntimeContainsEmbeddedArtifacts(t *testing.T) {
-	catalog, err := DefaultCatalog()
+	catalog, err := camel.DefaultCatalog()
 	assert.Nil(t, err)
 
 	assert.Equal(t, defaults.DefaultCamelVersion, catalog.Version)


[camel-k] 11/38: feat(quarkus): Fix reported artifact IDs

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit ca9810bab1b5bf6039e84b2fe0232f63553add77
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Oct 23 12:07:01 2019 +0200

    feat(quarkus): Fix reported artifact IDs
---
 pkg/builder/runtime/quarkus.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/builder/runtime/quarkus.go b/pkg/builder/runtime/quarkus.go
index c3c734a..243f871 100644
--- a/pkg/builder/runtime/quarkus.go
+++ b/pkg/builder/runtime/quarkus.go
@@ -127,7 +127,7 @@ func computeQuarkusDependencies(ctx *builder.Context) error {
 		}
 
 		ctx.Artifacts = append(ctx.Artifacts, v1alpha1.Artifact{
-			ID:       fileName,
+			ID:       gav.GroupID + ":" + gav.ArtifactID + ":" + gav.Type + ":" + gav.Version,
 			Location: location,
 			Target:   path.Join("lib", fileName),
 		})


[camel-k] 09/38: fix(quarkus): Catalog exact matching logic should take runtime provider into account

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit c4f37cf7ae4f7e81ccc1ae0e45410eb691674adc
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Oct 23 10:41:12 2019 +0200

    fix(quarkus): Catalog exact matching logic should take runtime provider into account
---
 pkg/apis/camel/v1alpha1/camelcatalog_types.go |  2 +-
 pkg/apis/camel/v1alpha1/common_types.go       |  4 ++--
 pkg/metadata/metadata_dependencies_test.go    | 26 ++++++++++++++++++++++++++
 pkg/util/camel/camel_util.go                  | 10 ++++++++--
 pkg/util/camel/catalog.go                     | 14 +++++++++++++-
 5 files changed, 50 insertions(+), 6 deletions(-)

diff --git a/pkg/apis/camel/v1alpha1/camelcatalog_types.go b/pkg/apis/camel/v1alpha1/camelcatalog_types.go
index 65a1d65..3ae6999 100644
--- a/pkg/apis/camel/v1alpha1/camelcatalog_types.go
+++ b/pkg/apis/camel/v1alpha1/camelcatalog_types.go
@@ -55,7 +55,7 @@ type CamelArtifact struct {
 type CamelCatalogSpec struct {
 	Version         string                   `json:"version" yaml:"version"`
 	RuntimeVersion  string                   `json:"runtimeVersion" yaml:"runtimeVersion"`
-	RuntimeProvider *RuntimeProvider         `json:"runtimeProvider,omitempty"`
+	RuntimeProvider *RuntimeProvider         `json:"runtimeProvider,omitempty" yaml:"runtimeProvider"`
 	Artifacts       map[string]CamelArtifact `json:"artifacts" yaml:"artifacts"`
 }
 
diff --git a/pkg/apis/camel/v1alpha1/common_types.go b/pkg/apis/camel/v1alpha1/common_types.go
index abf366f..2833890 100644
--- a/pkg/apis/camel/v1alpha1/common_types.go
+++ b/pkg/apis/camel/v1alpha1/common_types.go
@@ -29,8 +29,8 @@ type RuntimeProvider struct {
 
 // QuarkusRuntimeProvider --
 type QuarkusRuntimeProvider struct {
-	CamelQuarkusVersion string `json:"camelQuarkusVersion,omitempty"`
-	QuarkusVersion      string `json:"quarkusVersion,omitempty"`
+	CamelQuarkusVersion string `json:"camelQuarkusVersion,omitempty" yaml:"camelQuarkusVersion"`
+	QuarkusVersion      string `json:"quarkusVersion,omitempty" yaml:"quarkusVersion"`
 }
 
 // ConfigurationSpec --
diff --git a/pkg/metadata/metadata_dependencies_test.go b/pkg/metadata/metadata_dependencies_test.go
index d0919b5..bd1ceea 100644
--- a/pkg/metadata/metadata_dependencies_test.go
+++ b/pkg/metadata/metadata_dependencies_test.go
@@ -116,6 +116,32 @@ func TestDependencies(t *testing.T) {
 	assert.ElementsMatch(t, []string{"camel:http", "camel:log", "camel:mock", "camel:twitter"}, meta.Dependencies.List())
 }
 
+func TestDependenciesQuarkus(t *testing.T) {
+	code := v1alpha1.SourceSpec{
+		DataSpec: v1alpha1.DataSpec{
+			Name: "Request.java",
+			Content: `
+			    from("http:test").to("log:end");
+			    from("https4:test").to("log:end");
+			    from("twitter-timeline:test").to("mock:end");
+		    `,
+		},
+		Language: v1alpha1.LanguageJavaSource,
+	}
+
+	catalog, err := camel.QuarkusCatalog()
+	assert.Nil(t, err)
+
+	meta := Extract(catalog, code)
+
+	assert.ElementsMatch(t,
+		[]string{
+			"mvn:org.apache.camel.quarkus:camel-quarkus-log:",
+			"mvn:org.apache.camel.quarkus:camel-quarkus-twitter:",
+		},
+		meta.Dependencies.List())
+}
+
 func TestJacksonDependency(t *testing.T) {
 	code := v1alpha1.SourceSpec{
 		DataSpec: v1alpha1.DataSpec{
diff --git a/pkg/util/camel/camel_util.go b/pkg/util/camel/camel_util.go
index 6aecdfe..a368284 100644
--- a/pkg/util/camel/camel_util.go
+++ b/pkg/util/camel/camel_util.go
@@ -27,10 +27,16 @@ import (
 )
 
 func findBestMatch(catalogs []v1alpha1.CamelCatalog, camelVersion string, runtimeVersion string, provider interface{}) (*RuntimeCatalog, error) {
-	// FIXME: take the provider into account for exact match
+	// TODO: generic exact matching logic independent of the runtime provider
 	for _, catalog := range catalogs {
 		if catalog.Spec.Version == camelVersion && catalog.Spec.RuntimeVersion == runtimeVersion {
-			return NewRuntimeCatalog(catalog.Spec), nil
+			if provider == nil && catalog.Spec.RuntimeProvider == nil {
+				return NewRuntimeCatalog(catalog.Spec), nil
+			} else if provider, ok := provider.(v1alpha1.QuarkusRuntimeProvider); ok &&
+				catalog.Spec.RuntimeProvider != nil && catalog.Spec.RuntimeProvider.Quarkus != nil &&
+				provider == *catalog.Spec.RuntimeProvider.Quarkus {
+				return NewRuntimeCatalog(catalog.Spec), nil
+			}
 		}
 	}
 
diff --git a/pkg/util/camel/catalog.go b/pkg/util/camel/catalog.go
index a5a6d1e..e4442c9 100644
--- a/pkg/util/camel/catalog.go
+++ b/pkg/util/camel/catalog.go
@@ -29,6 +29,18 @@ import (
 
 // DefaultCatalog --
 func DefaultCatalog() (*RuntimeCatalog, error) {
+	return catalogForRuntimeProvider(nil)
+}
+
+// QuarkusCatalog --
+func QuarkusCatalog() (*RuntimeCatalog, error) {
+	return catalogForRuntimeProvider(v1alpha1.QuarkusRuntimeProvider{
+		CamelQuarkusVersion: "0.2.0",
+		QuarkusVersion:      "0.21.2",
+	})
+}
+
+func catalogForRuntimeProvider(provider interface{}) (*RuntimeCatalog, error) {
 	catalogs := make([]v1alpha1.CamelCatalog, 0)
 
 	for name, content := range deploy.Resources {
@@ -42,5 +54,5 @@ func DefaultCatalog() (*RuntimeCatalog, error) {
 		}
 	}
 
-	return findBestMatch(catalogs, defaults.DefaultCamelVersion, defaults.DefaultRuntimeVersion, nil)
+	return findBestMatch(catalogs, defaults.DefaultCamelVersion, defaults.DefaultRuntimeVersion, provider)
 }


[camel-k] 31/38: feat(quarkus): Add Camel Quarkus dependency to catalog generation profile

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 1c7ca9601c9f5d20f73dd5accedec7c9e6f3f333
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Tue Oct 29 16:58:22 2019 +0100

    feat(quarkus): Add Camel Quarkus dependency to catalog generation profile
---
 build/maven/pom-catalog.xml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/build/maven/pom-catalog.xml b/build/maven/pom-catalog.xml
index 51d24a3..2a212f4 100644
--- a/build/maven/pom-catalog.xml
+++ b/build/maven/pom-catalog.xml
@@ -86,6 +86,12 @@
                                 <artifactId>camel-catalog-quarkus</artifactId>
                                 <version>${camel-quarkus.version}</version>
                             </dependency>
+                            <!-- This is required to retrieve the Quarkus version -->
+                            <dependency>
+                                <groupId>org.apache.camel.quarkus</groupId>
+                                <artifactId>camel-quarkus-core</artifactId>
+                                <version>${camel-quarkus.version}</version>
+                            </dependency>
                         </dependencies>
                     </plugin>
                 </plugins>


[camel-k] 32/38: feat(quarkus): Add Camel Quarkus dependency to on-the-flight catalog generation

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 0bf9b8177ef82d2a3e15f3ef186a69b247e342c9
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Oct 30 11:18:59 2019 +0100

    feat(quarkus): Add Camel Quarkus dependency to on-the-flight catalog generation
---
 pkg/trait/quarkus.go      | 16 ++++++++++++----
 pkg/util/camel/catalog.go | 12 +++++-------
 2 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/pkg/trait/quarkus.go b/pkg/trait/quarkus.go
index 1a3bff4..e51016b 100644
--- a/pkg/trait/quarkus.go
+++ b/pkg/trait/quarkus.go
@@ -84,10 +84,18 @@ func (t *quarkusTrait) loadOrCreateCatalog(e *Environment, camelVersion string,
 			exactVersionRegexp.MatchString(camelQuarkusVersion) && exactVersionRegexp.MatchString(quarkusVersion) {
 			catalog, err = camel.GenerateCatalogWithProvider(e.C, e.Client, ns, e.Platform.Spec.Build.Maven, camelVersion, runtimeVersion,
 				"quarkus",
-				&maven.Dependency{
-					GroupID:    "org.apache.camel.quarkus",
-					ArtifactID: "camel-catalog-quarkus",
-					Version:    camelQuarkusVersion,
+				[]maven.Dependency{
+					{
+						GroupID:    "org.apache.camel.quarkus",
+						ArtifactID: "camel-catalog-quarkus",
+						Version:    camelQuarkusVersion,
+					},
+					// This is required to retrieve the Quarkus dependency version
+					{
+						GroupID:    "org.apache.camel.quarkus",
+						ArtifactID: "camel-quarkus-core",
+						Version:    camelQuarkusVersion,
+					},
 				})
 			if err != nil {
 				return err
diff --git a/pkg/util/camel/catalog.go b/pkg/util/camel/catalog.go
index b83eebc..17224ea 100644
--- a/pkg/util/camel/catalog.go
+++ b/pkg/util/camel/catalog.go
@@ -69,12 +69,12 @@ func catalogForRuntimeProvider(provider interface{}) (*RuntimeCatalog, error) {
 // GenerateCatalog --
 func GenerateCatalog(ctx context.Context, client k8sclient.Reader, namespace string, mvn v1alpha1.MavenSpec,
 	camelVersion string, runtimeVersion string) (*RuntimeCatalog, error) {
-	return GenerateCatalogWithProvider(ctx, client, namespace, mvn, camelVersion, runtimeVersion, "", nil)
+	return GenerateCatalogWithProvider(ctx, client, namespace, mvn, camelVersion, runtimeVersion, "", []maven.Dependency{})
 }
 
 // GenerateCatalogWithProvider --
 func GenerateCatalogWithProvider(ctx context.Context, client k8sclient.Reader, namespace string, mvn v1alpha1.MavenSpec,
-	camelVersion string, runtimeVersion string, providerName string, providerDependency *maven.Dependency) (*RuntimeCatalog, error) {
+	camelVersion string, runtimeVersion string, providerName string, providerDependencies []maven.Dependency) (*RuntimeCatalog, error) {
 	root := os.TempDir()
 	tmpDir, err := ioutil.TempDir(root, "camel-catalog")
 	if err != nil {
@@ -87,7 +87,7 @@ func GenerateCatalogWithProvider(ctx context.Context, client k8sclient.Reader, n
 		return nil, err
 	}
 
-	project := generateMavenProject(camelVersion, runtimeVersion, providerDependency)
+	project := generateMavenProject(camelVersion, runtimeVersion, providerDependencies)
 
 	mc := maven.NewContext(tmpDir, project)
 	mc.LocalRepository = mvn.LocalRepository
@@ -124,7 +124,7 @@ func GenerateCatalogWithProvider(ctx context.Context, client k8sclient.Reader, n
 	return NewRuntimeCatalog(catalog.Spec), nil
 }
 
-func generateMavenProject(camelVersion string, runtimeVersion string, providerDependency *maven.Dependency) maven.Project {
+func generateMavenProject(camelVersion string, runtimeVersion string, providerDependencies []maven.Dependency) maven.Project {
 	p := maven.NewProjectWithGAV("org.apache.camel.k.integration", "camel-k-catalog-generator", defaults.Version)
 
 	plugin := maven.Plugin{
@@ -148,9 +148,7 @@ func generateMavenProject(camelVersion string, runtimeVersion string, providerDe
 		},
 	}
 
-	if providerDependency != nil {
-		plugin.Dependencies = append(plugin.Dependencies, *providerDependency)
-	}
+	plugin.Dependencies = append(plugin.Dependencies, providerDependencies...)
 
 	p.Build = &maven.Build{
 		DefaultGoal: "generate-resources",


[camel-k] 38/38: feat(quarkus): Use the Camel K runtime plugin to list runtime dependencies

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 4f6886a7d06f6ae6ca52b24b279adb73dd7b4f9c
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Mon Nov 4 09:38:33 2019 +0100

    feat(quarkus): Use the Camel K runtime plugin to list runtime dependencies
---
 pkg/builder/runtime/quarkus.go | 47 +++++++++++++++++++++---------------------
 1 file changed, 24 insertions(+), 23 deletions(-)

diff --git a/pkg/builder/runtime/quarkus.go b/pkg/builder/runtime/quarkus.go
index 265e0da..480fbac 100644
--- a/pkg/builder/runtime/quarkus.go
+++ b/pkg/builder/runtime/quarkus.go
@@ -1,12 +1,13 @@
 package runtime
 
 import (
-	"bufio"
-	"bytes"
 	"fmt"
+	"io/ioutil"
 	"os"
 	"path"
 
+	yaml2 "gopkg.in/yaml.v2"
+
 	"github.com/pkg/errors"
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
@@ -68,11 +69,6 @@ func generateQuarkusProject(ctx *builder.Context) error {
 	p.Build.Plugins = append(p.Build.Plugins,
 		maven.Plugin{
 			GroupID:    "io.quarkus",
-			ArtifactID: "quarkus-bootstrap-maven-plugin",
-			Version:    ctx.Build.RuntimeProvider.Quarkus.QuarkusVersion,
-		},
-		maven.Plugin{
-			GroupID:    "io.quarkus",
 			ArtifactID: "quarkus-maven-plugin",
 			Version:    ctx.Build.RuntimeProvider.Quarkus.QuarkusVersion,
 			Executions: []maven.Execution{
@@ -96,36 +92,41 @@ func computeQuarkusDependencies(ctx *builder.Context) error {
 	mc.LocalRepository = ctx.Build.Platform.Build.Maven.LocalRepository
 	mc.Timeout = ctx.Build.Platform.Build.Maven.Timeout.Duration
 
-	// Build the project, as the quarkus-bootstrap plugin build-tree goal
-	// requires the artifact to be installed
-	mc.AddArgument("install")
+	// Build the project
+	mc.AddArgument("package")
 	if err := maven.Run(mc); err != nil {
 		return errors.Wrap(err, "failure while building project")
 	}
 
-	// Call the Quarkus dependencies plugin
+	// Retrieve the runtime dependencies
 	mc.AdditionalArguments = nil
-	mc.AddArguments("quarkus-bootstrap:build-tree")
-	output := new(bytes.Buffer)
-	// TODO: improve logging while capturing output
-	mc.Stdout = output
+	mc.AddArgumentf("org.apache.camel.k:camel-k-maven-plugin:%s:generate-dependency-list", ctx.Catalog.RuntimeVersion)
 	if err := maven.Run(mc); err != nil {
-		return errors.Wrap(err, "failure while determining dependencies")
+		return errors.Wrap(err, "failure while determining classpath")
+	}
+
+	dependencies := path.Join(mc.Path, "target", "dependencies.yaml")
+	content, err := ioutil.ReadFile(dependencies)
+	if err != nil {
+		return err
 	}
 
-	scanner := bufio.NewScanner(output)
-	scanner.Split(bufio.ScanLines)
-	for scanner.Scan() {
-		gav, err := maven.ParseGAV(scanner.Text())
+	cp := make(map[string][]v1alpha1.Artifact)
+	err = yaml2.Unmarshal(content, &cp)
+	if err != nil {
+		return err
+	}
+
+	for _, e := range cp["dependencies"] {
+		gav, err := maven.ParseGAV(e.ID)
 		if err != nil {
-			continue
+			return nil
 		}
 
 		fileName := gav.GroupID + "." + gav.ArtifactID + "-" + gav.Version + "." + gav.Type
 		location := path.Join(mc.Path, "target", "lib", fileName)
 		_, err = os.Stat(location)
-		// We check that the dependency actually exists in the lib directory as the
-		// quarkus-bootstrap Maven plugin reports deployment dependencies as well
+		// We check that the dependency actually exists in the lib directory
 		if os.IsNotExist(err) {
 			continue
 		}


[camel-k] 34/38: feat(quarkus): Upgrade Camel Quarkus to version 0.3.0 and Quarkus to version 0.26.1

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 5a0d37b85461da00de1ad62d5ce863809f54e1e9
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Oct 30 11:33:37 2019 +0100

    feat(quarkus): Upgrade Camel Quarkus to version 0.3.0 and Quarkus to version 0.26.1
---
 pkg/util/defaults/defaults.go | 8 ++++----
 script/Makefile               | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/pkg/util/defaults/defaults.go b/pkg/util/defaults/defaults.go
index 660e4b4..6d0fe1c 100644
--- a/pkg/util/defaults/defaults.go
+++ b/pkg/util/defaults/defaults.go
@@ -37,16 +37,16 @@ const (
 	RuntimeVersionConstraint = ">=1.0.5"
 
 	// DefaultCamelQuarkusVersion --
-	DefaultCamelQuarkusVersion = "0.2.1-SNAPSHOT"
+	DefaultCamelQuarkusVersion = "0.3.0"
 
 	// CamelQuarkusVersionConstraint --
-	CamelQuarkusVersionConstraint = ">=0.2.0"
+	CamelQuarkusVersionConstraint = ">=0.3.0"
 
 	// DefaultQuarkusVersion --
-	DefaultQuarkusVersion = "0.21.2"
+	DefaultQuarkusVersion = "0.26.1"
 
 	// QuarkusVersionConstraint --
-	QuarkusVersionConstraint = ">=0.21.2"
+	QuarkusVersionConstraint = ">=0.26.1"
 
 	// KanikoVersion --
 	KanikoVersion = "0.9.0"
diff --git a/script/Makefile b/script/Makefile
index 80f5a48..ff39f9e 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -20,10 +20,10 @@ RUNTIME_VERSION := 1.0.6
 RUNTIME_VERSION_CONSTRAINT := >=1.0.5
 CAMEL_VERSION := 3.0.0-RC1
 CAMEL_VERSION_CONSTRAINT := >=3.0.0-RC1
-CAMEL_QUARKUS_VERSION := 0.2.1-SNAPSHOT
-CAMEL_QUARKUS_VERSION_CONSTRAINT := >=0.2.0
-QUARKUS_VERSION := 0.21.2
-QUARKUS_VERSION_CONSTRAINT := >=0.21.2
+CAMEL_QUARKUS_VERSION := 0.3.0
+CAMEL_QUARKUS_VERSION_CONSTRAINT := >=0.3.0
+QUARKUS_VERSION := 0.26.1
+QUARKUS_VERSION_CONSTRAINT := >=0.26.1
 KANIKO_VERSION := 0.9.0
 BASE_IMAGE := fabric8/s2i-java:3.0-java8
 LOCAL_REPOSITORY := /tmp/artifacts/m2


[camel-k] 01/38: feat(quarkus): Initial Quarkus support

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit bbf9b3ad1f1211c09d8aaedb01aa294877317965
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Tue Oct 15 19:20:58 2019 +0200

    feat(quarkus): Initial Quarkus support
---
 pkg/builder/builder_steps.go                       | 129 ++++-------
 pkg/builder/builder_steps_test.go                  | 171 +-------------
 pkg/builder/builder_utils.go                       |  65 ------
 pkg/builder/builder_utils_test.go                  |  87 -------
 pkg/builder/kaniko/kaniko.go                       |  10 +-
 pkg/builder/{builder_utils.go => runtime/main.go}  |  99 ++++----
 .../main_test.go}                                  | 251 ++++++---------------
 pkg/builder/runtime/quarkus.go                     | 142 ++++++++++++
 .../{kaniko/kaniko.go => runtime/runtime.go}       |  45 ++--
 pkg/builder/s2i/s2i.go                             |  10 +-
 pkg/trait/builder.go                               |  17 +-
 pkg/trait/dependencies.go                          |  45 ++--
 pkg/trait/dependencies_test.go                     |   5 +
 pkg/trait/environment.go                           |   8 +-
 pkg/trait/quarkus.go                               |  94 ++++++++
 pkg/trait/rest-dsl.go                              |   6 +-
 pkg/trait/trait_catalog.go                         |   6 +
 pkg/util/maven/maven.go                            |  11 +-
 pkg/util/maven/maven_types.go                      |   2 +
 19 files changed, 498 insertions(+), 705 deletions(-)

diff --git a/pkg/builder/builder_steps.go b/pkg/builder/builder_steps.go
index b46d0c2..3e935e3 100644
--- a/pkg/builder/builder_steps.go
+++ b/pkg/builder/builder_steps.go
@@ -19,23 +19,17 @@ package builder
 
 import (
 	"fmt"
-	"io/ioutil"
 	"os"
 	"path"
 	"reflect"
 	"strings"
 
-	"github.com/apache/camel-k/pkg/util/kubernetes"
-
 	k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/util/kubernetes"
 	"github.com/apache/camel-k/pkg/util/maven"
 	"github.com/apache/camel-k/pkg/util/tar"
-
-	yaml2 "gopkg.in/yaml.v2"
-
-	"github.com/pkg/errors"
 )
 
 var stepsByID = make(map[string]Step)
@@ -45,21 +39,15 @@ func init() {
 }
 
 type steps struct {
-	GenerateProject         Step
 	GenerateProjectSettings Step
 	InjectDependencies      Step
 	SanitizeDependencies    Step
-	ComputeDependencies     Step
 	StandardPackager        Step
 	IncrementalPackager     Step
 }
 
 // Steps --
 var Steps = steps{
-	GenerateProject: NewStep(
-		ProjectGenerationPhase,
-		generateProject,
-	),
 	GenerateProjectSettings: NewStep(
 		ProjectGenerationPhase+1,
 		generateProjectSettings,
@@ -72,10 +60,6 @@ var Steps = steps{
 		ProjectGenerationPhase+3,
 		sanitizeDependencies,
 	),
-	ComputeDependencies: NewStep(
-		ProjectBuildPhase,
-		computeDependencies,
-	),
 	StandardPackager: NewStep(
 		ApplicationPackagePhase,
 		standardPackager,
@@ -86,6 +70,14 @@ var Steps = steps{
 	),
 }
 
+// DefaultSteps --
+var DefaultSteps = []Step{
+	Steps.GenerateProjectSettings,
+	Steps.InjectDependencies,
+	Steps.SanitizeDependencies,
+	Steps.IncrementalPackager,
+}
+
 // RegisterSteps --
 func RegisterSteps(steps interface{}) {
 	v := reflect.ValueOf(steps)
@@ -112,17 +104,39 @@ func registerStep(steps ...Step) {
 	}
 }
 
-// generateProject --
-func generateProject(ctx *Context) error {
-	p, err := NewMavenProject(ctx)
+// generateProjectSettings --
+func generateProjectSettings(ctx *Context) error {
+	val, err := kubernetes.ResolveValueSource(ctx.C, ctx.Client, ctx.Namespace, &ctx.Build.Platform.Build.Maven.Settings)
 	if err != nil {
 		return err
 	}
+	if val != "" {
+		ctx.Maven.SettingsData = []byte(val)
+	}
 
-	ctx.Maven.Project = p
+	return nil
+}
 
+func injectDependencies(ctx *Context) error {
+	// Add dependencies from build
 	for _, d := range ctx.Build.Dependencies {
 		switch {
+		case strings.HasPrefix(d, "bom:"):
+			mid := strings.TrimPrefix(d, "bom:")
+			gav := strings.Replace(mid, "/", ":", -1)
+
+			d, err := maven.ParseGAV(gav)
+			if err != nil {
+				return err
+			}
+
+			ctx.Maven.Project.DependencyManagement.Dependencies = append(ctx.Maven.Project.DependencyManagement.Dependencies, maven.Dependency{
+				GroupID:    d.GroupID,
+				ArtifactID: d.ArtifactID,
+				Version:    d.Version,
+				Type:       "pom",
+				Scope:      "import",
+			})
 		case strings.HasPrefix(d, "camel:"):
 			artifactID := strings.TrimPrefix(d, "camel:")
 
@@ -144,33 +158,12 @@ func generateProject(ctx *Context) error {
 			gav := strings.Replace(mid, "/", ":", -1)
 
 			ctx.Maven.Project.AddEncodedDependencyGAV(gav)
-		case strings.HasPrefix(d, "bom:"):
-			// no-op
 		default:
 			return fmt.Errorf("unknown dependency type: %s", d)
 		}
 	}
 
-	return nil
-}
-
-// generateProjectSettings --
-func generateProjectSettings(ctx *Context) error {
-	val, err := kubernetes.ResolveValueSource(ctx.C, ctx.Client, ctx.Namespace, &ctx.Build.Platform.Build.Maven.Settings)
-	if err != nil {
-		return err
-	}
-	if val != "" {
-		ctx.Maven.SettingsData = []byte(val)
-	}
-
-	return nil
-}
-
-func injectDependencies(ctx *Context) error {
-	//
 	// Add dependencies from catalog
-	//
 	deps := make([]maven.Dependency, len(ctx.Maven.Project.Dependencies))
 	copy(deps, ctx.Maven.Project.Dependencies)
 
@@ -195,9 +188,8 @@ func injectDependencies(ctx *Context) error {
 			}
 		}
 	}
-	//
-	// post process dependencies
-	//
+
+	// Post process dependencies
 	deps = make([]maven.Dependency, len(ctx.Maven.Project.Dependencies))
 	copy(deps, ctx.Maven.Project.Dependencies)
 
@@ -243,49 +235,7 @@ func sanitizeDependencies(ctx *Context) error {
 	return nil
 }
 
-func computeDependencies(ctx *Context) error {
-	mc := maven.NewContext(path.Join(ctx.Path, "maven"), ctx.Maven.Project)
-	mc.SettingsContent = ctx.Maven.SettingsData
-	mc.LocalRepository = ctx.Build.Platform.Build.LocalRepository
-	mc.Timeout = ctx.Build.Platform.Build.Maven.Timeout.Duration
-	mc.AddArgumentf("org.apache.camel.k:camel-k-maven-plugin:%s:generate-dependency-list", ctx.Catalog.RuntimeVersion)
-
-	if err := maven.Run(mc); err != nil {
-		return errors.Wrap(err, "failure while determining classpath")
-	}
-
-	dependencies := path.Join(mc.Path, "target", "dependencies.yaml")
-	content, err := ioutil.ReadFile(dependencies)
-	if err != nil {
-		return err
-	}
-
-	cp := make(map[string][]v1alpha1.Artifact)
-	err = yaml2.Unmarshal(content, &cp)
-	if err != nil {
-		return err
-	}
-
-	for _, e := range cp["dependencies"] {
-		_, fileName := path.Split(e.Location)
-
-		gav, err := maven.ParseGAV(e.ID)
-		if err != nil {
-			return nil
-		}
-
-		ctx.Artifacts = append(ctx.Artifacts, v1alpha1.Artifact{
-			ID:       e.ID,
-			Location: e.Location,
-			Target:   path.Join("dependencies", gav.GroupID+"."+fileName),
-		})
-	}
-
-	return nil
-}
-
-// ArtifactsSelector --
-type ArtifactsSelector func(ctx *Context) error
+type artifactsSelector func(ctx *Context) error
 
 func standardPackager(ctx *Context) error {
 	return packager(ctx, func(ctx *Context) error {
@@ -330,8 +280,7 @@ func incrementalPackager(ctx *Context) error {
 	})
 }
 
-// ClassPathPackager --
-func packager(ctx *Context, selector ArtifactsSelector) error {
+func packager(ctx *Context, selector artifactsSelector) error {
 	err := selector(ctx)
 	if err != nil {
 		return err
diff --git a/pkg/builder/builder_steps_test.go b/pkg/builder/builder_steps_test.go
index d21564d..c950477 100644
--- a/pkg/builder/builder_steps_test.go
+++ b/pkg/builder/builder_steps_test.go
@@ -25,7 +25,6 @@ import (
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/util/cancellable"
-	"github.com/apache/camel-k/pkg/util/maven"
 	"github.com/apache/camel-k/pkg/util/test"
 
 	"github.com/stretchr/testify/assert"
@@ -50,63 +49,6 @@ func TestRegisterDuplicatedSteps(t *testing.T) {
 	})
 }
 
-func TestGenerateJvmProject(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
-	assert.Nil(t, err)
-
-	ctx := Context{
-		Catalog: catalog,
-		Build: v1alpha1.BuildSpec{
-			RuntimeVersion: catalog.RuntimeVersion,
-			Platform: v1alpha1.IntegrationPlatformSpec{
-				Build: v1alpha1.IntegrationPlatformBuildSpec{
-					CamelVersion: catalog.Version,
-				},
-			},
-			Dependencies: []string{
-				"camel-k:runtime-main",
-			},
-		},
-	}
-
-	err = generateProject(&ctx)
-	assert.Nil(t, err)
-	err = injectDependencies(&ctx)
-	assert.Nil(t, err)
-
-	assert.ElementsMatch(
-		t,
-		ctx.Maven.Project.DependencyManagement.Dependencies,
-		[]maven.Dependency{
-			{
-				GroupID:    "org.apache.camel",
-				ArtifactID: "camel-bom",
-				Version:    catalog.Version,
-				Type:       "pom",
-				Scope:      "import",
-			},
-			{
-				GroupID:    "org.apache.camel.k",
-				ArtifactID: "camel-k-runtime-bom",
-				Version:    catalog.RuntimeVersion,
-				Type:       "pom",
-				Scope:      "import",
-			},
-		},
-	)
-
-	assert.ElementsMatch(
-		t,
-		ctx.Maven.Project.Dependencies,
-		[]maven.Dependency{
-			{GroupID: "org.apache.camel.k", ArtifactID: "camel-k-runtime-main"},
-			{GroupID: "org.apache.camel", ArtifactID: "camel-core-engine"},
-			{GroupID: "org.apache.camel", ArtifactID: "camel-main"},
-			{GroupID: "org.apache.camel", ArtifactID: "camel-properties"},
-		},
-	)
-}
-
 func TestMavenSettingsFromConfigMap(t *testing.T) {
 	catalog, err := test.DefaultCatalog()
 	assert.Nil(t, err)
@@ -153,7 +95,7 @@ func TestMavenSettingsFromConfigMap(t *testing.T) {
 		},
 	}
 
-	err = generateProjectSettings(&ctx)
+	err = Steps.GenerateProjectSettings.Execute(&ctx)
 	assert.Nil(t, err)
 
 	assert.Equal(t, []byte("setting-data"), ctx.Maven.SettingsData)
@@ -205,121 +147,12 @@ func TestMavenSettingsFromSecret(t *testing.T) {
 		},
 	}
 
-	err = generateProjectSettings(&ctx)
+	err = Steps.GenerateProjectSettings.Execute(&ctx)
 	assert.Nil(t, err)
 
 	assert.Equal(t, []byte("setting-data"), ctx.Maven.SettingsData)
 }
 
-func TestGenerateGroovyProject(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
-	assert.Nil(t, err)
-
-	ctx := Context{
-		Catalog: catalog,
-		Build: v1alpha1.BuildSpec{
-			RuntimeVersion: catalog.RuntimeVersion,
-			Platform: v1alpha1.IntegrationPlatformSpec{
-				Build: v1alpha1.IntegrationPlatformBuildSpec{
-					CamelVersion: catalog.Version,
-				},
-			},
-			Dependencies: []string{
-				"camel-k:runtime-main",
-				"camel-k:loader-groovy",
-			},
-		},
-	}
-
-	err = generateProject(&ctx)
-	assert.Nil(t, err)
-	err = injectDependencies(&ctx)
-	assert.Nil(t, err)
-
-	assert.ElementsMatch(
-		t,
-		ctx.Maven.Project.DependencyManagement.Dependencies,
-		[]maven.Dependency{
-			{
-				GroupID:    "org.apache.camel",
-				ArtifactID: "camel-bom",
-				Version:    catalog.Version,
-				Type:       "pom",
-				Scope:      "import",
-			},
-			{
-				GroupID:    "org.apache.camel.k",
-				ArtifactID: "camel-k-runtime-bom",
-				Version:    catalog.RuntimeVersion,
-				Type:       "pom",
-				Scope:      "import",
-			},
-		},
-	)
-
-	assert.ElementsMatch(
-		t,
-		ctx.Maven.Project.Dependencies,
-		[]maven.Dependency{
-			{GroupID: "org.apache.camel.k", ArtifactID: "camel-k-runtime-main"},
-			{GroupID: "org.apache.camel.k", ArtifactID: "camel-k-loader-groovy"},
-			{GroupID: "org.apache.camel", ArtifactID: "camel-core-engine"},
-			{GroupID: "org.apache.camel", ArtifactID: "camel-main"},
-			{GroupID: "org.apache.camel", ArtifactID: "camel-groovy"},
-			{GroupID: "org.apache.camel", ArtifactID: "camel-properties"},
-			{GroupID: "org.apache.camel", ArtifactID: "camel-endpointdsl"},
-		},
-	)
-}
-
-func TestSanitizeDependencies(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
-	assert.Nil(t, err)
-
-	ctx := Context{
-		Catalog: catalog,
-		Build: v1alpha1.BuildSpec{
-			RuntimeVersion: catalog.RuntimeVersion,
-			Platform: v1alpha1.IntegrationPlatformSpec{
-				Build: v1alpha1.IntegrationPlatformBuildSpec{
-					CamelVersion: catalog.Version,
-				},
-			},
-			Dependencies: []string{
-				"camel:undertow",
-				"mvn:org.apache.camel/camel-core/2.18.0",
-				"mvn:org.apache.camel.k/camel-k-runtime-main/1.0.0",
-				"mvn:com.mycompany/my-dep/1.2.3",
-			},
-		},
-	}
-
-	err = generateProject(&ctx)
-	assert.Nil(t, err)
-	err = injectDependencies(&ctx)
-	assert.Nil(t, err)
-	err = sanitizeDependencies(&ctx)
-	assert.Nil(t, err)
-
-	assert.Contains(t, ctx.Maven.Project.Dependencies, maven.Dependency{
-		GroupID:    "org.apache.camel.k",
-		ArtifactID: "camel-k-runtime-main",
-	})
-	assert.Contains(t, ctx.Maven.Project.Dependencies, maven.Dependency{
-		GroupID:    "org.apache.camel",
-		ArtifactID: "camel-core",
-	})
-	assert.Contains(t, ctx.Maven.Project.Dependencies, maven.Dependency{
-		GroupID:    "org.apache.camel",
-		ArtifactID: "camel-undertow",
-	})
-	assert.Contains(t, ctx.Maven.Project.Dependencies, maven.Dependency{
-		GroupID:    "com.mycompany",
-		ArtifactID: "my-dep",
-		Version:    "1.2.3",
-	})
-}
-
 func TestListPublishedImages(t *testing.T) {
 	catalog, err := test.DefaultCatalog()
 	assert.Nil(t, err)
diff --git a/pkg/builder/builder_utils.go b/pkg/builder/builder_utils.go
index e6516dd..5098e5a 100644
--- a/pkg/builder/builder_utils.go
+++ b/pkg/builder/builder_utils.go
@@ -18,12 +18,7 @@ limitations under the License.
 package builder
 
 import (
-	"strings"
-
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
-	"github.com/apache/camel-k/pkg/util/camel"
-	"github.com/apache/camel-k/pkg/util/defaults"
-	"github.com/apache/camel-k/pkg/util/maven"
 )
 
 // StepIDsFor --
@@ -44,63 +39,3 @@ func artifactIDs(artifacts []v1alpha1.Artifact) []string {
 
 	return result
 }
-
-// NewMavenProject --
-func NewMavenProject(ctx *Context) (maven.Project, error) {
-	//
-	// Catalog
-	//
-	if ctx.Catalog == nil {
-		c, err := camel.LoadCatalog(ctx.C, ctx.Client, ctx.Namespace, ctx.Build.Platform.Build.CamelVersion, ctx.Build.Platform.Build.RuntimeVersion)
-		if err != nil {
-			return maven.Project{}, err
-		}
-
-		ctx.Catalog = c
-	}
-
-	p := maven.NewProjectWithGAV("org.apache.camel.k.integration", "camel-k-integration", defaults.Version)
-	p.Properties = ctx.Build.Platform.Build.Properties
-	p.DependencyManagement = &maven.DependencyManagement{Dependencies: make([]maven.Dependency, 0)}
-	p.Dependencies = make([]maven.Dependency, 0)
-
-	//
-	// DependencyManagement
-	//
-	p.DependencyManagement.Dependencies = append(p.DependencyManagement.Dependencies, maven.Dependency{
-		GroupID:    "org.apache.camel",
-		ArtifactID: "camel-bom",
-		Version:    ctx.Catalog.Version,
-		Type:       "pom",
-		Scope:      "import",
-	})
-	p.DependencyManagement.Dependencies = append(p.DependencyManagement.Dependencies, maven.Dependency{
-		GroupID:    "org.apache.camel.k",
-		ArtifactID: "camel-k-runtime-bom",
-		Version:    ctx.Catalog.RuntimeVersion,
-		Type:       "pom",
-		Scope:      "import",
-	})
-
-	for _, d := range ctx.Build.Dependencies {
-		if strings.HasPrefix(d, "bom:") {
-			mid := strings.TrimPrefix(d, "bom:")
-			gav := strings.Replace(mid, "/", ":", -1)
-
-			d, err := maven.ParseGAV(gav)
-			if err != nil {
-				return maven.Project{}, err
-			}
-
-			p.DependencyManagement.Dependencies = append(p.DependencyManagement.Dependencies, maven.Dependency{
-				GroupID:    d.GroupID,
-				ArtifactID: d.ArtifactID,
-				Version:    d.Version,
-				Type:       "pom",
-				Scope:      "import",
-			})
-		}
-	}
-
-	return p, nil
-}
diff --git a/pkg/builder/builder_utils_test.go b/pkg/builder/builder_utils_test.go
deleted file mode 100644
index 951d035..0000000
--- a/pkg/builder/builder_utils_test.go
+++ /dev/null
@@ -1,87 +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.
-*/
-
-package builder
-
-import (
-	"testing"
-
-	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
-	"github.com/apache/camel-k/pkg/util/maven"
-	"github.com/apache/camel-k/pkg/util/test"
-
-	"github.com/stretchr/testify/assert"
-)
-
-func TestNewProject(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
-	assert.Nil(t, err)
-
-	ctx := Context{
-		Catalog: catalog,
-		Build: v1alpha1.BuildSpec{
-			RuntimeVersion: catalog.RuntimeVersion,
-			Platform: v1alpha1.IntegrationPlatformSpec{
-				Build: v1alpha1.IntegrationPlatformBuildSpec{
-					CamelVersion: catalog.Version,
-				},
-			},
-			Dependencies: []string{
-				"camel-k:runtime-main",
-				"bom:my.company/my-artifact-1/1.0.0",
-				"bom:my.company/my-artifact-2/2.0.0",
-			},
-		},
-	}
-
-	err = generateProject(&ctx)
-	assert.Nil(t, err)
-	assert.ElementsMatch(
-		t,
-		ctx.Maven.Project.DependencyManagement.Dependencies,
-		[]maven.Dependency{
-			{
-				GroupID:    "org.apache.camel",
-				ArtifactID: "camel-bom",
-				Version:    ctx.Catalog.Version,
-				Type:       "pom",
-				Scope:      "import",
-			},
-			{
-				GroupID:    "org.apache.camel.k",
-				ArtifactID: "camel-k-runtime-bom",
-				Version:    catalog.RuntimeVersion,
-				Type:       "pom",
-				Scope:      "import",
-			},
-			{
-				GroupID:    "my.company",
-				ArtifactID: "my-artifact-1",
-				Version:    "1.0.0",
-				Type:       "pom",
-				Scope:      "import",
-			},
-			{
-				GroupID:    "my.company",
-				ArtifactID: "my-artifact-2",
-				Version:    "2.0.0",
-				Type:       "pom",
-				Scope:      "import",
-			},
-		},
-	)
-}
diff --git a/pkg/builder/kaniko/kaniko.go b/pkg/builder/kaniko/kaniko.go
index f5e53cb..efc0291 100644
--- a/pkg/builder/kaniko/kaniko.go
+++ b/pkg/builder/kaniko/kaniko.go
@@ -37,14 +37,8 @@ var Steps = steps{
 	),
 }
 
-// DefaultSteps --
-var DefaultSteps = []builder.Step{
-	builder.Steps.GenerateProject,
-	builder.Steps.GenerateProjectSettings,
-	builder.Steps.InjectDependencies,
-	builder.Steps.SanitizeDependencies,
-	builder.Steps.ComputeDependencies,
-	builder.Steps.IncrementalPackager,
+// KanikoSteps --
+var KanikoSteps = []builder.Step{
 	Steps.Publisher,
 }
 
diff --git a/pkg/builder/builder_utils.go b/pkg/builder/runtime/main.go
similarity index 58%
copy from pkg/builder/builder_utils.go
copy to pkg/builder/runtime/main.go
index e6516dd..dbf6668 100644
--- a/pkg/builder/builder_utils.go
+++ b/pkg/builder/runtime/main.go
@@ -15,45 +15,35 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-package builder
+package runtime
 
 import (
-	"strings"
+	"io/ioutil"
+	"path"
+
+	"github.com/pkg/errors"
+
+	yaml2 "gopkg.in/yaml.v2"
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/builder"
 	"github.com/apache/camel-k/pkg/util/camel"
 	"github.com/apache/camel-k/pkg/util/defaults"
 	"github.com/apache/camel-k/pkg/util/maven"
 )
 
-// StepIDsFor --
-func StepIDsFor(steps ...Step) []string {
-	IDs := make([]string, 0)
-	for _, step := range steps {
-		IDs = append(IDs, step.ID())
-	}
-	return IDs
+// MainSteps --
+var MainSteps = []builder.Step{
+	Steps.GenerateProject,
+	Steps.ComputeDependencies,
 }
 
-func artifactIDs(artifacts []v1alpha1.Artifact) []string {
-	result := make([]string, 0, len(artifacts))
-
-	for _, a := range artifacts {
-		result = append(result, a.ID)
-	}
-
-	return result
-}
-
-// NewMavenProject --
-func NewMavenProject(ctx *Context) (maven.Project, error) {
-	//
+func generateProject(ctx *builder.Context) error {
 	// Catalog
-	//
 	if ctx.Catalog == nil {
 		c, err := camel.LoadCatalog(ctx.C, ctx.Client, ctx.Namespace, ctx.Build.Platform.Build.CamelVersion, ctx.Build.Platform.Build.RuntimeVersion)
 		if err != nil {
-			return maven.Project{}, err
+			return err
 		}
 
 		ctx.Catalog = c
@@ -64,9 +54,7 @@ func NewMavenProject(ctx *Context) (maven.Project, error) {
 	p.DependencyManagement = &maven.DependencyManagement{Dependencies: make([]maven.Dependency, 0)}
 	p.Dependencies = make([]maven.Dependency, 0)
 
-	//
 	// DependencyManagement
-	//
 	p.DependencyManagement.Dependencies = append(p.DependencyManagement.Dependencies, maven.Dependency{
 		GroupID:    "org.apache.camel",
 		ArtifactID: "camel-bom",
@@ -82,25 +70,48 @@ func NewMavenProject(ctx *Context) (maven.Project, error) {
 		Scope:      "import",
 	})
 
-	for _, d := range ctx.Build.Dependencies {
-		if strings.HasPrefix(d, "bom:") {
-			mid := strings.TrimPrefix(d, "bom:")
-			gav := strings.Replace(mid, "/", ":", -1)
-
-			d, err := maven.ParseGAV(gav)
-			if err != nil {
-				return maven.Project{}, err
-			}
-
-			p.DependencyManagement.Dependencies = append(p.DependencyManagement.Dependencies, maven.Dependency{
-				GroupID:    d.GroupID,
-				ArtifactID: d.ArtifactID,
-				Version:    d.Version,
-				Type:       "pom",
-				Scope:      "import",
-			})
+	ctx.Maven.Project = p
+
+	return nil
+}
+
+func computeDependencies(ctx *builder.Context) error {
+	mc := maven.NewContext(path.Join(ctx.Path, "maven"), ctx.Maven.Project)
+	mc.SettingsContent = ctx.Maven.SettingsData
+	mc.LocalRepository = ctx.Build.Platform.Build.LocalRepository
+	mc.Timeout = ctx.Build.Platform.Build.Maven.Timeout.Duration
+	mc.AddArgumentf("org.apache.camel.k:camel-k-maven-plugin:%s:generate-dependency-list", ctx.Catalog.RuntimeVersion)
+
+	if err := maven.Run(mc); err != nil {
+		return errors.Wrap(err, "failure while determining classpath")
+	}
+
+	dependencies := path.Join(mc.Path, "target", "dependencies.yaml")
+	content, err := ioutil.ReadFile(dependencies)
+	if err != nil {
+		return err
+	}
+
+	cp := make(map[string][]v1alpha1.Artifact)
+	err = yaml2.Unmarshal(content, &cp)
+	if err != nil {
+		return err
+	}
+
+	for _, e := range cp["dependencies"] {
+		_, fileName := path.Split(e.Location)
+
+		gav, err := maven.ParseGAV(e.ID)
+		if err != nil {
+			return nil
 		}
+
+		ctx.Artifacts = append(ctx.Artifacts, v1alpha1.Artifact{
+			ID:       e.ID,
+			Location: e.Location,
+			Target:   path.Join("dependencies", gav.GroupID+"."+fileName),
+		})
 	}
 
-	return p, nil
+	return nil
 }
diff --git a/pkg/builder/builder_steps_test.go b/pkg/builder/runtime/main_test.go
similarity index 55%
copy from pkg/builder/builder_steps_test.go
copy to pkg/builder/runtime/main_test.go
index d21564d..e98b813 100644
--- a/pkg/builder/builder_steps_test.go
+++ b/pkg/builder/runtime/main_test.go
@@ -15,46 +15,24 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-package builder
+package runtime
 
 import (
 	"testing"
 
-	corev1 "k8s.io/api/core/v1"
-	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+	"github.com/stretchr/testify/assert"
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
-	"github.com/apache/camel-k/pkg/util/cancellable"
+	"github.com/apache/camel-k/pkg/builder"
 	"github.com/apache/camel-k/pkg/util/maven"
 	"github.com/apache/camel-k/pkg/util/test"
-
-	"github.com/stretchr/testify/assert"
 )
 
-type testSteps struct {
-	TestStep Step
-}
-
-func TestRegisterDuplicatedSteps(t *testing.T) {
-	steps := testSteps{
-		TestStep: NewStep(
-			ApplicationPublishPhase,
-			func(context *Context) error {
-				return nil
-			},
-		),
-	}
-	RegisterSteps(steps)
-	assert.Panics(t, func() {
-		RegisterSteps(steps)
-	})
-}
-
-func TestGenerateJvmProject(t *testing.T) {
+func TestNewProject(t *testing.T) {
 	catalog, err := test.DefaultCatalog()
 	assert.Nil(t, err)
 
-	ctx := Context{
+	ctx := builder.Context{
 		Catalog: catalog,
 		Build: v1alpha1.BuildSpec{
 			RuntimeVersion: catalog.RuntimeVersion,
@@ -65,13 +43,15 @@ func TestGenerateJvmProject(t *testing.T) {
 			},
 			Dependencies: []string{
 				"camel-k:runtime-main",
+				"bom:my.company/my-artifact-1/1.0.0",
+				"bom:my.company/my-artifact-2/2.0.0",
 			},
 		},
 	}
 
-	err = generateProject(&ctx)
+	err = Steps.GenerateProject.Execute(&ctx)
 	assert.Nil(t, err)
-	err = injectDependencies(&ctx)
+	err = builder.Steps.InjectDependencies.Execute(&ctx)
 	assert.Nil(t, err)
 
 	assert.ElementsMatch(
@@ -81,7 +61,7 @@ func TestGenerateJvmProject(t *testing.T) {
 			{
 				GroupID:    "org.apache.camel",
 				ArtifactID: "camel-bom",
-				Version:    catalog.Version,
+				Version:    ctx.Catalog.Version,
 				Type:       "pom",
 				Scope:      "import",
 			},
@@ -92,130 +72,86 @@ func TestGenerateJvmProject(t *testing.T) {
 				Type:       "pom",
 				Scope:      "import",
 			},
-		},
-	)
-
-	assert.ElementsMatch(
-		t,
-		ctx.Maven.Project.Dependencies,
-		[]maven.Dependency{
-			{GroupID: "org.apache.camel.k", ArtifactID: "camel-k-runtime-main"},
-			{GroupID: "org.apache.camel", ArtifactID: "camel-core-engine"},
-			{GroupID: "org.apache.camel", ArtifactID: "camel-main"},
-			{GroupID: "org.apache.camel", ArtifactID: "camel-properties"},
-		},
-	)
-}
-
-func TestMavenSettingsFromConfigMap(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
-	assert.Nil(t, err)
-
-	c, err := test.NewFakeClient(
-		&corev1.ConfigMap{
-			TypeMeta: metav1.TypeMeta{
-				APIVersion: "v1",
-				Kind:       "ConfigMap",
-			},
-			ObjectMeta: metav1.ObjectMeta{
-				Namespace: "ns",
-				Name:      "maven-settings",
+			{
+				GroupID:    "my.company",
+				ArtifactID: "my-artifact-1",
+				Version:    "1.0.0",
+				Type:       "pom",
+				Scope:      "import",
 			},
-			Data: map[string]string{
-				"settings.xml": "setting-data",
+			{
+				GroupID:    "my.company",
+				ArtifactID: "my-artifact-2",
+				Version:    "2.0.0",
+				Type:       "pom",
+				Scope:      "import",
 			},
 		},
 	)
+}
 
+func TestGenerateJvmProject(t *testing.T) {
+	catalog, err := test.DefaultCatalog()
 	assert.Nil(t, err)
 
-	ctx := Context{
-		Catalog:   catalog,
-		Client:    c,
-		Namespace: "ns",
+	ctx := builder.Context{
+		Catalog: catalog,
 		Build: v1alpha1.BuildSpec{
 			RuntimeVersion: catalog.RuntimeVersion,
 			Platform: v1alpha1.IntegrationPlatformSpec{
 				Build: v1alpha1.IntegrationPlatformBuildSpec{
 					CamelVersion: catalog.Version,
-					Maven: v1alpha1.MavenSpec{
-						Settings: v1alpha1.ValueSource{
-							ConfigMapKeyRef: &corev1.ConfigMapKeySelector{
-								LocalObjectReference: corev1.LocalObjectReference{
-									Name: "maven-settings",
-								},
-								Key: "settings.xml",
-							},
-						},
-					},
 				},
 			},
+			Dependencies: []string{
+				"camel-k:runtime-main",
+			},
 		},
 	}
 
-	err = generateProjectSettings(&ctx)
+	err = Steps.GenerateProject.Execute(&ctx)
 	assert.Nil(t, err)
-
-	assert.Equal(t, []byte("setting-data"), ctx.Maven.SettingsData)
-}
-
-func TestMavenSettingsFromSecret(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
+	err = builder.Steps.InjectDependencies.Execute(&ctx)
 	assert.Nil(t, err)
 
-	c, err := test.NewFakeClient(
-		&corev1.Secret{
-			TypeMeta: metav1.TypeMeta{
-				APIVersion: "v1",
-				Kind:       "Secret",
-			},
-			ObjectMeta: metav1.ObjectMeta{
-				Namespace: "ns",
-				Name:      "maven-settings",
+	assert.ElementsMatch(
+		t,
+		ctx.Maven.Project.DependencyManagement.Dependencies,
+		[]maven.Dependency{
+			{
+				GroupID:    "org.apache.camel",
+				ArtifactID: "camel-bom",
+				Version:    catalog.Version,
+				Type:       "pom",
+				Scope:      "import",
 			},
-			Data: map[string][]byte{
-				"settings.xml": []byte("setting-data"),
+			{
+				GroupID:    "org.apache.camel.k",
+				ArtifactID: "camel-k-runtime-bom",
+				Version:    catalog.RuntimeVersion,
+				Type:       "pom",
+				Scope:      "import",
 			},
 		},
 	)
 
-	assert.Nil(t, err)
-
-	ctx := Context{
-		Catalog:   catalog,
-		Client:    c,
-		Namespace: "ns",
-		Build: v1alpha1.BuildSpec{
-			RuntimeVersion: catalog.RuntimeVersion,
-			Platform: v1alpha1.IntegrationPlatformSpec{
-				Build: v1alpha1.IntegrationPlatformBuildSpec{
-					CamelVersion: catalog.Version,
-					Maven: v1alpha1.MavenSpec{
-						Settings: v1alpha1.ValueSource{
-							SecretKeyRef: &corev1.SecretKeySelector{
-								LocalObjectReference: corev1.LocalObjectReference{
-									Name: "maven-settings",
-								},
-								Key: "settings.xml",
-							},
-						},
-					},
-				},
-			},
+	assert.ElementsMatch(
+		t,
+		ctx.Maven.Project.Dependencies,
+		[]maven.Dependency{
+			{GroupID: "org.apache.camel.k", ArtifactID: "camel-k-runtime-main"},
+			{GroupID: "org.apache.camel", ArtifactID: "camel-core-engine"},
+			{GroupID: "org.apache.camel", ArtifactID: "camel-main"},
+			{GroupID: "org.apache.camel", ArtifactID: "camel-properties"},
 		},
-	}
-
-	err = generateProjectSettings(&ctx)
-	assert.Nil(t, err)
-
-	assert.Equal(t, []byte("setting-data"), ctx.Maven.SettingsData)
+	)
 }
 
 func TestGenerateGroovyProject(t *testing.T) {
 	catalog, err := test.DefaultCatalog()
 	assert.Nil(t, err)
 
-	ctx := Context{
+	ctx := builder.Context{
 		Catalog: catalog,
 		Build: v1alpha1.BuildSpec{
 			RuntimeVersion: catalog.RuntimeVersion,
@@ -231,9 +167,9 @@ func TestGenerateGroovyProject(t *testing.T) {
 		},
 	}
 
-	err = generateProject(&ctx)
+	err = Steps.GenerateProject.Execute(&ctx)
 	assert.Nil(t, err)
-	err = injectDependencies(&ctx)
+	err = builder.Steps.InjectDependencies.Execute(&ctx)
 	assert.Nil(t, err)
 
 	assert.ElementsMatch(
@@ -276,7 +212,7 @@ func TestSanitizeDependencies(t *testing.T) {
 	catalog, err := test.DefaultCatalog()
 	assert.Nil(t, err)
 
-	ctx := Context{
+	ctx := builder.Context{
 		Catalog: catalog,
 		Build: v1alpha1.BuildSpec{
 			RuntimeVersion: catalog.RuntimeVersion,
@@ -294,11 +230,11 @@ func TestSanitizeDependencies(t *testing.T) {
 		},
 	}
 
-	err = generateProject(&ctx)
+	err = Steps.GenerateProject.Execute(&ctx)
 	assert.Nil(t, err)
-	err = injectDependencies(&ctx)
+	err = builder.Steps.InjectDependencies.Execute(&ctx)
 	assert.Nil(t, err)
-	err = sanitizeDependencies(&ctx)
+	err = builder.Steps.SanitizeDependencies.Execute(&ctx)
 	assert.Nil(t, err)
 
 	assert.Contains(t, ctx.Maven.Project.Dependencies, maven.Dependency{
@@ -319,62 +255,3 @@ func TestSanitizeDependencies(t *testing.T) {
 		Version:    "1.2.3",
 	})
 }
-
-func TestListPublishedImages(t *testing.T) {
-	catalog, err := test.DefaultCatalog()
-	assert.Nil(t, err)
-
-	c, err := test.NewFakeClient(
-		&v1alpha1.IntegrationKit{
-			TypeMeta: metav1.TypeMeta{
-				APIVersion: v1alpha1.SchemeGroupVersion.String(),
-				Kind:       v1alpha1.IntegrationKindKind,
-			},
-			ObjectMeta: metav1.ObjectMeta{
-				Namespace: "ns",
-				Name:      "my-kit-1",
-				Labels: map[string]string{
-					"camel.apache.org/kit.type": v1alpha1.IntegrationKitTypePlatform,
-				},
-			},
-			Status: v1alpha1.IntegrationKitStatus{
-				Phase:          v1alpha1.IntegrationKitPhaseError,
-				Image:          "image-1",
-				CamelVersion:   catalog.Version,
-				RuntimeVersion: catalog.RuntimeVersion,
-			},
-		},
-		&v1alpha1.IntegrationKit{
-			TypeMeta: metav1.TypeMeta{
-				APIVersion: v1alpha1.SchemeGroupVersion.String(),
-				Kind:       v1alpha1.IntegrationKindKind,
-			},
-			ObjectMeta: metav1.ObjectMeta{
-				Namespace: "ns",
-				Name:      "my-kit-2",
-				Labels: map[string]string{
-					"camel.apache.org/kit.type": v1alpha1.IntegrationKitTypePlatform,
-				},
-			},
-			Status: v1alpha1.IntegrationKitStatus{
-				Phase:          v1alpha1.IntegrationKitPhaseReady,
-				Image:          "image-2",
-				CamelVersion:   catalog.Version,
-				RuntimeVersion: catalog.RuntimeVersion,
-			},
-		},
-	)
-
-	assert.Nil(t, err)
-	assert.NotNil(t, c)
-
-	i, err := listPublishedImages(&Context{
-		Client:  c,
-		Catalog: catalog,
-		C:       cancellable.NewContext(),
-	})
-
-	assert.Nil(t, err)
-	assert.Len(t, i, 1)
-	assert.Equal(t, "image-2", i[0].Image)
-}
diff --git a/pkg/builder/runtime/quarkus.go b/pkg/builder/runtime/quarkus.go
new file mode 100644
index 0000000..ddca59e
--- /dev/null
+++ b/pkg/builder/runtime/quarkus.go
@@ -0,0 +1,142 @@
+package runtime
+
+import (
+	"bufio"
+	"bytes"
+	"os"
+	"path"
+
+	"github.com/pkg/errors"
+
+	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/builder"
+	"github.com/apache/camel-k/pkg/util/camel"
+	"github.com/apache/camel-k/pkg/util/defaults"
+	"github.com/apache/camel-k/pkg/util/maven"
+)
+
+// QuarkusSteps --
+var QuarkusSteps = []builder.Step{
+	Steps.GenerateQuarkusProject,
+	Steps.ComputeQuarkusDependencies,
+}
+
+func generateQuarkusProject(ctx *builder.Context) error {
+	// Catalog
+	if ctx.Catalog == nil {
+		c, err := camel.LoadCatalog(ctx.C, ctx.Client, ctx.Namespace, ctx.Build.Platform.Build.CamelVersion, ctx.Build.Platform.Build.RuntimeVersion)
+		if err != nil {
+			return err
+		}
+
+		ctx.Catalog = c
+	}
+
+	p := maven.NewProjectWithGAV("org.apache.camel.k.integration", "camel-k-integration", defaults.Version)
+	p.Properties = ctx.Build.Platform.Build.Properties
+	p.DependencyManagement = &maven.DependencyManagement{Dependencies: make([]maven.Dependency, 0)}
+	p.Dependencies = make([]maven.Dependency, 0)
+	p.Build = &maven.Build{Plugins: make([]maven.Plugin, 0)}
+
+	// DependencyManagement
+	p.DependencyManagement.Dependencies = append(p.DependencyManagement.Dependencies,
+		maven.Dependency{
+			GroupID:    "org.apache.camel.quarkus",
+			ArtifactID: "camel-quarkus-bom",
+			Version:    "0.2.0",
+			//Version:    ctx.Catalog.Version,
+			Type:  "pom",
+			Scope: "import",
+		},
+		maven.Dependency{
+			GroupID:    "org.apache.camel.k",
+			ArtifactID: "camel-k-runtime-bom",
+			Version:    ctx.Catalog.RuntimeVersion,
+			Type:       "pom",
+			Scope:      "import",
+		},
+	)
+
+	// Plugins
+	p.Build.Plugins = append(p.Build.Plugins,
+		maven.Plugin{
+			GroupID:    "io.quarkus",
+			ArtifactID: "quarkus-bootstrap-maven-plugin",
+			// TODO: must be the same as the version required by camel-k-runtime
+			Version: "0.21.2",
+		},
+		maven.Plugin{
+			GroupID:    "io.quarkus",
+			ArtifactID: "quarkus-maven-plugin",
+			// TODO: must be the same as the version required by camel-k-runtime
+			Version: "0.21.2",
+			Executions: []maven.Execution{
+				{
+					Goals: []string{
+						"build",
+					},
+				},
+			},
+		},
+	)
+
+	ctx.Maven.Project = p
+
+	return nil
+}
+
+func computeQuarkusDependencies(ctx *builder.Context) error {
+	mc := maven.NewContext(path.Join(ctx.Path, "maven"), ctx.Maven.Project)
+	mc.SettingsContent = ctx.Maven.SettingsData
+	mc.LocalRepository = ctx.Build.Platform.Build.LocalRepository
+	mc.Timeout = ctx.Build.Platform.Build.Maven.Timeout.Duration
+
+	// Build the project, as the quarkus-bootstrap plugin build-tree goal
+	// requires the artifact to be installed
+	mc.AddArgument("package")
+	if err := maven.Run(mc); err != nil {
+		return errors.Wrap(err, "failure while building project")
+	}
+
+	// Call the Quarkus dependencies plugin
+	mc.AdditionalArguments = nil
+	mc.AddArguments("quarkus-bootstrap:build-tree")
+	output := new(bytes.Buffer)
+	mc.Stdout = output
+	if err := maven.Run(mc); err != nil {
+		return errors.Wrap(err, "failure while determining dependencies")
+	}
+
+	scanner := bufio.NewScanner(output)
+	scanner.Split(bufio.ScanLines)
+	for scanner.Scan() {
+		gav, err := maven.ParseGAV(scanner.Text())
+		if err != nil {
+			continue
+		}
+
+		fileName := gav.GroupID + "." + gav.ArtifactID + "-" + gav.Version + "." + gav.Type
+		location := path.Join(mc.Path, "target", "lib", fileName)
+		_, err = os.Stat(location)
+		// We check that the dependency actually exists in the lib directory as the
+		// quarkus-bootstrap Maven plugin reports deployment dependencies as well
+		if os.IsNotExist(err) {
+			continue
+		}
+
+		ctx.Artifacts = append(ctx.Artifacts, v1alpha1.Artifact{
+			ID:       fileName,
+			Location: location,
+			Target:   path.Join("lib", fileName),
+		})
+	}
+
+	runner := "camel-k-integration-" + defaults.Version + "-runner.jar"
+	ctx.Artifacts = append(ctx.Artifacts, v1alpha1.Artifact{
+		ID:       runner,
+		Location: path.Join(mc.Path, "target", runner),
+		Target:   runner,
+	})
+
+	return nil
+}
diff --git a/pkg/builder/kaniko/kaniko.go b/pkg/builder/runtime/runtime.go
similarity index 58%
copy from pkg/builder/kaniko/kaniko.go
copy to pkg/builder/runtime/runtime.go
index f5e53cb..22106e0 100644
--- a/pkg/builder/kaniko/kaniko.go
+++ b/pkg/builder/runtime/runtime.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-package kaniko
+package runtime
 
 import (
 	"github.com/apache/camel-k/pkg/builder"
@@ -25,28 +25,33 @@ func init() {
 	builder.RegisterSteps(Steps)
 }
 
+// TODO: organise runtime steps into nested structs
 type steps struct {
-	Publisher builder.Step
+	// Main
+	GenerateProject     builder.Step
+	ComputeDependencies builder.Step
+	// Quarkus
+	GenerateQuarkusProject     builder.Step
+	ComputeQuarkusDependencies builder.Step
 }
 
-// Steps --
 var Steps = steps{
-	Publisher: builder.NewStep(
-		builder.ApplicationPublishPhase,
-		publisher,
+	// Main
+	GenerateProject: builder.NewStep(
+		builder.ProjectGenerationPhase,
+		generateProject,
+	),
+	ComputeDependencies: builder.NewStep(
+		builder.ProjectBuildPhase,
+		computeDependencies,
+	),
+	// Quarkus
+	GenerateQuarkusProject: builder.NewStep(
+		builder.ProjectGenerationPhase,
+		generateQuarkusProject,
+	),
+	ComputeQuarkusDependencies: builder.NewStep(
+		builder.ProjectBuildPhase,
+		computeQuarkusDependencies,
 	),
 }
-
-// DefaultSteps --
-var DefaultSteps = []builder.Step{
-	builder.Steps.GenerateProject,
-	builder.Steps.GenerateProjectSettings,
-	builder.Steps.InjectDependencies,
-	builder.Steps.SanitizeDependencies,
-	builder.Steps.ComputeDependencies,
-	builder.Steps.IncrementalPackager,
-	Steps.Publisher,
-}
-
-// BuildDir is the directory where to build artifacts (shared with the Kaniko pod)
-var BuildDir = "/workspace"
diff --git a/pkg/builder/s2i/s2i.go b/pkg/builder/s2i/s2i.go
index b1a3bd8..8ccb13e 100644
--- a/pkg/builder/s2i/s2i.go
+++ b/pkg/builder/s2i/s2i.go
@@ -37,13 +37,7 @@ var Steps = steps{
 	),
 }
 
-// DefaultSteps --
-var DefaultSteps = []builder.Step{
-	builder.Steps.GenerateProject,
-	builder.Steps.GenerateProjectSettings,
-	builder.Steps.InjectDependencies,
-	builder.Steps.SanitizeDependencies,
-	builder.Steps.ComputeDependencies,
-	builder.Steps.IncrementalPackager,
+// S2iSteps --
+var S2iSteps = []builder.Step{
 	Steps.Publisher,
 }
diff --git a/pkg/trait/builder.go b/pkg/trait/builder.go
index 7b167ff..a017cc2 100644
--- a/pkg/trait/builder.go
+++ b/pkg/trait/builder.go
@@ -19,7 +19,9 @@ package trait
 
 import (
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/builder"
 	"github.com/apache/camel-k/pkg/builder/kaniko"
+	"github.com/apache/camel-k/pkg/builder/runtime"
 	"github.com/apache/camel-k/pkg/builder/s2i"
 	"github.com/apache/camel-k/pkg/platform"
 )
@@ -44,12 +46,23 @@ func (t *builderTrait) Configure(e *Environment) (bool, error) {
 }
 
 func (t *builderTrait) Apply(e *Environment) error {
+	e.Steps = append(e.Steps, builder.DefaultSteps...)
 	if platform.SupportsS2iPublishStrategy(e.Platform) {
-		e.Steps = s2i.DefaultSteps
+		e.Steps = append(e.Steps, s2i.S2iSteps...)
 	} else if platform.SupportsKanikoPublishStrategy(e.Platform) {
-		e.Steps = kaniko.DefaultSteps
+		e.Steps = append(e.Steps, kaniko.KanikoSteps...)
 		e.BuildDir = kaniko.BuildDir
 	}
 
+	quarkus := e.Catalog.GetTrait("quarkus").(*quarkusTrait)
+
+	if quarkus.isEnabled() {
+		// Add build steps for Quarkus runtime
+		quarkus.addBuildSteps(e)
+	} else {
+		// Add build steps for default runtime
+		e.Steps = append(e.Steps, runtime.MainSteps...)
+	}
+
 	return nil
 }
diff --git a/pkg/trait/dependencies.go b/pkg/trait/dependencies.go
index 9659577..69fb824 100644
--- a/pkg/trait/dependencies.go
+++ b/pkg/trait/dependencies.go
@@ -51,41 +51,54 @@ func (t *dependenciesTrait) Apply(e *Environment) error {
 			util.StringSliceUniqueAdd(&dependencies, dep)
 		}
 	}
+
+	quarkus := e.Catalog.GetTrait("quarkus").(*quarkusTrait)
+	if quarkus.isEnabled() {
+		err := quarkus.addRuntimeDependencies(e, &dependencies)
+		if err != nil {
+			return err
+		}
+	} else {
+		addDefaultRuntimeDependencies(e, &dependencies)
+	}
+
+	// sort the dependencies to get always the same list if they don't change
+	sort.Strings(dependencies)
+	e.Integration.Status.Dependencies = dependencies
+	return nil
+}
+
+func addDefaultRuntimeDependencies(e *Environment, dependencies *[]string) {
 	for _, s := range e.Integration.Sources() {
 		meta := metadata.Extract(e.CamelCatalog, s)
 
 		switch s.InferLanguage() {
 		case v1alpha1.LanguageGroovy:
-			util.StringSliceUniqueAdd(&dependencies, "mvn:org.apache.camel.k/camel-k-loader-groovy")
+			util.StringSliceUniqueAdd(dependencies, "mvn:org.apache.camel.k/camel-k-loader-groovy")
 		case v1alpha1.LanguageKotlin:
-			util.StringSliceUniqueAdd(&dependencies, "mvn:org.apache.camel.k/camel-k-loader-kotlin")
+			util.StringSliceUniqueAdd(dependencies, "mvn:org.apache.camel.k/camel-k-loader-kotlin")
 		case v1alpha1.LanguageYaml:
-			util.StringSliceUniqueAdd(&dependencies, "mvn:org.apache.camel.k/camel-k-loader-yaml")
+			util.StringSliceUniqueAdd(dependencies, "mvn:org.apache.camel.k/camel-k-loader-yaml")
 		case v1alpha1.LanguageXML:
-			util.StringSliceUniqueAdd(&dependencies, "mvn:org.apache.camel.k/camel-k-loader-xml")
+			util.StringSliceUniqueAdd(dependencies, "mvn:org.apache.camel.k/camel-k-loader-xml")
 		case v1alpha1.LanguageJavaScript:
-			util.StringSliceUniqueAdd(&dependencies, "mvn:org.apache.camel.k/camel-k-loader-js")
+			util.StringSliceUniqueAdd(dependencies, "mvn:org.apache.camel.k/camel-k-loader-js")
 		case v1alpha1.LanguageJavaClass:
-			util.StringSliceUniqueAdd(&dependencies, "mvn:org.apache.camel.k/camel-k-loader-java")
+			util.StringSliceUniqueAdd(dependencies, "mvn:org.apache.camel.k/camel-k-loader-java")
 		case v1alpha1.LanguageJavaSource:
-			util.StringSliceUniqueAdd(&dependencies, "mvn:org.apache.camel.k/camel-k-loader-java")
+			util.StringSliceUniqueAdd(dependencies, "mvn:org.apache.camel.k/camel-k-loader-java")
 		}
 
 		if strings.HasPrefix(s.Loader, "knative-source") {
-			util.StringSliceUniqueAdd(&dependencies, "mvn:org.apache.camel.k/camel-k-loader-knative")
-			util.StringSliceUniqueAdd(&dependencies, "mvn:org.apache.camel.k/camel-k-runtime-knative")
+			util.StringSliceUniqueAdd(dependencies, "mvn:org.apache.camel.k/camel-k-loader-knative")
+			util.StringSliceUniqueAdd(dependencies, "mvn:org.apache.camel.k/camel-k-runtime-knative")
 		}
 
 		// main required by default
-		util.StringSliceUniqueAdd(&dependencies, "mvn:org.apache.camel.k/camel-k-runtime-main")
+		util.StringSliceUniqueAdd(dependencies, "mvn:org.apache.camel.k/camel-k-runtime-main")
 
 		for _, d := range meta.Dependencies.List() {
-			util.StringSliceUniqueAdd(&dependencies, d)
+			util.StringSliceUniqueAdd(dependencies, d)
 		}
 	}
-
-	// sort the dependencies to get always the same list if they don't change
-	sort.Strings(dependencies)
-	e.Integration.Status.Dependencies = dependencies
-	return nil
 }
diff --git a/pkg/trait/dependencies_test.go b/pkg/trait/dependencies_test.go
index fed00c9..8e75159 100644
--- a/pkg/trait/dependencies_test.go
+++ b/pkg/trait/dependencies_test.go
@@ -27,6 +27,7 @@ import (
 
 func TestDependenciesTraitApplicability(t *testing.T) {
 	e := &Environment{
+		Catalog:     NewEnvironmentTestCatalog(),
 		Integration: &v1alpha1.Integration{},
 	}
 
@@ -51,6 +52,7 @@ func TestIntegrationDefaultDeps(t *testing.T) {
 	assert.Nil(t, err)
 
 	e := &Environment{
+		Catalog:      NewEnvironmentTestCatalog(),
 		CamelCatalog: catalog,
 		Integration: &v1alpha1.Integration{
 			Spec: v1alpha1.IntegrationSpec{
@@ -93,6 +95,7 @@ func TestIntegrationCustomDeps(t *testing.T) {
 	assert.Nil(t, err)
 
 	e := &Environment{
+		Catalog:      NewEnvironmentTestCatalog(),
 		CamelCatalog: catalog,
 		Integration: &v1alpha1.Integration{
 			Spec: v1alpha1.IntegrationSpec{
@@ -140,6 +143,7 @@ func TestIntegrationAutoGeneratedDeps(t *testing.T) {
 	assert.Nil(t, err)
 
 	e := &Environment{
+		Catalog:      NewEnvironmentTestCatalog(),
 		CamelCatalog: catalog,
 		Integration: &v1alpha1.Integration{
 			Spec: v1alpha1.IntegrationSpec{
@@ -193,6 +197,7 @@ func TestIntegrationCustomLoader(t *testing.T) {
 	assert.Nil(t, err)
 
 	e := &Environment{
+		Catalog:      NewEnvironmentTestCatalog(),
 		CamelCatalog: catalog,
 		Integration: &v1alpha1.Integration{
 			Spec: v1alpha1.IntegrationSpec{
diff --git a/pkg/trait/environment.go b/pkg/trait/environment.go
index c282e34..fb73bcf 100644
--- a/pkg/trait/environment.go
+++ b/pkg/trait/environment.go
@@ -35,6 +35,7 @@ const (
 	envVarCamelKRuntimeVersion = "CAMEL_K_RUNTIME_VERSION"
 	envVarCamelVersion         = "CAMEL_VERSION"
 	envVarMainClass            = "JAVA_MAIN_CLASS"
+	envVarAppJAR               = "JAVA_APP_JAR"
 	defaultMainClass           = "org.apache.camel.k.main.Application"
 )
 
@@ -63,7 +64,12 @@ func (t *environmentTrait) Apply(e *Environment) error {
 		envvar.SetValFrom(&e.EnvVars, envVarPodName, "metadata.name")
 	}
 
-	envvar.SetVal(&e.EnvVars, envVarMainClass, defaultMainClass)
+	quarkus := e.Catalog.GetTrait("quarkus").(*quarkusTrait)
+	if quarkus.isEnabled() {
+		quarkus.addContainerEnvironment(e)
+	} else {
+		envvar.SetVal(&e.EnvVars, envVarMainClass, defaultMainClass)
+	}
 
 	return nil
 }
diff --git a/pkg/trait/quarkus.go b/pkg/trait/quarkus.go
new file mode 100644
index 0000000..8b70b11
--- /dev/null
+++ b/pkg/trait/quarkus.go
@@ -0,0 +1,94 @@
+/*
+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 trait
+
+import (
+	"fmt"
+	"strings"
+
+	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/builder/runtime"
+	"github.com/apache/camel-k/pkg/metadata"
+	"github.com/apache/camel-k/pkg/util"
+	"github.com/apache/camel-k/pkg/util/defaults"
+	"github.com/apache/camel-k/pkg/util/envvar"
+)
+
+type quarkusTrait struct {
+	BaseTrait `property:",squash"`
+}
+
+func newQuarkusTrait() *quarkusTrait {
+	return &quarkusTrait{
+		BaseTrait: newBaseTrait("quarkus"),
+	}
+}
+
+func (t *quarkusTrait) isEnabled() bool {
+	return t.Enabled != nil && *t.Enabled
+}
+
+func (t *quarkusTrait) Configure(e *Environment) (bool, error) {
+	return t.isEnabled(), nil
+}
+
+func (t *quarkusTrait) Apply(e *Environment) error {
+	return nil
+}
+
+func (t *quarkusTrait) addBuildSteps(e *Environment) {
+	e.Steps = append(e.Steps, runtime.QuarkusSteps...)
+}
+
+func (t *quarkusTrait) addRuntimeDependencies(e *Environment, dependencies *[]string) error {
+	for _, s := range e.Integration.Sources() {
+		meta := metadata.Extract(e.CamelCatalog, s)
+
+		switch language := s.InferLanguage(); language {
+		case v1alpha1.LanguageYaml:
+			addRuntimeDependency("camel-k-quarkus-loader-yaml", dependencies)
+		case v1alpha1.LanguageXML:
+			addRuntimeDependency("camel-k-quarkus-loader-xml", dependencies)
+		case v1alpha1.LanguageJavaScript:
+			addRuntimeDependency("camel-k-quarkus-loader-js", dependencies)
+		default:
+			return fmt.Errorf("unsupported language for Quarkus runtime: %s", language)
+		}
+
+		if strings.HasPrefix(s.Loader, "knative-source") {
+			addRuntimeDependency("camel-k-quarkus-loader-knative", dependencies)
+			addRuntimeDependency("camel-k-quarkus-knative", dependencies)
+		}
+
+		// main required by default
+		addRuntimeDependency("camel-k-runtime-quarkus", dependencies)
+
+		for _, d := range meta.Dependencies.List() {
+			util.StringSliceUniqueAdd(dependencies, d)
+		}
+	}
+	return nil
+}
+
+func (t *quarkusTrait) addContainerEnvironment(e *Environment) {
+	envvar.SetVal(&e.EnvVars, envVarAppJAR, "camel-k-integration-"+defaults.Version+"-runner.jar")
+}
+
+func addRuntimeDependency(dependency string, dependencies *[]string) {
+	util.StringSliceUniqueAdd(dependencies, fmt.Sprintf("mvn:org.apache.camel.k/%s", dependency))
+}
diff --git a/pkg/trait/rest-dsl.go b/pkg/trait/rest-dsl.go
index ef6b22b..6a03ad4 100644
--- a/pkg/trait/rest-dsl.go
+++ b/pkg/trait/rest-dsl.go
@@ -27,15 +27,13 @@ import (
 	"strconv"
 	"strings"
 
-	"github.com/apache/camel-k/pkg/util/kubernetes"
-
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 
-	"github.com/apache/camel-k/pkg/gzip"
-
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/gzip"
 	"github.com/apache/camel-k/pkg/util/defaults"
+	"github.com/apache/camel-k/pkg/util/kubernetes"
 	"github.com/apache/camel-k/pkg/util/maven"
 )
 
diff --git a/pkg/trait/trait_catalog.go b/pkg/trait/trait_catalog.go
index b682314..96b6862 100644
--- a/pkg/trait/trait_catalog.go
+++ b/pkg/trait/trait_catalog.go
@@ -52,6 +52,7 @@ type Catalog struct {
 	tClasspath        Trait
 	tRestDsl          Trait
 	tProbes           Trait
+	tQuarkus          Trait
 	tContainer        Trait
 }
 
@@ -80,6 +81,7 @@ func NewCatalog(ctx context.Context, c client.Client) *Catalog {
 		tEnvironment:      newEnvironmentTrait(),
 		tClasspath:        newClasspathTrait(),
 		tProbes:           newProbesTrait(),
+		tQuarkus:          newQuarkusTrait(),
 		tContainer:        newContainerTrait(),
 	}
 
@@ -117,6 +119,7 @@ func (c *Catalog) allTraits() []Trait {
 		c.tEnvironment,
 		c.tClasspath,
 		c.tProbes,
+		c.tQuarkus,
 		c.tContainer,
 	}
 }
@@ -133,6 +136,7 @@ func (c *Catalog) traitsFor(environment *Environment) []Trait {
 			c.tRestDsl,
 			c.tDependencies,
 			c.tBuilder,
+			c.tQuarkus,
 			c.tEnvironment,
 			c.tDeployer,
 			c.tDeployment,
@@ -155,6 +159,7 @@ func (c *Catalog) traitsFor(environment *Environment) []Trait {
 			c.tRestDsl,
 			c.tDependencies,
 			c.tBuilder,
+			c.tQuarkus,
 			c.tEnvironment,
 			c.tDeployer,
 			c.tDeployment,
@@ -178,6 +183,7 @@ func (c *Catalog) traitsFor(environment *Environment) []Trait {
 			c.tKnative,
 			c.tDependencies,
 			c.tBuilder,
+			c.tQuarkus,
 			c.tEnvironment,
 			c.tDeployer,
 			c.tDeployment,
diff --git a/pkg/util/maven/maven.go b/pkg/util/maven/maven.go
index a881bd4..067feca 100644
--- a/pkg/util/maven/maven.go
+++ b/pkg/util/maven/maven.go
@@ -90,7 +90,6 @@ func Run(ctx Context) error {
 	}
 
 	args := make([]string, 0)
-	args = append(args, ctx.AdditionalArguments...)
 	args = append(args, "--batch-mode")
 
 	if ctx.LocalRepository == "" {
@@ -109,6 +108,8 @@ func Run(ctx Context) error {
 		args = append(args, "--settings", settingsPath)
 	}
 
+	args = append(args, ctx.AdditionalArguments...)
+
 	timeout := ctx.Timeout
 	if timeout == 0 {
 		timeout = math.MaxInt64
@@ -120,7 +121,11 @@ func Run(ctx Context) error {
 	cmd := exec.CommandContext(c, mvnCmd, args...)
 	cmd.Dir = ctx.Path
 	cmd.Stderr = os.Stderr
-	cmd.Stdout = os.Stdout
+	if ctx.Stdout != nil {
+		cmd.Stdout = ctx.Stdout
+	} else {
+		cmd.Stdout = os.Stdout
+	}
 
 	Log.WithValues("timeout", timeout.String()).Infof("executing: %s", strings.Join(cmd.Args, " "))
 
@@ -139,8 +144,6 @@ func ParseGAV(gav string) (Dependency, error) {
 	rex := regexp.MustCompile("([^: ]+):([^: ]+)(:([^: ]*)(:([^: ]+))?)?(:([^: ]+))?")
 	res := rex.FindStringSubmatch(gav)
 
-	fmt.Println(res, len(res))
-
 	if res == nil || len(res) < 9 {
 		return Dependency{}, errors.New("GAV must match <groupId>:<artifactId>[:<packagingType>[:<classifier>]]:(<version>|'?')")
 	}
diff --git a/pkg/util/maven/maven_types.go b/pkg/util/maven/maven_types.go
index 6adbd06..0bd31f4 100644
--- a/pkg/util/maven/maven_types.go
+++ b/pkg/util/maven/maven_types.go
@@ -21,6 +21,7 @@ import (
 	"bytes"
 	"encoding/xml"
 	"fmt"
+	"io"
 	"time"
 )
 
@@ -109,6 +110,7 @@ type Context struct {
 	AdditionalEntries   map[string]interface{}
 	Timeout             time.Duration
 	LocalRepository     string
+	Stdout              io.Writer
 }
 
 // AddEntry --


[camel-k] 22/38: chore(quarkus): Move LocalRepository field to MavenSpec

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit a50369e90db7476b2665bb5a9dce6f23f4dea156
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Fri Oct 25 11:48:10 2019 +0200

    chore(quarkus): Move LocalRepository field to MavenSpec
---
 pkg/apis/camel/v1alpha1/common_types.go              | 5 +++--
 pkg/apis/camel/v1alpha1/integrationplatform_types.go | 1 -
 pkg/builder/runtime/main.go                          | 2 +-
 pkg/builder/runtime/quarkus.go                       | 2 +-
 pkg/cmd/describe_platform.go                         | 2 +-
 pkg/cmd/install.go                                   | 2 +-
 pkg/controller/integrationplatform/initialize.go     | 6 +++---
 pkg/trait/camel.go                                   | 2 +-
 pkg/trait/rest-dsl.go                                | 2 +-
 9 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/pkg/apis/camel/v1alpha1/common_types.go b/pkg/apis/camel/v1alpha1/common_types.go
index 2833890..f54c19c 100644
--- a/pkg/apis/camel/v1alpha1/common_types.go
+++ b/pkg/apis/camel/v1alpha1/common_types.go
@@ -77,8 +77,9 @@ type PlatformInjectable interface {
 
 // MavenSpec --
 type MavenSpec struct {
-	Settings ValueSource     `json:"settings,omitempty"`
-	Timeout  metav1.Duration `json:"timeout,omitempty"`
+	LocalRepository string          `json:"localRepository,omitempty"`
+	Settings        ValueSource     `json:"settings,omitempty"`
+	Timeout         metav1.Duration `json:"timeout,omitempty"`
 }
 
 // ValueSource --
diff --git a/pkg/apis/camel/v1alpha1/integrationplatform_types.go b/pkg/apis/camel/v1alpha1/integrationplatform_types.go
index b41aeba..6626eae 100644
--- a/pkg/apis/camel/v1alpha1/integrationplatform_types.go
+++ b/pkg/apis/camel/v1alpha1/integrationplatform_types.go
@@ -100,7 +100,6 @@ type IntegrationPlatformBuildSpec struct {
 	RuntimeProvider       *RuntimeProvider                        `json:"runtimeProvider,omitempty"`
 	BaseImage             string                                  `json:"baseImage,omitempty"`
 	Properties            map[string]string                       `json:"properties,omitempty"`
-	LocalRepository       string                                  `json:"localRepository,omitempty"`
 	Registry              IntegrationPlatformRegistrySpec         `json:"registry,omitempty"`
 	Timeout               metav1.Duration                         `json:"timeout,omitempty"`
 	PersistentVolumeClaim string                                  `json:"persistentVolumeClaim,omitempty"`
diff --git a/pkg/builder/runtime/main.go b/pkg/builder/runtime/main.go
index e525cc7..c8854f9 100644
--- a/pkg/builder/runtime/main.go
+++ b/pkg/builder/runtime/main.go
@@ -80,7 +80,7 @@ func generateProject(ctx *builder.Context) error {
 func computeDependencies(ctx *builder.Context) error {
 	mc := maven.NewContext(path.Join(ctx.Path, "maven"), ctx.Maven.Project)
 	mc.SettingsContent = ctx.Maven.SettingsData
-	mc.LocalRepository = ctx.Build.Platform.Build.LocalRepository
+	mc.LocalRepository = ctx.Build.Platform.Build.Maven.LocalRepository
 	mc.Timeout = ctx.Build.Platform.Build.Maven.Timeout.Duration
 	mc.AddArgumentf("org.apache.camel.k:camel-k-maven-plugin:%s:generate-dependency-list", ctx.Catalog.RuntimeVersion)
 
diff --git a/pkg/builder/runtime/quarkus.go b/pkg/builder/runtime/quarkus.go
index f25a2ae..7cf1736 100644
--- a/pkg/builder/runtime/quarkus.go
+++ b/pkg/builder/runtime/quarkus.go
@@ -87,7 +87,7 @@ func generateQuarkusProject(ctx *builder.Context) error {
 func computeQuarkusDependencies(ctx *builder.Context) error {
 	mc := maven.NewContext(path.Join(ctx.Path, "maven"), ctx.Maven.Project)
 	mc.SettingsContent = ctx.Maven.SettingsData
-	mc.LocalRepository = ctx.Build.Platform.Build.LocalRepository
+	mc.LocalRepository = ctx.Build.Platform.Build.Maven.LocalRepository
 	mc.Timeout = ctx.Build.Platform.Build.Maven.Timeout.Duration
 
 	// Build the project, as the quarkus-bootstrap plugin build-tree goal
diff --git a/pkg/cmd/describe_platform.go b/pkg/cmd/describe_platform.go
index a1b42c4..58e74a1 100644
--- a/pkg/cmd/describe_platform.go
+++ b/pkg/cmd/describe_platform.go
@@ -92,7 +92,7 @@ func (command *describePlatformCommand) describeIntegrationPlatform(platform v1a
 		w.Write(0, "Version:\t%s\n", platform.Status.Version)
 		w.Write(0, "Base Image:\t%s\n", platform.Spec.Build.BaseImage)
 		w.Write(0, "Camel Version:\t%s\n", platform.Spec.Build.CamelVersion)
-		w.Write(0, "Local Repository:\t%s\n", platform.Spec.Build.LocalRepository)
+		w.Write(0, "Local Repository:\t%s\n", platform.Spec.Build.Maven.LocalRepository)
 		w.Write(0, "Publish Strategy:\t%s\n", platform.Spec.Build.PublishStrategy)
 
 		if len(platform.Spec.Resources.Kits) > 0 {
diff --git a/pkg/cmd/install.go b/pkg/cmd/install.go
index 5e9caaf..2f54088 100644
--- a/pkg/cmd/install.go
+++ b/pkg/cmd/install.go
@@ -186,7 +186,7 @@ func (o *installCmdOptions) install(cobraCmd *cobra.Command, _ []string) error {
 			}
 		}
 		if o.localRepository != "" {
-			platform.Spec.Build.LocalRepository = o.localRepository
+			platform.Spec.Build.Maven.LocalRepository = o.localRepository
 		}
 		if o.camelVersion != "" {
 			platform.Spec.Build.CamelVersion = o.camelVersion
diff --git a/pkg/controller/integrationplatform/initialize.go b/pkg/controller/integrationplatform/initialize.go
index 2424851..663a3b5 100644
--- a/pkg/controller/integrationplatform/initialize.go
+++ b/pkg/controller/integrationplatform/initialize.go
@@ -183,8 +183,8 @@ func (action *initializeAction) setDefaults(ctx context.Context, platform *v1alp
 	if platform.Spec.Build.BaseImage == "" {
 		platform.Spec.Build.BaseImage = defaults.BaseImage
 	}
-	if platform.Spec.Build.LocalRepository == "" {
-		platform.Spec.Build.LocalRepository = defaults.LocalRepository
+	if platform.Spec.Build.Maven.LocalRepository == "" {
+		platform.Spec.Build.Maven.LocalRepository = defaults.LocalRepository
 	}
 	if platform.Spec.Build.PersistentVolumeClaim == "" {
 		platform.Spec.Build.PersistentVolumeClaim = platform.Name
@@ -254,7 +254,7 @@ func (action *initializeAction) setDefaults(ctx context.Context, platform *v1alp
 	action.L.Infof("CamelVersion set to %s", platform.Spec.Build.CamelVersion)
 	action.L.Infof("RuntimeVersion set to %s", platform.Spec.Build.RuntimeVersion)
 	action.L.Infof("BaseImage set to %s", platform.Spec.Build.BaseImage)
-	action.L.Infof("LocalRepository set to %s", platform.Spec.Build.LocalRepository)
+	action.L.Infof("LocalRepository set to %s", platform.Spec.Build.Maven.LocalRepository)
 	action.L.Infof("Timeout set to %s", platform.Spec.Build.Timeout)
 	action.L.Infof("Maven Timeout set to %s", platform.Spec.Build.Maven.Timeout.Duration)
 
diff --git a/pkg/trait/camel.go b/pkg/trait/camel.go
index 3cd0bd9..9a8281a 100644
--- a/pkg/trait/camel.go
+++ b/pkg/trait/camel.go
@@ -166,7 +166,7 @@ func (t *camelTrait) generateCatalog(e *Environment, camelVersion string, runtim
 	project := t.generateMavenProject(camelVersion, runtimeVersion)
 
 	mc := maven.NewContext(tmpDir, project)
-	mc.LocalRepository = e.Platform.Spec.Build.LocalRepository
+	mc.LocalRepository = e.Platform.Spec.Build.Maven.LocalRepository
 	mc.Timeout = e.Platform.Spec.Build.Maven.Timeout.Duration
 	mc.AddSystemProperty("catalog.path", tmpDir)
 	mc.AddSystemProperty("catalog.file", "catalog.yaml")
diff --git a/pkg/trait/rest-dsl.go b/pkg/trait/rest-dsl.go
index 6a03ad4..317873a 100644
--- a/pkg/trait/rest-dsl.go
+++ b/pkg/trait/rest-dsl.go
@@ -111,7 +111,7 @@ func (t *restDslTrait) Apply(e *Environment) error {
 		}
 
 		mc := maven.NewContext(tmpDir, project)
-		mc.LocalRepository = e.Platform.Spec.Build.LocalRepository
+		mc.LocalRepository = e.Platform.Spec.Build.Maven.LocalRepository
 		mc.Timeout = e.Platform.Spec.Build.Maven.Timeout.Duration
 		mc.AddArgument("-Dopenapi.spec=" + in)
 		mc.AddArgument("-Ddsl.out=" + out)


[camel-k] 07/38: feat(quarkus): Support loading Camel Quarkus catalog

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit e6f028156593395e098eeec0a38b14902ee3bae0
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Tue Oct 22 15:35:22 2019 +0200

    feat(quarkus): Support loading Camel Quarkus catalog
---
 pkg/builder/builder_steps.go           |  18 -----
 pkg/builder/runtime/main.go            |  13 ++++
 pkg/builder/runtime/quarkus.go         |  15 +++-
 pkg/builder/runtime/runtime.go         |  10 +++
 pkg/controller/integrationkit/build.go |  16 ++--
 pkg/trait/camel.go                     | 132 ++++++++++++++++++---------------
 pkg/trait/camel_test.go                |   9 +--
 pkg/trait/quarkus.go                   |  23 ++++++
 pkg/util/camel/camel_runtime.go        |  30 ++++++--
 pkg/util/camel/camel_util.go           |  35 ++++++++-
 pkg/util/camel/camel_util_test.go      |  20 ++---
 pkg/util/camel/catalog.go              |   2 +-
 12 files changed, 210 insertions(+), 113 deletions(-)

diff --git a/pkg/builder/builder_steps.go b/pkg/builder/builder_steps.go
index d6b1f3f..32a54fa 100644
--- a/pkg/builder/builder_steps.go
+++ b/pkg/builder/builder_steps.go
@@ -27,7 +27,6 @@ import (
 	k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
-	"github.com/apache/camel-k/pkg/util/camel"
 	"github.com/apache/camel-k/pkg/util/kubernetes"
 	"github.com/apache/camel-k/pkg/util/maven"
 	"github.com/apache/camel-k/pkg/util/tar"
@@ -40,7 +39,6 @@ func init() {
 }
 
 type steps struct {
-	LoadCatalog             Step
 	GenerateProjectSettings Step
 	InjectDependencies      Step
 	SanitizeDependencies    Step
@@ -50,10 +48,6 @@ type steps struct {
 
 // Steps --
 var Steps = steps{
-	LoadCatalog: NewStep(
-		InitPhase,
-		loadCatalog,
-	),
 	GenerateProjectSettings: NewStep(
 		ProjectGenerationPhase+1,
 		generateProjectSettings,
@@ -78,7 +72,6 @@ var Steps = steps{
 
 // DefaultSteps --
 var DefaultSteps = []Step{
-	Steps.LoadCatalog,
 	Steps.GenerateProjectSettings,
 	Steps.InjectDependencies,
 	Steps.SanitizeDependencies,
@@ -111,17 +104,6 @@ func registerStep(steps ...Step) {
 	}
 }
 
-func loadCatalog(ctx *Context) error {
-	catalog, err := camel.LoadCatalog(ctx.C, ctx.Client, ctx.Build.Meta.Namespace, ctx.Build.CamelVersion, ctx.Build.RuntimeVersion)
-	if err != nil {
-		return err
-	}
-
-	ctx.Catalog = catalog
-
-	return nil
-}
-
 func generateProjectSettings(ctx *Context) error {
 	val, err := kubernetes.ResolveValueSource(ctx.C, ctx.Client, ctx.Namespace, &ctx.Build.Platform.Build.Maven.Settings)
 	if err != nil {
diff --git a/pkg/builder/runtime/main.go b/pkg/builder/runtime/main.go
index 4b363a0..03fddda 100644
--- a/pkg/builder/runtime/main.go
+++ b/pkg/builder/runtime/main.go
@@ -27,16 +27,29 @@ import (
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/builder"
+	"github.com/apache/camel-k/pkg/util/camel"
 	"github.com/apache/camel-k/pkg/util/defaults"
 	"github.com/apache/camel-k/pkg/util/maven"
 )
 
 // MainSteps --
 var MainSteps = []builder.Step{
+	Steps.LoadCamelCatalog,
 	Steps.GenerateProject,
 	Steps.ComputeDependencies,
 }
 
+func loadCamelCatalog(ctx *builder.Context) error {
+	catalog, err := camel.LoadCatalog(ctx.C, ctx.Client, ctx.Build.Meta.Namespace, ctx.Build.CamelVersion, ctx.Build.RuntimeVersion, nil)
+	if err != nil {
+		return err
+	}
+
+	ctx.Catalog = catalog
+
+	return nil
+}
+
 func generateProject(ctx *builder.Context) error {
 	p := maven.NewProjectWithGAV("org.apache.camel.k.integration", "camel-k-integration", defaults.Version)
 	p.Properties = ctx.Build.Platform.Build.Properties
diff --git a/pkg/builder/runtime/quarkus.go b/pkg/builder/runtime/quarkus.go
index df0faf5..c3c734a 100644
--- a/pkg/builder/runtime/quarkus.go
+++ b/pkg/builder/runtime/quarkus.go
@@ -10,16 +10,29 @@ import (
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/builder"
+	"github.com/apache/camel-k/pkg/util/camel"
 	"github.com/apache/camel-k/pkg/util/defaults"
 	"github.com/apache/camel-k/pkg/util/maven"
 )
 
 // QuarkusSteps --
 var QuarkusSteps = []builder.Step{
+	Steps.LoadCamelQuarkusCatalog,
 	Steps.GenerateQuarkusProject,
 	Steps.ComputeQuarkusDependencies,
 }
 
+func loadCamelQuarkusCatalog(ctx *builder.Context) error {
+	catalog, err := camel.LoadCatalog(ctx.C, ctx.Client, ctx.Build.Meta.Namespace, ctx.Build.CamelVersion, ctx.Build.RuntimeVersion, ctx.Build.RuntimeProvider.Quarkus)
+	if err != nil {
+		return err
+	}
+
+	ctx.Catalog = catalog
+
+	return nil
+}
+
 func generateQuarkusProject(ctx *builder.Context) error {
 	p := maven.NewProjectWithGAV("org.apache.camel.k.integration", "camel-k-integration", defaults.Version)
 	p.Properties = ctx.Build.Platform.Build.Properties
@@ -82,7 +95,7 @@ func computeQuarkusDependencies(ctx *builder.Context) error {
 
 	// Build the project, as the quarkus-bootstrap plugin build-tree goal
 	// requires the artifact to be installed
-	mc.AddArgument("package")
+	mc.AddArgument("install")
 	if err := maven.Run(mc); err != nil {
 		return errors.Wrap(err, "failure while building project")
 	}
diff --git a/pkg/builder/runtime/runtime.go b/pkg/builder/runtime/runtime.go
index 22106e0..ebd2162 100644
--- a/pkg/builder/runtime/runtime.go
+++ b/pkg/builder/runtime/runtime.go
@@ -28,15 +28,21 @@ func init() {
 // TODO: organise runtime steps into nested structs
 type steps struct {
 	// Main
+	LoadCamelCatalog    builder.Step
 	GenerateProject     builder.Step
 	ComputeDependencies builder.Step
 	// Quarkus
+	LoadCamelQuarkusCatalog    builder.Step
 	GenerateQuarkusProject     builder.Step
 	ComputeQuarkusDependencies builder.Step
 }
 
 var Steps = steps{
 	// Main
+	LoadCamelCatalog: builder.NewStep(
+		builder.InitPhase,
+		loadCamelCatalog,
+	),
 	GenerateProject: builder.NewStep(
 		builder.ProjectGenerationPhase,
 		generateProject,
@@ -46,6 +52,10 @@ var Steps = steps{
 		computeDependencies,
 	),
 	// Quarkus
+	LoadCamelQuarkusCatalog: builder.NewStep(
+		builder.InitPhase,
+		loadCamelQuarkusCatalog,
+	),
 	GenerateQuarkusProject: builder.NewStep(
 		builder.ProjectGenerationPhase,
 		generateQuarkusProject,
diff --git a/pkg/controller/integrationkit/build.go b/pkg/controller/integrationkit/build.go
index 7f68382..cbc1471 100644
--- a/pkg/controller/integrationkit/build.go
+++ b/pkg/controller/integrationkit/build.go
@@ -92,13 +92,15 @@ func (action *buildAction) handleBuildSubmitted(ctx context.Context, kit *v1alph
 				Name:      kit.Name,
 			},
 			Spec: v1alpha1.BuildSpec{
-				Meta:           kit.ObjectMeta,
-				CamelVersion:   env.CamelCatalog.Version,
-				RuntimeVersion: env.RuntimeVersion,
-				Platform:       env.Platform.Spec,
-				Dependencies:   kit.Spec.Dependencies,
-				Steps:          builder.StepIDsFor(env.Steps...),
-				BuildDir:       env.BuildDir,
+				Meta:            kit.ObjectMeta,
+				CamelVersion:    env.CamelCatalog.Version,
+				RuntimeVersion:  env.RuntimeVersion,
+				RuntimeProvider: env.CamelCatalog.RuntimeProvider,
+				Platform:        env.Platform.Spec,
+				Dependencies:    kit.Spec.Dependencies,
+				// TODO: sort for easy read
+				Steps:    builder.StepIDsFor(env.Steps...),
+				BuildDir: env.BuildDir,
 			},
 		}
 
diff --git a/pkg/trait/camel.go b/pkg/trait/camel.go
index b776d9c..c7c8a61 100644
--- a/pkg/trait/camel.go
+++ b/pkg/trait/camel.go
@@ -25,15 +25,17 @@ import (
 	"regexp"
 	"strings"
 
+	yaml2 "gopkg.in/yaml.v2"
+
+	"github.com/pkg/errors"
+
+	k8serrors "k8s.io/apimachinery/pkg/api/errors"
+
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/util/camel"
 	"github.com/apache/camel-k/pkg/util/defaults"
 	"github.com/apache/camel-k/pkg/util/kubernetes"
 	"github.com/apache/camel-k/pkg/util/maven"
-	"github.com/pkg/errors"
-
-	yaml2 "gopkg.in/yaml.v2"
-	k8serrors "k8s.io/apimachinery/pkg/api/errors"
 )
 
 type camelTrait struct {
@@ -57,11 +59,6 @@ func (t *camelTrait) Configure(e *Environment) (bool, error) {
 }
 
 func (t *camelTrait) Apply(e *Environment) error {
-	ns := e.DetermineNamespace()
-	if ns == "" {
-		return errors.New("unable to determine namespace")
-	}
-
 	cv := e.DetermineCamelVersion()
 	rv := e.DetermineRuntimeVersion()
 
@@ -73,52 +70,21 @@ func (t *camelTrait) Apply(e *Environment) error {
 	}
 
 	if e.CamelCatalog == nil {
-		c, err := camel.LoadCatalog(e.C, e.Client, ns, cv, rv)
+		var catalog *camel.RuntimeCatalog
+		var err error
+		quarkus := e.Catalog.GetTrait("quarkus").(*quarkusTrait)
+		if quarkus.isEnabled() {
+			catalog, err = quarkus.loadOrCreateCatalog(e, cv, rv)
+		} else {
+			catalog, err = t.loadOrCreateCatalog(e, cv, rv)
+		}
 		if err != nil {
 			return err
-		}
-		if c == nil {
-			// if the catalog is not found in the cluster, try to create it if
-			// the required versions (camel and runtime) are not expressed as
-			// semver constraints
-			cvHasFixedVersion, err := regexp.MatchString(`^(\d+)\.(\d+)\.([\w-\.]+)$`, cv)
-			if err != nil {
-				return err
-			}
-			rvHasFixedVersion, err := regexp.MatchString(`^(\d+)\.(\d+)\.([\w-\.]+)$`, rv)
-			if err != nil {
-				return err
-			}
-
-			if cvHasFixedVersion && rvHasFixedVersion {
-				c, err = t.GenerateCatalog(e, cv, rv)
-				if err != nil {
-					return err
-				}
-
-				// sanitize catalog name
-				catalogName := "camel-catalog-" + strings.ToLower(cv+"-"+rv)
-
-				cx := v1alpha1.NewCamelCatalogWithSpecs(ns, catalogName, c.CamelCatalogSpec)
-				cx.Labels = make(map[string]string)
-				cx.Labels["app"] = "camel-k"
-				cx.Labels["camel.apache.org/catalog.version"] = cv
-				cx.Labels["camel.apache.org/catalog.loader.version"] = cv
-				cx.Labels["camel.apache.org/runtime.version"] = rv
-				cx.Labels["camel.apache.org/catalog.generated"] = True
-
-				err = e.Client.Create(e.C, &cx)
-				if err != nil && !k8serrors.IsAlreadyExists(err) {
-					return err
-				}
-			}
-		}
-
-		if c == nil {
+		} else if catalog == nil {
 			return fmt.Errorf("unable to find catalog for: %s", cv)
 		}
 
-		e.CamelCatalog = c
+		e.CamelCatalog = catalog
 	}
 
 	e.RuntimeVersion = rv
@@ -126,17 +92,68 @@ func (t *camelTrait) Apply(e *Environment) error {
 	if e.Integration != nil {
 		e.Integration.Status.CamelVersion = e.CamelCatalog.Version
 		e.Integration.Status.RuntimeVersion = rv
+		e.Integration.Status.RuntimeProvider = e.CamelCatalog.RuntimeProvider
 	}
 	if e.IntegrationKit != nil {
 		e.IntegrationKit.Status.CamelVersion = e.CamelCatalog.Version
 		e.IntegrationKit.Status.RuntimeVersion = rv
+		e.IntegrationKit.Status.RuntimeProvider = e.CamelCatalog.RuntimeProvider
 	}
 
 	return nil
 }
 
-// GenerateCatalog --
-func (t *camelTrait) GenerateCatalog(e *Environment, camelVersion string, runtimeVersion string) (*camel.RuntimeCatalog, error) {
+func (t *camelTrait) loadOrCreateCatalog(e *Environment, camelVersion string, runtimeVersion string) (*camel.RuntimeCatalog, error) {
+	ns := e.DetermineNamespace()
+	if ns == "" {
+		return nil, errors.New("unable to determine namespace")
+	}
+
+	c, err := camel.LoadCatalog(e.C, e.Client, ns, camelVersion, runtimeVersion, nil)
+	if err != nil {
+		return nil, err
+	}
+
+	if c == nil {
+		// if the catalog is not found in the cluster, try to create it if
+		// the required versions (camel and runtime) are not expressed as
+		// semver constraints
+		cvHasFixedVersion, err := regexp.MatchString(`^(\d+)\.(\d+)\.([\w-\.]+)$`, camelVersion)
+		if err != nil {
+			return nil, err
+		}
+		rvHasFixedVersion, err := regexp.MatchString(`^(\d+)\.(\d+)\.([\w-\.]+)$`, runtimeVersion)
+		if err != nil {
+			return nil, err
+		}
+
+		if cvHasFixedVersion && rvHasFixedVersion {
+			c, err = t.generateCatalog(e, camelVersion, runtimeVersion)
+			if err != nil {
+				return nil, err
+			}
+
+			// sanitize catalog name
+			catalogName := "camel-catalog-" + strings.ToLower(camelVersion+"-"+runtimeVersion)
+
+			cx := v1alpha1.NewCamelCatalogWithSpecs(ns, catalogName, c.CamelCatalogSpec)
+			cx.Labels = make(map[string]string)
+			cx.Labels["app"] = "camel-k"
+			cx.Labels["camel.apache.org/catalog.version"] = camelVersion
+			cx.Labels["camel.apache.org/catalog.loader.version"] = camelVersion
+			cx.Labels["camel.apache.org/runtime.version"] = runtimeVersion
+			cx.Labels["camel.apache.org/catalog.generated"] = True
+
+			err = e.Client.Create(e.C, &cx)
+			if err != nil && !k8serrors.IsAlreadyExists(err) {
+				return nil, err
+			}
+		}
+	}
+	return c, nil
+}
+
+func (t *camelTrait) generateCatalog(e *Environment, camelVersion string, runtimeVersion string) (*camel.RuntimeCatalog, error) {
 	root := os.TempDir()
 	tmpDir, err := ioutil.TempDir(root, "camel-catalog")
 	if err != nil {
@@ -149,10 +166,7 @@ func (t *camelTrait) GenerateCatalog(e *Environment, camelVersion string, runtim
 		return nil, err
 	}
 
-	project, err := t.GenerateMavenProject(camelVersion, runtimeVersion)
-	if err != nil {
-		return nil, err
-	}
+	project := t.generateMavenProject(camelVersion, runtimeVersion)
 
 	mc := maven.NewContext(tmpDir, project)
 	mc.LocalRepository = e.Platform.Spec.Build.LocalRepository
@@ -191,9 +205,9 @@ func (t *camelTrait) GenerateCatalog(e *Environment, camelVersion string, runtim
 	return camel.NewRuntimeCatalog(catalog.Spec), nil
 }
 
-// GenerateCatalogMavenProject --
-func (t *camelTrait) GenerateMavenProject(camelVersion string, runtimeVersion string) (maven.Project, error) {
+func (t *camelTrait) generateMavenProject(camelVersion string, runtimeVersion string) maven.Project {
 	p := maven.NewProjectWithGAV("org.apache.camel.k.integration", "camel-k-catalog-generator", defaults.Version)
+
 	p.Build = &maven.Build{
 		DefaultGoal: "generate-resources",
 		Plugins: []maven.Plugin{
@@ -220,5 +234,5 @@ func (t *camelTrait) GenerateMavenProject(camelVersion string, runtimeVersion st
 		},
 	}
 
-	return p, nil
+	return p
 }
diff --git a/pkg/trait/camel_test.go b/pkg/trait/camel_test.go
index ee35856..24c5032 100644
--- a/pkg/trait/camel_test.go
+++ b/pkg/trait/camel_test.go
@@ -72,8 +72,7 @@ func TestApplyCamelTraitWithoutEnvironmentCatalogAndUnmatchableVersionFails(t *t
 func TestCamelTraitGenerateMavenProjectSucceeds(t *testing.T) {
 	trait, _ := createNominalCamelTest()
 
-	mvnProject, err := trait.GenerateMavenProject("1.23.0", "1.0.0")
-	assert.Nil(t, err)
+	mvnProject := trait.generateMavenProject("1.23.0", "1.0.0")
 	assert.NotNil(t, mvnProject)
 	assert.Equal(t, "org.apache.camel.k.integration", mvnProject.GroupID)
 	assert.Equal(t, "camel-k-catalog-generator", mvnProject.ArtifactID)
@@ -96,7 +95,6 @@ func TestCamelTraitGenerateMavenProjectSucceeds(t *testing.T) {
 }
 
 func createNominalCamelTest() (*camelTrait, *Environment) {
-
 	client, _ := test.NewFakeClient()
 
 	trait := newCamelTrait()
@@ -109,8 +107,9 @@ func createNominalCamelTest() (*camelTrait, *Environment) {
 				Version: "1.23.0",
 			},
 		},
-		C:      context.TODO(),
-		Client: client,
+		Catalog: NewEnvironmentTestCatalog(),
+		C:       context.TODO(),
+		Client:  client,
 		Integration: &v1alpha1.Integration{
 			ObjectMeta: metav1.ObjectMeta{
 				Namespace: "namespace",
diff --git a/pkg/trait/quarkus.go b/pkg/trait/quarkus.go
index 8b70b11..2be0cac 100644
--- a/pkg/trait/quarkus.go
+++ b/pkg/trait/quarkus.go
@@ -21,10 +21,13 @@ import (
 	"fmt"
 	"strings"
 
+	"github.com/pkg/errors"
+
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/builder/runtime"
 	"github.com/apache/camel-k/pkg/metadata"
 	"github.com/apache/camel-k/pkg/util"
+	"github.com/apache/camel-k/pkg/util/camel"
 	"github.com/apache/camel-k/pkg/util/defaults"
 	"github.com/apache/camel-k/pkg/util/envvar"
 )
@@ -51,6 +54,26 @@ func (t *quarkusTrait) Apply(e *Environment) error {
 	return nil
 }
 
+func (t *quarkusTrait) loadOrCreateCatalog(e *Environment, camelVersion string, runtimeVersion string) (*camel.RuntimeCatalog, error) {
+	ns := e.DetermineNamespace()
+	if ns == "" {
+		return nil, errors.New("unable to determine namespace")
+	}
+
+	c, err := camel.LoadCatalog(e.C, e.Client, ns, camelVersion, runtimeVersion, v1alpha1.QuarkusRuntimeProvider{
+		// FIXME
+		CamelQuarkusVersion: "0.2.0",
+		QuarkusVersion:      "0.21.2",
+	})
+	if err != nil {
+		return nil, err
+	}
+
+	// TODO: generate a catalog if nil
+
+	return c, nil
+}
+
 func (t *quarkusTrait) addBuildSteps(e *Environment) {
 	e.Steps = append(e.Steps, runtime.QuarkusSteps...)
 }
diff --git a/pkg/util/camel/camel_runtime.go b/pkg/util/camel/camel_runtime.go
index a0d502a..331d648 100644
--- a/pkg/util/camel/camel_runtime.go
+++ b/pkg/util/camel/camel_runtime.go
@@ -28,24 +28,38 @@ import (
 )
 
 // LoadCatalog --
-func LoadCatalog(ctx context.Context, client client.Client, namespace string, camelVersion string, runtimeVersion string) (*RuntimeCatalog, error) {
-	var catalog *RuntimeCatalog
-	var err error
+func LoadCatalog(ctx context.Context, client client.Client, namespace string, camelVersion string, runtimeVersion string, provider interface{}) (*RuntimeCatalog, error) {
+	options := []k8sclient.ListOption{
+		k8sclient.InNamespace(namespace),
+	}
+
+	if _, ok := provider.(v1alpha1.QuarkusRuntimeProvider); ok {
+		options = append(options, k8sclient.MatchingLabels{
+			"camel.apache.org/runtime.provider": "quarkus",
+		})
+	}
 
 	list := v1alpha1.NewCamelCatalogList()
-	err = client.List(ctx, &list, k8sclient.InNamespace(namespace))
+	err := client.List(ctx, &list, options...)
 	if err != nil {
 		return nil, err
 	}
 
-	catalog, err = findBestMatch(list.Items, camelVersion, runtimeVersion)
+	catalog, err := findBestMatch(list.Items, camelVersion, runtimeVersion, provider)
 	if err != nil {
 		return nil, err
 	}
 
-	if catalog == nil {
-		return nil, fmt.Errorf("unable to find catalog matching version requirement: camel=%s, runtime=%s", camelVersion, runtimeVersion)
+	if catalog != nil {
+		return catalog, nil
 	}
 
-	return catalog, nil
+	switch provider := provider.(type) {
+	case v1alpha1.QuarkusRuntimeProvider:
+		return nil, fmt.Errorf("unable to find catalog matching version requirement: camel=%s, runtime=%s, camel-quarkus=%s, quarkus=%s",
+			camelVersion, runtimeVersion, provider.CamelQuarkusVersion, provider.QuarkusVersion)
+	default:
+		return nil, fmt.Errorf("unable to find catalog matching version requirement: camel=%s, runtime=%s",
+			camelVersion, runtimeVersion)
+	}
 }
diff --git a/pkg/util/camel/camel_util.go b/pkg/util/camel/camel_util.go
index ae80ac7..6aecdfe 100644
--- a/pkg/util/camel/camel_util.go
+++ b/pkg/util/camel/camel_util.go
@@ -26,7 +26,8 @@ import (
 	"github.com/apache/camel-k/pkg/util/log"
 )
 
-func findBestMatch(catalogs []v1alpha1.CamelCatalog, camelVersion string, runtimeVersion string) (*RuntimeCatalog, error) {
+func findBestMatch(catalogs []v1alpha1.CamelCatalog, camelVersion string, runtimeVersion string, provider interface{}) (*RuntimeCatalog, error) {
+	// FIXME: take the provider into account for exact match
 	for _, catalog := range catalogs {
 		if catalog.Spec.Version == camelVersion && catalog.Spec.RuntimeVersion == runtimeVersion {
 			return NewRuntimeCatalog(catalog.Spec), nil
@@ -40,9 +41,35 @@ func findBestMatch(catalogs []v1alpha1.CamelCatalog, camelVersion string, runtim
 	}
 
 	cc := newCatalogVersionCollection(catalogs)
-	for _, x := range cc {
-		if vc.Check(x.Version) && rc.Check(x.RuntimeVersion) {
-			return NewRuntimeCatalog(x.Catalog.Spec), nil
+
+	switch provider := provider.(type) {
+	case v1alpha1.QuarkusRuntimeProvider:
+		qc := newSemVerConstraint(provider.QuarkusVersion)
+		cqc := newSemVerConstraint(provider.CamelQuarkusVersion)
+		if qc == nil || cqc == nil {
+			return nil, nil
+		}
+		for _, c := range cc {
+			qv, err := semver.NewVersion(c.Catalog.Spec.RuntimeProvider.Quarkus.QuarkusVersion)
+			if err != nil {
+				log.Debugf("Invalid semver version (quarkus) %s", qv)
+				continue
+			}
+			cqv, err := semver.NewVersion(c.Catalog.Spec.RuntimeProvider.Quarkus.CamelQuarkusVersion)
+			if err != nil {
+				log.Debugf("Invalid semver version (camel quarkus) %s", cqv)
+				continue
+			}
+			if vc.Check(c.Version) && rc.Check(c.RuntimeVersion) && qc.Check(qv) && cqc.Check(cqv) {
+				return NewRuntimeCatalog(c.Catalog.Spec), nil
+			}
+		}
+
+	default:
+		for _, c := range cc {
+			if vc.Check(c.Version) && rc.Check(c.RuntimeVersion) {
+				return NewRuntimeCatalog(c.Catalog.Spec), nil
+			}
 		}
 	}
 
diff --git a/pkg/util/camel/camel_util_test.go b/pkg/util/camel/camel_util_test.go
index 456556a..2e02c50 100644
--- a/pkg/util/camel/camel_util_test.go
+++ b/pkg/util/camel/camel_util_test.go
@@ -32,7 +32,7 @@ func TestFindBestMatch_Camel(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := findBestMatch(catalogs, "~2.23.x", "1.0.0")
+	c, err := findBestMatch(catalogs, "~2.23.x", "1.0.0", nil)
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.1", c.Version)
@@ -45,7 +45,7 @@ func TestFindBestMatch_Runtime(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := findBestMatch(catalogs, "2.23.0", "~1.0.x")
+	c, err := findBestMatch(catalogs, "2.23.0", "~1.0.x", nil)
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.0", c.Version)
@@ -60,7 +60,7 @@ func TestFindBestMatch(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := findBestMatch(catalogs, "~2.23.x", "~1.0.x")
+	c, err := findBestMatch(catalogs, "~2.23.x", "~1.0.x", nil)
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.1", c.Version)
@@ -74,7 +74,7 @@ func TestFindExactSemVerMatch_Camel(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := findBestMatch(catalogs, "2.23.0", "1.0.0")
+	c, err := findBestMatch(catalogs, "2.23.0", "1.0.0", nil)
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.0", c.Version)
@@ -87,7 +87,7 @@ func TestFindExactSemVerMatch_Runtime(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := findBestMatch(catalogs, "2.23.0", "1.0.0")
+	c, err := findBestMatch(catalogs, "2.23.0", "1.0.0", nil)
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.0", c.Version)
@@ -102,7 +102,7 @@ func TestFindExactMatch_Camel(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := findBestMatch(catalogs, "2.23.1-tag-00001", "1.0.0")
+	c, err := findBestMatch(catalogs, "2.23.1-tag-00001", "1.0.0", nil)
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.1-tag-00001", c.Version)
@@ -116,7 +116,7 @@ func TestFindExactMatch_Runtime(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := findBestMatch(catalogs, "2.23.1-tag-00001", "1.0.1")
+	c, err := findBestMatch(catalogs, "2.23.1-tag-00001", "1.0.1", nil)
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.1-tag-00001", c.Version)
@@ -131,7 +131,7 @@ func TestFindRangeMatch_Camel(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := findBestMatch(catalogs, ">= 2.23.0, < 2.23.2", "1.0.0")
+	c, err := findBestMatch(catalogs, ">= 2.23.0, < 2.23.2", "1.0.0", nil)
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.1", c.Version)
@@ -146,7 +146,7 @@ func TestFindRangeMatch_Runtime(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := findBestMatch(catalogs, "2.23.0", "> 1.0.1, < 1.0.3")
+	c, err := findBestMatch(catalogs, "2.23.0", "> 1.0.1, < 1.0.3", nil)
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.0", c.Version)
@@ -163,7 +163,7 @@ func TestFindRangeMatch(t *testing.T) {
 		{Spec: v1alpha1.CamelCatalogSpec{Version: "2.22.1", RuntimeVersion: "1.0.0"}},
 	}
 
-	c, err := findBestMatch(catalogs, ">= 2.23.0, < 2.23.2", "> 1.0.1, < 1.0.3")
+	c, err := findBestMatch(catalogs, ">= 2.23.0, < 2.23.2", "> 1.0.1, < 1.0.3", nil)
 	assert.Nil(t, err)
 	assert.NotNil(t, c)
 	assert.Equal(t, "2.23.1", c.Version)
diff --git a/pkg/util/camel/catalog.go b/pkg/util/camel/catalog.go
index 4b8df56..a5a6d1e 100644
--- a/pkg/util/camel/catalog.go
+++ b/pkg/util/camel/catalog.go
@@ -42,5 +42,5 @@ func DefaultCatalog() (*RuntimeCatalog, error) {
 		}
 	}
 
-	return findBestMatch(catalogs, defaults.DefaultCamelVersion, defaults.DefaultRuntimeVersion)
+	return findBestMatch(catalogs, defaults.DefaultCamelVersion, defaults.DefaultRuntimeVersion, nil)
 }


[camel-k] 21/38: feat(quarkus): Add default values for Camel Quarkus / Quarkus versions and constraints

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 2e3c089f05b5ddb231993ad69613481c9c13f854
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Thu Oct 24 18:37:58 2019 +0200

    feat(quarkus): Add default values for Camel Quarkus / Quarkus versions and constraints
---
 pkg/trait/quarkus.go          |  6 ++----
 pkg/util/camel/catalog.go     |  5 +++--
 pkg/util/defaults/defaults.go | 12 ++++++++++++
 script/Makefile               | 15 +++++++++++++++
 4 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/pkg/trait/quarkus.go b/pkg/trait/quarkus.go
index 7a9ab4d..9dfe8ba 100644
--- a/pkg/trait/quarkus.go
+++ b/pkg/trait/quarkus.go
@@ -140,8 +140,7 @@ func (t *quarkusTrait) determineQuarkusVersion(e *Environment) string {
 		e.Platform.Spec.Build.RuntimeProvider.Quarkus.QuarkusVersion != "" {
 		return e.Platform.Spec.Build.RuntimeProvider.Quarkus.QuarkusVersion
 	}
-	// FIXME
-	return "0.21.2"
+	return defaults.QuarkusVersionConstraint
 }
 
 func (t *quarkusTrait) determineCamelQuarkusVersion(e *Environment) string {
@@ -160,6 +159,5 @@ func (t *quarkusTrait) determineCamelQuarkusVersion(e *Environment) string {
 		e.Platform.Spec.Build.RuntimeProvider.Quarkus.CamelQuarkusVersion != "" {
 		return e.Platform.Spec.Build.RuntimeProvider.Quarkus.CamelQuarkusVersion
 	}
-	// FIXME
-	return "0.2.0"
+	return defaults.CamelQuarkusVersionConstraint
 }
diff --git a/pkg/util/camel/catalog.go b/pkg/util/camel/catalog.go
index e4442c9..adcf510 100644
--- a/pkg/util/camel/catalog.go
+++ b/pkg/util/camel/catalog.go
@@ -35,8 +35,9 @@ func DefaultCatalog() (*RuntimeCatalog, error) {
 // QuarkusCatalog --
 func QuarkusCatalog() (*RuntimeCatalog, error) {
 	return catalogForRuntimeProvider(v1alpha1.QuarkusRuntimeProvider{
-		CamelQuarkusVersion: "0.2.0",
-		QuarkusVersion:      "0.21.2",
+		// Can be replaced with the default Camel Quarkus version when it's stable
+		CamelQuarkusVersion: defaults.CamelQuarkusVersionConstraint,
+		QuarkusVersion:      defaults.DefaultQuarkusVersion,
 	})
 }
 
diff --git a/pkg/util/defaults/defaults.go b/pkg/util/defaults/defaults.go
index e131d10..660e4b4 100644
--- a/pkg/util/defaults/defaults.go
+++ b/pkg/util/defaults/defaults.go
@@ -36,6 +36,18 @@ const (
 	// RuntimeVersionConstraint --
 	RuntimeVersionConstraint = ">=1.0.5"
 
+	// DefaultCamelQuarkusVersion --
+	DefaultCamelQuarkusVersion = "0.2.1-SNAPSHOT"
+
+	// CamelQuarkusVersionConstraint --
+	CamelQuarkusVersionConstraint = ">=0.2.0"
+
+	// DefaultQuarkusVersion --
+	DefaultQuarkusVersion = "0.21.2"
+
+	// QuarkusVersionConstraint --
+	QuarkusVersionConstraint = ">=0.21.2"
+
 	// KanikoVersion --
 	KanikoVersion = "0.9.0"
 
diff --git a/script/Makefile b/script/Makefile
index e639858..80f5a48 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -21,6 +21,9 @@ RUNTIME_VERSION_CONSTRAINT := >=1.0.5
 CAMEL_VERSION := 3.0.0-RC1
 CAMEL_VERSION_CONSTRAINT := >=3.0.0-RC1
 CAMEL_QUARKUS_VERSION := 0.2.1-SNAPSHOT
+CAMEL_QUARKUS_VERSION_CONSTRAINT := >=0.2.0
+QUARKUS_VERSION := 0.21.2
+QUARKUS_VERSION_CONSTRAINT := >=0.21.2
 KANIKO_VERSION := 0.9.0
 BASE_IMAGE := fabric8/s2i-java:3.0-java8
 LOCAL_REPOSITORY := /tmp/artifacts/m2
@@ -91,6 +94,18 @@ codegen:
 	@echo "  // RuntimeVersionConstraint -- " >> $(VERSIONFILE)
 	@echo "  RuntimeVersionConstraint = \"$(RUNTIME_VERSION_CONSTRAINT)\"" >> $(VERSIONFILE)
 	@echo "" >> $(VERSIONFILE)
+	@echo "  // DefaultCamelQuarkusVersion -- " >> $(VERSIONFILE)
+	@echo "  DefaultCamelQuarkusVersion = \"$(CAMEL_QUARKUS_VERSION)\"" >> $(VERSIONFILE)
+	@echo "" >> $(VERSIONFILE)
+	@echo "  // CamelQuarkusVersionConstraint -- " >> $(VERSIONFILE)
+	@echo "  CamelQuarkusVersionConstraint = \"$(CAMEL_QUARKUS_VERSION_CONSTRAINT)\"" >> $(VERSIONFILE)
+	@echo "" >> $(VERSIONFILE)
+	@echo "  // DefaultQuarkusVersion -- " >> $(VERSIONFILE)
+	@echo "  DefaultQuarkusVersion = \"$(QUARKUS_VERSION)\"" >> $(VERSIONFILE)
+	@echo "" >> $(VERSIONFILE)
+	@echo "  // QuarkusVersionConstraint -- " >> $(VERSIONFILE)
+	@echo "  QuarkusVersionConstraint = \"$(QUARKUS_VERSION_CONSTRAINT)\"" >> $(VERSIONFILE)
+	@echo "" >> $(VERSIONFILE)
 	@echo "  // KanikoVersion -- " >> $(VERSIONFILE)
 	@echo "  KanikoVersion = \"$(KANIKO_VERSION)\"" >> $(VERSIONFILE)
 	@echo "" >> $(VERSIONFILE)


[camel-k] 27/38: fix(Quarkus): Fix on the flight Camel catalog generation

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 9ff6f5b5d2b041aa5e8293f4b63100c61842561b
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Mon Oct 28 11:17:21 2019 +0100

    fix(Quarkus): Fix on the flight Camel catalog generation
---
 pkg/builder/runtime/main.go     |  6 ++++++
 pkg/builder/runtime/quarkus.go  |  6 ++++++
 pkg/trait/camel.go              | 19 ++++++++++---------
 pkg/trait/quarkus.go            |  7 ++++++-
 pkg/util/camel/camel_runtime.go | 18 +++---------------
 5 files changed, 31 insertions(+), 25 deletions(-)

diff --git a/pkg/builder/runtime/main.go b/pkg/builder/runtime/main.go
index c8854f9..4f2cb3e 100644
--- a/pkg/builder/runtime/main.go
+++ b/pkg/builder/runtime/main.go
@@ -18,6 +18,7 @@ limitations under the License.
 package runtime
 
 import (
+	"fmt"
 	"io/ioutil"
 	"path"
 
@@ -45,6 +46,11 @@ func loadCamelCatalog(ctx *builder.Context) error {
 		return err
 	}
 
+	if catalog == nil {
+		return fmt.Errorf("unable to find catalog matching version requirement: camel=%s, runtime=%s",
+			ctx.Build.CamelVersion, ctx.Build.RuntimeVersion)
+	}
+
 	ctx.Catalog = catalog
 
 	return nil
diff --git a/pkg/builder/runtime/quarkus.go b/pkg/builder/runtime/quarkus.go
index 7cf1736..265e0da 100644
--- a/pkg/builder/runtime/quarkus.go
+++ b/pkg/builder/runtime/quarkus.go
@@ -3,6 +3,7 @@ package runtime
 import (
 	"bufio"
 	"bytes"
+	"fmt"
 	"os"
 	"path"
 
@@ -28,6 +29,11 @@ func loadCamelQuarkusCatalog(ctx *builder.Context) error {
 		return err
 	}
 
+	if catalog == nil {
+		return fmt.Errorf("unable to find catalog matching version requirement: camel=%s, runtime=%s, camel-quarkus=%s, quarkus=%s",
+			ctx.Build.CamelVersion, ctx.Build.RuntimeVersion, ctx.Build.RuntimeProvider.Quarkus.CamelQuarkusVersion, ctx.Build.RuntimeProvider.Quarkus.QuarkusVersion)
+	}
+
 	ctx.Catalog = catalog
 
 	return nil
diff --git a/pkg/trait/camel.go b/pkg/trait/camel.go
index 2a07b37..d43d188 100644
--- a/pkg/trait/camel.go
+++ b/pkg/trait/camel.go
@@ -68,10 +68,6 @@ func (t *camelTrait) Apply(e *Environment) error {
 		}
 	}
 
-	if e.CamelCatalog == nil {
-		return fmt.Errorf("unable to find catalog for: %s", cv)
-	}
-
 	e.RuntimeVersion = rv
 
 	if e.Integration != nil {
@@ -94,17 +90,17 @@ func (t *camelTrait) loadOrCreateCatalog(e *Environment, camelVersion string, ru
 		return errors.New("unable to determine namespace")
 	}
 
-	c, err := camel.LoadCatalog(e.C, e.Client, ns, camelVersion, runtimeVersion, nil)
+	catalog, err := camel.LoadCatalog(e.C, e.Client, ns, camelVersion, runtimeVersion, nil)
 	if err != nil {
 		return err
 	}
 
-	if c == nil {
+	if catalog == nil {
 		// if the catalog is not found in the cluster, try to create it if
 		// the required versions (camel and runtime) are not expressed as
 		// semver constraints
 		if exactVersionRegexp.MatchString(camelVersion) && exactVersionRegexp.MatchString(runtimeVersion) {
-			c, err = camel.GenerateCatalog(e.C, e.Client, ns, e.Platform.Spec.Build.Maven, camelVersion, runtimeVersion)
+			catalog, err = camel.GenerateCatalog(e.C, e.Client, ns, e.Platform.Spec.Build.Maven, camelVersion, runtimeVersion)
 			if err != nil {
 				return err
 			}
@@ -112,7 +108,7 @@ func (t *camelTrait) loadOrCreateCatalog(e *Environment, camelVersion string, ru
 			// sanitize catalog name
 			catalogName := "camel-catalog-" + strings.ToLower(camelVersion+"-"+runtimeVersion)
 
-			cx := v1alpha1.NewCamelCatalogWithSpecs(ns, catalogName, c.CamelCatalogSpec)
+			cx := v1alpha1.NewCamelCatalogWithSpecs(ns, catalogName, catalog.CamelCatalogSpec)
 			cx.Labels = make(map[string]string)
 			cx.Labels["app"] = "camel-k"
 			cx.Labels["camel.apache.org/catalog.version"] = camelVersion
@@ -127,7 +123,12 @@ func (t *camelTrait) loadOrCreateCatalog(e *Environment, camelVersion string, ru
 		}
 	}
 
-	e.CamelCatalog = c
+	if catalog == nil {
+		return fmt.Errorf("unable to find catalog matching version requirement: camel=%s, runtime=%s",
+			camelVersion, runtimeVersion)
+	}
+
+	e.CamelCatalog = catalog
 
 	return nil
 }
diff --git a/pkg/trait/quarkus.go b/pkg/trait/quarkus.go
index 208a551..1a3bff4 100644
--- a/pkg/trait/quarkus.go
+++ b/pkg/trait/quarkus.go
@@ -94,7 +94,7 @@ func (t *quarkusTrait) loadOrCreateCatalog(e *Environment, camelVersion string,
 			}
 
 			// sanitize catalog name
-			catalogName := "camel-catalog-quarkus" + strings.ToLower(camelVersion+"-"+runtimeVersion)
+			catalogName := "camel-catalog-quarkus-" + strings.ToLower(camelVersion+"-"+runtimeVersion)
 
 			cx := v1alpha1.NewCamelCatalogWithSpecs(ns, catalogName, catalog.CamelCatalogSpec)
 			cx.Labels = make(map[string]string)
@@ -112,6 +112,11 @@ func (t *quarkusTrait) loadOrCreateCatalog(e *Environment, camelVersion string,
 		}
 	}
 
+	if catalog == nil {
+		return fmt.Errorf("unable to find catalog matching version requirement: camel=%s, runtime=%s, camel-quarkus=%s, quarkus=%s",
+			camelVersion, runtimeVersion, camelQuarkusVersion, quarkusVersion)
+	}
+
 	e.CamelCatalog = catalog
 
 	return nil
diff --git a/pkg/util/camel/camel_runtime.go b/pkg/util/camel/camel_runtime.go
index b62b967..c9aea1b 100644
--- a/pkg/util/camel/camel_runtime.go
+++ b/pkg/util/camel/camel_runtime.go
@@ -19,7 +19,6 @@ package camel
 
 import (
 	"context"
-	"fmt"
 
 	"k8s.io/apimachinery/pkg/labels"
 	"k8s.io/apimachinery/pkg/selection"
@@ -28,7 +27,7 @@ import (
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/client"
-	controllerUtil "github.com/apache/camel-k/pkg/util/controller"
+	"github.com/apache/camel-k/pkg/util/controller"
 )
 
 // LoadCatalog --
@@ -40,7 +39,7 @@ func LoadCatalog(ctx context.Context, client client.Client, namespace string, ca
 	if provider == nil {
 		integration, _ := labels.NewRequirement("camel.apache.org/runtime.provider", selection.DoesNotExist, []string{})
 		selector := labels.NewSelector().Add(*integration)
-		options = append(options, controllerUtil.MatchingSelector{Selector: selector})
+		options = append(options, controller.MatchingSelector{Selector: selector})
 	} else if _, ok := provider.(v1alpha1.QuarkusRuntimeProvider); ok {
 		options = append(options, k8sclient.MatchingLabels{
 			"camel.apache.org/runtime.provider": "quarkus",
@@ -58,16 +57,5 @@ func LoadCatalog(ctx context.Context, client client.Client, namespace string, ca
 		return nil, err
 	}
 
-	if catalog != nil {
-		return catalog, nil
-	}
-
-	switch provider := provider.(type) {
-	case v1alpha1.QuarkusRuntimeProvider:
-		return nil, fmt.Errorf("unable to find catalog matching version requirement: camel=%s, runtime=%s, camel-quarkus=%s, quarkus=%s",
-			camelVersion, runtimeVersion, provider.CamelQuarkusVersion, provider.QuarkusVersion)
-	default:
-		return nil, fmt.Errorf("unable to find catalog matching version requirement: camel=%s, runtime=%s",
-			camelVersion, runtimeVersion)
-	}
+	return catalog, nil
 }


[camel-k] 23/38: chore(quarkus): Factorize Camel catalog runtime generation logic

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit bc20fe15d64d7d923a49193201b00867007737d1
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Fri Oct 25 11:56:06 2019 +0200

    chore(quarkus): Factorize Camel catalog runtime generation logic
---
 pkg/trait/camel.go             | 106 +----------------------------------------
 pkg/trait/camel_test.go        |  25 ----------
 pkg/trait/util.go              |  10 ++++
 pkg/util/camel/catalog.go      |  88 ++++++++++++++++++++++++++++++++++
 pkg/util/camel/catalog_test.go |  47 ++++++++++++++++++
 5 files changed, 147 insertions(+), 129 deletions(-)

diff --git a/pkg/trait/camel.go b/pkg/trait/camel.go
index 9a8281a..2a07b37 100644
--- a/pkg/trait/camel.go
+++ b/pkg/trait/camel.go
@@ -19,23 +19,14 @@ package trait
 
 import (
 	"fmt"
-	"io/ioutil"
-	"os"
-	"path"
-	"regexp"
 	"strings"
 
-	yaml2 "gopkg.in/yaml.v2"
-
 	"github.com/pkg/errors"
 
 	k8serrors "k8s.io/apimachinery/pkg/api/errors"
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/util/camel"
-	"github.com/apache/camel-k/pkg/util/defaults"
-	"github.com/apache/camel-k/pkg/util/kubernetes"
-	"github.com/apache/camel-k/pkg/util/maven"
 )
 
 type camelTrait struct {
@@ -112,17 +103,8 @@ func (t *camelTrait) loadOrCreateCatalog(e *Environment, camelVersion string, ru
 		// if the catalog is not found in the cluster, try to create it if
 		// the required versions (camel and runtime) are not expressed as
 		// semver constraints
-		cvHasFixedVersion, err := regexp.MatchString(`^(\d+)\.(\d+)\.([\w-\.]+)$`, camelVersion)
-		if err != nil {
-			return err
-		}
-		rvHasFixedVersion, err := regexp.MatchString(`^(\d+)\.(\d+)\.([\w-\.]+)$`, runtimeVersion)
-		if err != nil {
-			return err
-		}
-
-		if cvHasFixedVersion && rvHasFixedVersion {
-			c, err = t.generateCatalog(e, camelVersion, runtimeVersion)
+		if exactVersionRegexp.MatchString(camelVersion) && exactVersionRegexp.MatchString(runtimeVersion) {
+			c, err = camel.GenerateCatalog(e.C, e.Client, ns, e.Platform.Spec.Build.Maven, camelVersion, runtimeVersion)
 			if err != nil {
 				return err
 			}
@@ -150,90 +132,6 @@ func (t *camelTrait) loadOrCreateCatalog(e *Environment, camelVersion string, ru
 	return nil
 }
 
-func (t *camelTrait) generateCatalog(e *Environment, camelVersion string, runtimeVersion string) (*camel.RuntimeCatalog, error) {
-	root := os.TempDir()
-	tmpDir, err := ioutil.TempDir(root, "camel-catalog")
-	if err != nil {
-		return nil, err
-	}
-
-	defer os.RemoveAll(tmpDir)
-
-	if err := os.MkdirAll(tmpDir, os.ModePerm); err != nil {
-		return nil, err
-	}
-
-	project := t.generateMavenProject(camelVersion, runtimeVersion)
-
-	mc := maven.NewContext(tmpDir, project)
-	mc.LocalRepository = e.Platform.Spec.Build.Maven.LocalRepository
-	mc.Timeout = e.Platform.Spec.Build.Maven.Timeout.Duration
-	mc.AddSystemProperty("catalog.path", tmpDir)
-	mc.AddSystemProperty("catalog.file", "catalog.yaml")
-
-	ns := e.DetermineNamespace()
-	if ns == "" {
-		return nil, errors.New("unable to determine namespace")
-	}
-
-	settings, err := kubernetes.ResolveValueSource(e.C, e.Client, ns, &e.Platform.Spec.Build.Maven.Settings)
-	if err != nil {
-		return nil, err
-	}
-	if settings != "" {
-		mc.SettingsContent = []byte(settings)
-	}
-
-	err = maven.Run(mc)
-	if err != nil {
-		return nil, err
-	}
-
-	content, err := ioutil.ReadFile(path.Join(tmpDir, "catalog.yaml"))
-	if err != nil {
-		return nil, err
-	}
-
-	catalog := v1alpha1.CamelCatalog{}
-	if err := yaml2.Unmarshal(content, &catalog); err != nil {
-		return nil, err
-	}
-
-	return camel.NewRuntimeCatalog(catalog.Spec), nil
-}
-
-func (t *camelTrait) generateMavenProject(camelVersion string, runtimeVersion string) maven.Project {
-	p := maven.NewProjectWithGAV("org.apache.camel.k.integration", "camel-k-catalog-generator", defaults.Version)
-
-	p.Build = &maven.Build{
-		DefaultGoal: "generate-resources",
-		Plugins: []maven.Plugin{
-			{
-				GroupID:    "org.apache.camel.k",
-				ArtifactID: "camel-k-maven-plugin",
-				Version:    runtimeVersion,
-				Executions: []maven.Execution{
-					{
-						ID: "generate-catalog",
-						Goals: []string{
-							"generate-catalog",
-						},
-					},
-				},
-				Dependencies: []maven.Dependency{
-					{
-						GroupID:    "org.apache.camel",
-						ArtifactID: "camel-catalog",
-						Version:    camelVersion,
-					},
-				},
-			},
-		},
-	}
-
-	return p
-}
-
 func (t *camelTrait) determineCamelVersion(e *Environment) string {
 	if t.Version != "" {
 		return t.Version
diff --git a/pkg/trait/camel_test.go b/pkg/trait/camel_test.go
index 24c5032..49f594d 100644
--- a/pkg/trait/camel_test.go
+++ b/pkg/trait/camel_test.go
@@ -69,31 +69,6 @@ func TestApplyCamelTraitWithoutEnvironmentCatalogAndUnmatchableVersionFails(t *t
 	assert.Equal(t, "unable to find catalog matching version requirement: camel=Unmatchable version, runtime=0.0.1", err.Error())
 }
 
-func TestCamelTraitGenerateMavenProjectSucceeds(t *testing.T) {
-	trait, _ := createNominalCamelTest()
-
-	mvnProject := trait.generateMavenProject("1.23.0", "1.0.0")
-	assert.NotNil(t, mvnProject)
-	assert.Equal(t, "org.apache.camel.k.integration", mvnProject.GroupID)
-	assert.Equal(t, "camel-k-catalog-generator", mvnProject.ArtifactID)
-	assert.NotNil(t, mvnProject.Build)
-	assert.Equal(t, "generate-resources", mvnProject.Build.DefaultGoal)
-	assert.NotNil(t, mvnProject.Build.Plugins)
-	assert.Len(t, mvnProject.Build.Plugins, 1)
-	assert.Equal(t, "org.apache.camel.k", mvnProject.Build.Plugins[0].GroupID)
-	assert.Equal(t, "camel-k-maven-plugin", mvnProject.Build.Plugins[0].ArtifactID)
-	assert.NotNil(t, mvnProject.Build.Plugins[0].Executions)
-	assert.Len(t, mvnProject.Build.Plugins[0].Executions, 1)
-	assert.Equal(t, "generate-catalog", mvnProject.Build.Plugins[0].Executions[0].ID)
-	assert.NotNil(t, mvnProject.Build.Plugins[0].Executions[0].Goals)
-	assert.Len(t, mvnProject.Build.Plugins[0].Executions[0].Goals, 1)
-	assert.Equal(t, "generate-catalog", mvnProject.Build.Plugins[0].Executions[0].Goals[0])
-	assert.NotNil(t, mvnProject.Build.Plugins[0].Dependencies)
-	assert.Len(t, mvnProject.Build.Plugins[0].Dependencies, 1)
-	assert.Equal(t, "org.apache.camel", mvnProject.Build.Plugins[0].Dependencies[0].GroupID)
-	assert.Equal(t, "camel-catalog", mvnProject.Build.Plugins[0].Dependencies[0].ArtifactID)
-}
-
 func createNominalCamelTest() (*camelTrait, *Environment) {
 	client, _ := test.NewFakeClient()
 
diff --git a/pkg/trait/util.go b/pkg/trait/util.go
index da5b20a..9c3e12c 100644
--- a/pkg/trait/util.go
+++ b/pkg/trait/util.go
@@ -33,6 +33,16 @@ import (
 	k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
 )
 
+var exactVersionRegexp regexp.Regexp
+
+func init() {
+	r, err := regexp.Compile(`^(\d+)\.(\d+)\.([\w-\.]+)$`)
+	if err != nil {
+		panic(err)
+	}
+	exactVersionRegexp = *r
+}
+
 // GetIntegrationKit retrieves the kit set on the integration
 func GetIntegrationKit(ctx context.Context, c client.Client, integration *v1alpha1.Integration) (*v1alpha1.IntegrationKit, error) {
 	if integration.Status.Kit == "" {
diff --git a/pkg/util/camel/catalog.go b/pkg/util/camel/catalog.go
index adcf510..4505334 100644
--- a/pkg/util/camel/catalog.go
+++ b/pkg/util/camel/catalog.go
@@ -18,13 +18,21 @@ limitations under the License.
 package camel
 
 import (
+	"context"
+	"io/ioutil"
+	"os"
+	"path"
 	"strings"
 
 	yaml2 "gopkg.in/yaml.v2"
 
+	k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
+
 	"github.com/apache/camel-k/deploy"
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/util/defaults"
+	"github.com/apache/camel-k/pkg/util/kubernetes"
+	"github.com/apache/camel-k/pkg/util/maven"
 )
 
 // DefaultCatalog --
@@ -57,3 +65,83 @@ func catalogForRuntimeProvider(provider interface{}) (*RuntimeCatalog, error) {
 
 	return findBestMatch(catalogs, defaults.DefaultCamelVersion, defaults.DefaultRuntimeVersion, provider)
 }
+
+// GenerateCatalog --
+func GenerateCatalog(ctx context.Context, client k8sclient.Reader, namespace string, mvn v1alpha1.MavenSpec, camelVersion string, runtimeVersion string) (*RuntimeCatalog, error) {
+	root := os.TempDir()
+	tmpDir, err := ioutil.TempDir(root, "camel-catalog")
+	if err != nil {
+		return nil, err
+	}
+
+	defer os.RemoveAll(tmpDir)
+
+	if err := os.MkdirAll(tmpDir, os.ModePerm); err != nil {
+		return nil, err
+	}
+
+	project := generateMavenProject(camelVersion, runtimeVersion)
+
+	mc := maven.NewContext(tmpDir, project)
+	mc.LocalRepository = mvn.LocalRepository
+	mc.Timeout = mvn.Timeout.Duration
+	mc.AddSystemProperty("catalog.path", tmpDir)
+	mc.AddSystemProperty("catalog.file", "catalog.yaml")
+
+	settings, err := kubernetes.ResolveValueSource(ctx, client, namespace, &mvn.Settings)
+	if err != nil {
+		return nil, err
+	}
+	if settings != "" {
+		mc.SettingsContent = []byte(settings)
+	}
+
+	err = maven.Run(mc)
+	if err != nil {
+		return nil, err
+	}
+
+	content, err := ioutil.ReadFile(path.Join(tmpDir, "catalog.yaml"))
+	if err != nil {
+		return nil, err
+	}
+
+	catalog := v1alpha1.CamelCatalog{}
+	if err := yaml2.Unmarshal(content, &catalog); err != nil {
+		return nil, err
+	}
+
+	return NewRuntimeCatalog(catalog.Spec), nil
+}
+
+func generateMavenProject(camelVersion string, runtimeVersion string) maven.Project {
+	p := maven.NewProjectWithGAV("org.apache.camel.k.integration", "camel-k-catalog-generator", defaults.Version)
+
+	p.Build = &maven.Build{
+		DefaultGoal: "generate-resources",
+		Plugins: []maven.Plugin{
+			{
+				GroupID:    "org.apache.camel.k",
+				ArtifactID: "camel-k-maven-plugin",
+				Version:    runtimeVersion,
+				Executions: []maven.Execution{
+					{
+						ID: "generate-catalog",
+						Goals: []string{
+							"generate-catalog",
+						},
+					},
+				},
+				Dependencies: []maven.Dependency{
+					{
+						GroupID:    "org.apache.camel",
+						ArtifactID: "camel-catalog",
+						Version:    camelVersion,
+					},
+				},
+			},
+		},
+	}
+
+	return p
+}
diff --git a/pkg/util/camel/catalog_test.go b/pkg/util/camel/catalog_test.go
new file mode 100644
index 0000000..47ab71f
--- /dev/null
+++ b/pkg/util/camel/catalog_test.go
@@ -0,0 +1,47 @@
+/*
+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 camel
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func TestCamelTraitGenerateMavenProjectSucceeds(t *testing.T) {
+	mvnProject := generateMavenProject("1.23.0", "1.0.0", nil)
+	assert.NotNil(t, mvnProject)
+	assert.Equal(t, "org.apache.camel.k.integration", mvnProject.GroupID)
+	assert.Equal(t, "camel-k-catalog-generator", mvnProject.ArtifactID)
+	assert.NotNil(t, mvnProject.Build)
+	assert.Equal(t, "generate-resources", mvnProject.Build.DefaultGoal)
+	assert.NotNil(t, mvnProject.Build.Plugins)
+	assert.Len(t, mvnProject.Build.Plugins, 1)
+	assert.Equal(t, "org.apache.camel.k", mvnProject.Build.Plugins[0].GroupID)
+	assert.Equal(t, "camel-k-maven-plugin", mvnProject.Build.Plugins[0].ArtifactID)
+	assert.NotNil(t, mvnProject.Build.Plugins[0].Executions)
+	assert.Len(t, mvnProject.Build.Plugins[0].Executions, 1)
+	assert.Equal(t, "generate-catalog", mvnProject.Build.Plugins[0].Executions[0].ID)
+	assert.NotNil(t, mvnProject.Build.Plugins[0].Executions[0].Goals)
+	assert.Len(t, mvnProject.Build.Plugins[0].Executions[0].Goals, 1)
+	assert.Equal(t, "generate-catalog", mvnProject.Build.Plugins[0].Executions[0].Goals[0])
+	assert.NotNil(t, mvnProject.Build.Plugins[0].Dependencies)
+	assert.Len(t, mvnProject.Build.Plugins[0].Dependencies, 1)
+	assert.Equal(t, "org.apache.camel", mvnProject.Build.Plugins[0].Dependencies[0].GroupID)
+	assert.Equal(t, "camel-catalog", mvnProject.Build.Plugins[0].Dependencies[0].ArtifactID)
+}


[camel-k] 36/38: feat(quarkus): Prepare catalogs for Camel runtime version 1.0.7

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit ced7f5fcf88d74fb8a107b447df5b68fe2324daf
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Oct 30 12:46:18 2019 +0100

    feat(quarkus): Prepare catalogs for Camel runtime version 1.0.7
---
 deploy/camel-catalog-3.0.0-RC1-1.0.7-SNAPSHOT.yaml | 2213 +++++++++++++++++++
 ...amel-catalog-quarkus-0.3.0-1.0.7-SNAPSHOT.yaml} |    6 +-
 deploy/resources.go                                | 2225 +++++++++++++++++++-
 pkg/util/camel/catalog.go                          |   17 +-
 4 files changed, 4452 insertions(+), 9 deletions(-)

diff --git a/deploy/camel-catalog-3.0.0-RC1-1.0.7-SNAPSHOT.yaml b/deploy/camel-catalog-3.0.0-RC1-1.0.7-SNAPSHOT.yaml
new file mode 100644
index 0000000..893e143
--- /dev/null
+++ b/deploy/camel-catalog-3.0.0-RC1-1.0.7-SNAPSHOT.yaml
@@ -0,0 +1,2213 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+apiVersion: camel.apache.org/v1alpha1
+kind: CamelCatalog
+metadata:
+  name: camel-catalog-3.0.0-rc1-1.0.7-SNAPSHOT
+  labels:
+    app: camel-k
+    camel.apache.org/catalog.version: 3.0.0-RC1
+    camel.apache.org/catalog.loader.version: 3.0.0-RC1
+    camel.apache.org/runtime.version: 1.0.7-SNAPSHOT
+spec:
+  version: 3.0.0-RC1
+  runtimeVersion: 1.0.7-SNAPSHOT
+  artifacts:
+    camel-activemq:
+      groupId: org.apache.camel
+      artifactId: camel-activemq
+      schemes:
+      - id: activemq
+        http: false
+        passive: false
+    camel-ahc:
+      groupId: org.apache.camel
+      artifactId: camel-ahc
+      schemes:
+      - id: ahc
+        http: true
+        passive: false
+    camel-ahc-ws:
+      groupId: org.apache.camel
+      artifactId: camel-ahc-ws
+      schemes:
+      - id: ahc-ws
+        http: true
+        passive: false
+      - id: ahc-wss
+        http: false
+        passive: false
+    camel-amqp:
+      groupId: org.apache.camel
+      artifactId: camel-amqp
+      schemes:
+      - id: amqp
+        http: false
+        passive: false
+    camel-any23:
+      groupId: org.apache.camel
+      artifactId: camel-any23
+      dataformats:
+      - any23
+    camel-apns:
+      groupId: org.apache.camel
+      artifactId: camel-apns
+      schemes:
+      - id: apns
+        http: false
+        passive: false
+    camel-as2:
+      groupId: org.apache.camel
+      artifactId: camel-as2
+      schemes:
+      - id: as2
+        http: false
+        passive: false
+    camel-asn1:
+      groupId: org.apache.camel
+      artifactId: camel-asn1
+      dataformats:
+      - asn1
+    camel-asterisk:
+      groupId: org.apache.camel
+      artifactId: camel-asterisk
+      schemes:
+      - id: asterisk
+        http: false
+        passive: false
+    camel-atmos:
+      groupId: org.apache.camel
+      artifactId: camel-atmos
+      schemes:
+      - id: atmos
+        http: false
+        passive: false
+    camel-atmosphere-websocket:
+      groupId: org.apache.camel
+      artifactId: camel-atmosphere-websocket
+      schemes:
+      - id: atmosphere-websocket
+        http: true
+        passive: false
+    camel-atom:
+      groupId: org.apache.camel
+      artifactId: camel-atom
+      schemes:
+      - id: atom
+        http: false
+        passive: false
+    camel-atomix:
+      groupId: org.apache.camel
+      artifactId: camel-atomix
+      schemes:
+      - id: atomix-map
+        http: false
+        passive: false
+      - id: atomix-messaging
+        http: false
+        passive: false
+      - id: atomix-multimap
+        http: false
+        passive: false
+      - id: atomix-queue
+        http: false
+        passive: false
+      - id: atomix-set
+        http: false
+        passive: false
+      - id: atomix-value
+        http: false
+        passive: false
+    camel-avro:
+      groupId: org.apache.camel
+      artifactId: camel-avro
+      schemes:
+      - id: avro
+        http: false
+        passive: false
+      dataformats:
+      - avro
+    camel-aws-cw:
+      groupId: org.apache.camel
+      artifactId: camel-aws-cw
+      schemes:
+      - id: aws-cw
+        http: false
+        passive: false
+    camel-aws-ddb:
+      groupId: org.apache.camel
+      artifactId: camel-aws-ddb
+      schemes:
+      - id: aws-ddb
+        http: false
+        passive: false
+      - id: aws-ddbstream
+        http: false
+        passive: false
+    camel-aws-ec2:
+      groupId: org.apache.camel
+      artifactId: camel-aws-ec2
+      schemes:
+      - id: aws-ec2
+        http: false
+        passive: false
+    camel-aws-ecs:
+      groupId: org.apache.camel
+      artifactId: camel-aws-ecs
+      schemes:
+      - id: aws-ecs
+        http: false
+        passive: false
+    camel-aws-eks:
+      groupId: org.apache.camel
+      artifactId: camel-aws-eks
+      schemes:
+      - id: aws-eks
+        http: false
+        passive: false
+    camel-aws-iam:
+      groupId: org.apache.camel
+      artifactId: camel-aws-iam
+      schemes:
+      - id: aws-iam
+        http: false
+        passive: false
+    camel-aws-kinesis:
+      groupId: org.apache.camel
+      artifactId: camel-aws-kinesis
+      schemes:
+      - id: aws-kinesis
+        http: false
+        passive: false
+      - id: aws-kinesis-firehose
+        http: false
+        passive: false
+    camel-aws-kms:
+      groupId: org.apache.camel
+      artifactId: camel-aws-kms
+      schemes:
+      - id: aws-kms
+        http: false
+        passive: false
+    camel-aws-lambda:
+      groupId: org.apache.camel
+      artifactId: camel-aws-lambda
+      schemes:
+      - id: aws-lambda
+        http: false
+        passive: false
+    camel-aws-mq:
+      groupId: org.apache.camel
+      artifactId: camel-aws-mq
+      schemes:
+      - id: aws-mq
+        http: false
+        passive: false
+    camel-aws-msk:
+      groupId: org.apache.camel
+      artifactId: camel-aws-msk
+      schemes:
+      - id: aws-msk
+        http: false
+        passive: false
+    camel-aws-s3:
+      groupId: org.apache.camel
+      artifactId: camel-aws-s3
+      schemes:
+      - id: aws-s3
+        http: false
+        passive: false
+    camel-aws-sdb:
+      groupId: org.apache.camel
+      artifactId: camel-aws-sdb
+      schemes:
+      - id: aws-sdb
+        http: false
+        passive: false
+    camel-aws-ses:
+      groupId: org.apache.camel
+      artifactId: camel-aws-ses
+      schemes:
+      - id: aws-ses
+        http: false
+        passive: false
+    camel-aws-sns:
+      groupId: org.apache.camel
+      artifactId: camel-aws-sns
+      schemes:
+      - id: aws-sns
+        http: false
+        passive: false
+    camel-aws-sqs:
+      groupId: org.apache.camel
+      artifactId: camel-aws-sqs
+      schemes:
+      - id: aws-sqs
+        http: false
+        passive: false
+    camel-aws-swf:
+      groupId: org.apache.camel
+      artifactId: camel-aws-swf
+      schemes:
+      - id: aws-swf
+        http: false
+        passive: false
+    camel-azure:
+      groupId: org.apache.camel
+      artifactId: camel-azure
+      schemes:
+      - id: azure-blob
+        http: false
+        passive: false
+      - id: azure-queue
+        http: false
+        passive: false
+    camel-barcode:
+      groupId: org.apache.camel
+      artifactId: camel-barcode
+      dataformats:
+      - barcode
+    camel-base:
+      groupId: org.apache.camel
+      artifactId: camel-base
+      languages:
+      - constant
+      - exchangeProperty
+      - file
+      - header
+      - ref
+      - simple
+      - tokenize
+    camel-base64:
+      groupId: org.apache.camel
+      artifactId: camel-base64
+      dataformats:
+      - base64
+    camel-bean:
+      groupId: org.apache.camel
+      artifactId: camel-bean
+      schemes:
+      - id: bean
+        http: false
+        passive: true
+      - id: class
+        http: false
+        passive: true
+      languages:
+      - bean
+    camel-bean-validator:
+      groupId: org.apache.camel
+      artifactId: camel-bean-validator
+      schemes:
+      - id: bean-validator
+        http: false
+        passive: false
+    camel-beanio:
+      groupId: org.apache.camel
+      artifactId: camel-beanio
+      dataformats:
+      - beanio
+    camel-beanstalk:
+      groupId: org.apache.camel
+      artifactId: camel-beanstalk
+      schemes:
+      - id: beanstalk
+        http: false
+        passive: false
+    camel-bindy:
+      groupId: org.apache.camel
+      artifactId: camel-bindy
+      dataformats:
+      - bindy-csv
+      - bindy-fixed
+      - bindy-kvp
+    camel-bonita:
+      groupId: org.apache.camel
+      artifactId: camel-bonita
+      schemes:
+      - id: bonita
+        http: false
+        passive: false
+    camel-box:
+      groupId: org.apache.camel
+      artifactId: camel-box
+      schemes:
+      - id: box
+        http: false
+        passive: false
+    camel-braintree:
+      groupId: org.apache.camel
+      artifactId: camel-braintree
+      schemes:
+      - id: braintree
+        http: false
+        passive: false
+    camel-browse:
+      groupId: org.apache.camel
+      artifactId: camel-browse
+      schemes:
+      - id: browse
+        http: false
+        passive: true
+    camel-caffeine:
+      groupId: org.apache.camel
+      artifactId: camel-caffeine
+      schemes:
+      - id: caffeine-cache
+        http: false
+        passive: false
+      - id: caffeine-loadcache
+        http: false
+        passive: false
+    camel-cassandraql:
+      groupId: org.apache.camel
+      artifactId: camel-cassandraql
+      schemes:
+      - id: cql
+        http: false
+        passive: false
+    camel-cbor:
+      groupId: org.apache.camel
+      artifactId: camel-cbor
+      dataformats:
+      - cbor
+    camel-chatscript:
+      groupId: org.apache.camel
+      artifactId: camel-chatscript
+      schemes:
+      - id: chatscript
+        http: false
+        passive: false
+    camel-chunk:
+      groupId: org.apache.camel
+      artifactId: camel-chunk
+      schemes:
+      - id: chunk
+        http: false
+        passive: false
+    camel-cm-sms:
+      groupId: org.apache.camel
+      artifactId: camel-cm-sms
+      schemes:
+      - id: cm-sms
+        http: false
+        passive: false
+    camel-cmis:
+      groupId: org.apache.camel
+      artifactId: camel-cmis
+      schemes:
+      - id: cmis
+        http: false
+        passive: false
+    camel-coap:
+      groupId: org.apache.camel
+      artifactId: camel-coap
+      schemes:
+      - id: coap
+        http: false
+        passive: false
+      - id: coaps
+        http: false
+        passive: false
+      - id: coap+tcp
+        http: false
+        passive: false
+      - id: coaps+tcp
+        http: false
+        passive: false
+    camel-cometd:
+      groupId: org.apache.camel
+      artifactId: camel-cometd
+      schemes:
+      - id: cometd
+        http: false
+        passive: false
+      - id: cometds
+        http: false
+        passive: false
+    camel-consul:
+      groupId: org.apache.camel
+      artifactId: camel-consul
+      schemes:
+      - id: consul
+        http: false
+        passive: false
+    camel-controlbus:
+      groupId: org.apache.camel
+      artifactId: camel-controlbus
+      schemes:
+      - id: controlbus
+        http: false
+        passive: true
+    camel-corda:
+      groupId: org.apache.camel
+      artifactId: camel-corda
+      schemes:
+      - id: corda
+        http: false
+        passive: false
+    camel-couchbase:
+      groupId: org.apache.camel
+      artifactId: camel-couchbase
+      schemes:
+      - id: couchbase
+        http: false
+        passive: false
+    camel-couchdb:
+      groupId: org.apache.camel
+      artifactId: camel-couchdb
+      schemes:
+      - id: couchdb
+        http: false
+        passive: false
+    camel-crypto:
+      groupId: org.apache.camel
+      artifactId: camel-crypto
+      schemes:
+      - id: crypto
+        http: false
+        passive: false
+      dataformats:
+      - crypto
+      - pgp
+    camel-crypto-cms:
+      groupId: org.apache.camel
+      artifactId: camel-crypto-cms
+      schemes:
+      - id: crypto-cms
+        http: false
+        passive: false
+    camel-csv:
+      groupId: org.apache.camel
+      artifactId: camel-csv
+      dataformats:
+      - csv
+    camel-cxf:
+      groupId: org.apache.camel
+      artifactId: camel-cxf
+      schemes:
+      - id: cxf
+        http: true
+        passive: false
+      - id: cxfrs
+        http: true
+        passive: false
+    camel-dataformat:
+      groupId: org.apache.camel
+      artifactId: camel-dataformat
+      schemes:
+      - id: dataformat
+        http: false
+        passive: true
+    camel-dataset:
+      groupId: org.apache.camel
+      artifactId: camel-dataset
+      schemes:
+      - id: dataset
+        http: false
+        passive: true
+      - id: dataset-test
+        http: false
+        passive: false
+    camel-digitalocean:
+      groupId: org.apache.camel
+      artifactId: camel-digitalocean
+      schemes:
+      - id: digitalocean
+        http: false
+        passive: false
+    camel-direct:
+      groupId: org.apache.camel
+      artifactId: camel-direct
+      schemes:
+      - id: direct
+        http: false
+        passive: true
+    camel-directvm:
+      groupId: org.apache.camel
+      artifactId: camel-directvm
+      schemes:
+      - id: direct-vm
+        http: false
+        passive: true
+    camel-disruptor:
+      groupId: org.apache.camel
+      artifactId: camel-disruptor
+      schemes:
+      - id: disruptor
+        http: false
+        passive: false
+      - id: disruptor-vm
+        http: false
+        passive: false
+    camel-dns:
+      groupId: org.apache.camel
+      artifactId: camel-dns
+      schemes:
+      - id: dns
+        http: false
+        passive: false
+    camel-docker:
+      groupId: org.apache.camel
+      artifactId: camel-docker
+      schemes:
+      - id: docker
+        http: false
+        passive: false
+    camel-dozer:
+      groupId: org.apache.camel
+      artifactId: camel-dozer
+      schemes:
+      - id: dozer
+        http: false
+        passive: false
+    camel-drill:
+      groupId: org.apache.camel
+      artifactId: camel-drill
+      schemes:
+      - id: drill
+        http: false
+        passive: false
+    camel-dropbox:
+      groupId: org.apache.camel
+      artifactId: camel-dropbox
+      schemes:
+      - id: dropbox
+        http: false
+        passive: false
+    camel-ehcache:
+      groupId: org.apache.camel
+      artifactId: camel-ehcache
+      schemes:
+      - id: ehcache
+        http: false
+        passive: false
+    camel-elasticsearch-rest:
+      groupId: org.apache.camel
+      artifactId: camel-elasticsearch-rest
+      schemes:
+      - id: elasticsearch-rest
+        http: false
+        passive: false
+    camel-elsql:
+      groupId: org.apache.camel
+      artifactId: camel-elsql
+      schemes:
+      - id: elsql
+        http: false
+        passive: false
+    camel-etcd:
+      groupId: org.apache.camel
+      artifactId: camel-etcd
+      schemes:
+      - id: etcd
+        http: false
+        passive: false
+    camel-eventadmin:
+      groupId: org.apache.camel
+      artifactId: camel-eventadmin
+      schemes:
+      - id: eventadmin
+        http: false
+        passive: false
+    camel-exec:
+      groupId: org.apache.camel
+      artifactId: camel-exec
+      schemes:
+      - id: exec
+        http: false
+        passive: false
+    camel-facebook:
+      groupId: org.apache.camel
+      artifactId: camel-facebook
+      schemes:
+      - id: facebook
+        http: false
+        passive: false
+    camel-fastjson:
+      groupId: org.apache.camel
+      artifactId: camel-fastjson
+      dataformats:
+      - json-fastjson
+    camel-fhir:
+      groupId: org.apache.camel
+      artifactId: camel-fhir
+      schemes:
+      - id: fhir
+        http: false
+        passive: false
+      dataformats:
+      - fhirJson
+      - fhirXml
+    camel-file:
+      groupId: org.apache.camel
+      artifactId: camel-file
+      schemes:
+      - id: file
+        http: false
+        passive: false
+    camel-file-watch:
+      groupId: org.apache.camel
+      artifactId: camel-file-watch
+      schemes:
+      - id: file-watch
+        http: false
+        passive: false
+    camel-flatpack:
+      groupId: org.apache.camel
+      artifactId: camel-flatpack
+      schemes:
+      - id: flatpack
+        http: false
+        passive: false
+      dataformats:
+      - flatpack
+    camel-flink:
+      groupId: org.apache.camel
+      artifactId: camel-flink
+      schemes:
+      - id: flink
+        http: false
+        passive: false
+    camel-fop:
+      groupId: org.apache.camel
+      artifactId: camel-fop
+      schemes:
+      - id: fop
+        http: false
+        passive: false
+    camel-freemarker:
+      groupId: org.apache.camel
+      artifactId: camel-freemarker
+      schemes:
+      - id: freemarker
+        http: false
+        passive: false
+    camel-ftp:
+      groupId: org.apache.camel
+      artifactId: camel-ftp
+      schemes:
+      - id: ftp
+        http: false
+        passive: false
+      - id: ftps
+        http: false
+        passive: false
+      - id: sftp
+        http: false
+        passive: false
+    camel-ganglia:
+      groupId: org.apache.camel
+      artifactId: camel-ganglia
+      schemes:
+      - id: ganglia
+        http: false
+        passive: false
+    camel-geocoder:
+      groupId: org.apache.camel
+      artifactId: camel-geocoder
+      schemes:
+      - id: geocoder
+        http: false
+        passive: false
+    camel-git:
+      groupId: org.apache.camel
+      artifactId: camel-git
+      schemes:
+      - id: git
+        http: false
+        passive: false
+    camel-github:
+      groupId: org.apache.camel
+      artifactId: camel-github
+      schemes:
+      - id: github
+        http: false
+        passive: false
+    camel-google-bigquery:
+      groupId: org.apache.camel
+      artifactId: camel-google-bigquery
+      schemes:
+      - id: google-bigquery
+        http: false
+        passive: false
+      - id: google-bigquery-sql
+        http: false
+        passive: false
+    camel-google-calendar:
+      groupId: org.apache.camel
+      artifactId: camel-google-calendar
+      schemes:
+      - id: google-calendar
+        http: false
+        passive: false
+      - id: google-calendar-stream
+        http: false
+        passive: false
+    camel-google-drive:
+      groupId: org.apache.camel
+      artifactId: camel-google-drive
+      schemes:
+      - id: google-drive
+        http: false
+        passive: false
+    camel-google-mail:
+      groupId: org.apache.camel
+      artifactId: camel-google-mail
+      schemes:
+      - id: google-mail
+        http: false
+        passive: false
+      - id: google-mail-stream
+        http: false
+        passive: false
+    camel-google-pubsub:
+      groupId: org.apache.camel
+      artifactId: camel-google-pubsub
+      schemes:
+      - id: google-pubsub
+        http: false
+        passive: false
+    camel-google-sheets:
+      groupId: org.apache.camel
+      artifactId: camel-google-sheets
+      schemes:
+      - id: google-sheets
+        http: false
+        passive: false
+      - id: google-sheets-stream
+        http: false
+        passive: false
+    camel-gora:
+      groupId: org.apache.camel
+      artifactId: camel-gora
+      schemes:
+      - id: gora
+        http: false
+        passive: false
+    camel-grape:
+      groupId: org.apache.camel
+      artifactId: camel-grape
+      schemes:
+      - id: grape
+        http: false
+        passive: false
+    camel-grok:
+      groupId: org.apache.camel
+      artifactId: camel-grok
+      dataformats:
+      - grok
+    camel-groovy:
+      groupId: org.apache.camel
+      artifactId: camel-groovy
+      languages:
+      - groovy
+    camel-grpc:
+      groupId: org.apache.camel
+      artifactId: camel-grpc
+      schemes:
+      - id: grpc
+        http: true
+        passive: false
+    camel-gson:
+      groupId: org.apache.camel
+      artifactId: camel-gson
+      dataformats:
+      - json-gson
+    camel-guava-eventbus:
+      groupId: org.apache.camel
+      artifactId: camel-guava-eventbus
+      schemes:
+      - id: guava-eventbus
+        http: false
+        passive: false
+    camel-hazelcast:
+      groupId: org.apache.camel
+      artifactId: camel-hazelcast
+      schemes:
+      - id: hazelcast-atomicvalue
+        http: false
+        passive: false
+      - id: hazelcast-instance
+        http: false
+        passive: false
+      - id: hazelcast-list
+        http: false
+        passive: false
+      - id: hazelcast-map
+        http: false
+        passive: false
+      - id: hazelcast-multimap
+        http: false
+        passive: false
+      - id: hazelcast-queue
+        http: false
+        passive: false
+      - id: hazelcast-replicatedmap
+        http: false
+        passive: false
+      - id: hazelcast-ringbuffer
+        http: false
+        passive: false
+      - id: hazelcast-seda
+        http: false
+        passive: false
+      - id: hazelcast-set
+        http: false
+        passive: false
+      - id: hazelcast-topic
+        http: false
+        passive: false
+    camel-hbase:
+      groupId: org.apache.camel
+      artifactId: camel-hbase
+      schemes:
+      - id: hbase
+        http: false
+        passive: false
+    camel-hdfs:
+      groupId: org.apache.camel
+      artifactId: camel-hdfs
+      schemes:
+      - id: hdfs
+        http: false
+        passive: false
+    camel-hipchat:
+      groupId: org.apache.camel
+      artifactId: camel-hipchat
+      schemes:
+      - id: hipchat
+        http: false
+        passive: false
+    camel-hl7:
+      groupId: org.apache.camel
+      artifactId: camel-hl7
+      languages:
+      - hl7terser
+      dataformats:
+      - hl7
+    camel-http:
+      groupId: org.apache.camel
+      artifactId: camel-http
+      schemes:
+      - id: http
+        http: false
+        passive: false
+      - id: https
+        http: false
+        passive: false
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-file
+    camel-ical:
+      groupId: org.apache.camel
+      artifactId: camel-ical
+      dataformats:
+      - ical
+    camel-iec60870:
+      groupId: org.apache.camel
+      artifactId: camel-iec60870
+      schemes:
+      - id: iec60870-client
+        http: false
+        passive: false
+      - id: iec60870-server
+        http: false
+        passive: false
+    camel-ignite:
+      groupId: org.apache.camel
+      artifactId: camel-ignite
+      schemes:
+      - id: ignite-cache
+        http: false
+        passive: false
+      - id: ignite-compute
+        http: false
+        passive: false
+      - id: ignite-events
+        http: false
+        passive: false
+      - id: ignite-idgen
+        http: false
+        passive: false
+      - id: ignite-messaging
+        http: false
+        passive: false
+      - id: ignite-queue
+        http: false
+        passive: false
+      - id: ignite-set
+        http: false
+        passive: false
+    camel-infinispan:
+      groupId: org.apache.camel
+      artifactId: camel-infinispan
+      schemes:
+      - id: infinispan
+        http: false
+        passive: false
+    camel-influxdb:
+      groupId: org.apache.camel
+      artifactId: camel-influxdb
+      schemes:
+      - id: influxdb
+        http: false
+        passive: false
+    camel-iota:
+      groupId: org.apache.camel
+      artifactId: camel-iota
+      schemes:
+      - id: iota
+        http: false
+        passive: false
+    camel-ipfs:
+      groupId: org.apache.camel
+      artifactId: camel-ipfs
+      schemes:
+      - id: ipfs
+        http: false
+        passive: false
+    camel-irc:
+      groupId: org.apache.camel
+      artifactId: camel-irc
+      schemes:
+      - id: irc
+        http: false
+        passive: false
+    camel-ironmq:
+      groupId: org.apache.camel
+      artifactId: camel-ironmq
+      schemes:
+      - id: ironmq
+        http: false
+        passive: false
+    camel-jackson:
+      groupId: org.apache.camel
+      artifactId: camel-jackson
+      dataformats:
+      - json-jackson
+    camel-jacksonxml:
+      groupId: org.apache.camel
+      artifactId: camel-jacksonxml
+      dataformats:
+      - jacksonxml
+    camel-jaxb:
+      groupId: org.apache.camel
+      artifactId: camel-jaxb
+      dataformats:
+      - jaxb
+    camel-jaxp:
+      groupId: org.apache.camel
+      artifactId: camel-jaxp
+      languages:
+      - xtokenize
+    camel-jbpm:
+      groupId: org.apache.camel
+      artifactId: camel-jbpm
+      schemes:
+      - id: jbpm
+        http: false
+        passive: false
+    camel-jcache:
+      groupId: org.apache.camel
+      artifactId: camel-jcache
+      schemes:
+      - id: jcache
+        http: false
+        passive: false
+    camel-jclouds:
+      groupId: org.apache.camel
+      artifactId: camel-jclouds
+      schemes:
+      - id: jclouds
+        http: false
+        passive: false
+    camel-jcr:
+      groupId: org.apache.camel
+      artifactId: camel-jcr
+      schemes:
+      - id: jcr
+        http: false
+        passive: false
+    camel-jdbc:
+      groupId: org.apache.camel
+      artifactId: camel-jdbc
+      schemes:
+      - id: jdbc
+        http: false
+        passive: false
+    camel-jetty:
+      groupId: org.apache.camel
+      artifactId: camel-jetty
+      schemes:
+      - id: jetty
+        http: true
+        passive: false
+    camel-jgroups:
+      groupId: org.apache.camel
+      artifactId: camel-jgroups
+      schemes:
+      - id: jgroups
+        http: false
+        passive: false
+    camel-jgroups-raft:
+      groupId: org.apache.camel
+      artifactId: camel-jgroups-raft
+      schemes:
+      - id: jgroups-raft
+        http: false
+        passive: false
+    camel-jing:
+      groupId: org.apache.camel
+      artifactId: camel-jing
+      schemes:
+      - id: jing
+        http: false
+        passive: false
+    camel-jira:
+      groupId: org.apache.camel
+      artifactId: camel-jira
+      schemes:
+      - id: jira
+        http: false
+        passive: false
+    camel-jms:
+      groupId: org.apache.camel
+      artifactId: camel-jms
+      schemes:
+      - id: jms
+        http: false
+        passive: false
+    camel-jmx:
+      groupId: org.apache.camel
+      artifactId: camel-jmx
+      schemes:
+      - id: jmx
+        http: false
+        passive: false
+    camel-johnzon:
+      groupId: org.apache.camel
+      artifactId: camel-johnzon
+      dataformats:
+      - json-johnzon
+    camel-jolt:
+      groupId: org.apache.camel
+      artifactId: camel-jolt
+      schemes:
+      - id: jolt
+        http: false
+        passive: false
+    camel-jooq:
+      groupId: org.apache.camel
+      artifactId: camel-jooq
+      schemes:
+      - id: jooq
+        http: false
+        passive: false
+    camel-jpa:
+      groupId: org.apache.camel
+      artifactId: camel-jpa
+      schemes:
+      - id: jpa
+        http: false
+        passive: false
+    camel-jsch:
+      groupId: org.apache.camel
+      artifactId: camel-jsch
+      schemes:
+      - id: scp
+        http: false
+        passive: false
+    camel-json-validator:
+      groupId: org.apache.camel
+      artifactId: camel-json-validator
+      schemes:
+      - id: json-validator
+        http: false
+        passive: false
+    camel-jsonapi:
+      groupId: org.apache.camel
+      artifactId: camel-jsonapi
+      dataformats:
+      - jsonApi
+    camel-jsonpath:
+      groupId: org.apache.camel
+      artifactId: camel-jsonpath
+      languages:
+      - jsonpath
+    camel-jt400:
+      groupId: org.apache.camel
+      artifactId: camel-jt400
+      schemes:
+      - id: jt400
+        http: false
+        passive: false
+    camel-k-loader-groovy:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-groovy
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-endpointdsl
+      - groupId: org.apache.camel
+        artifactId: camel-groovy
+    camel-k-loader-java:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-java
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-endpointdsl
+    camel-k-loader-js:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-js
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-endpointdsl
+    camel-k-loader-knative:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-knative
+    camel-k-loader-kotlin:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-kotlin
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-endpointdsl
+    camel-k-loader-xml:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-xml
+    camel-k-runtime-health:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-runtime-health
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-servlet
+      - groupId: org.apache.camel.k
+        artifactId: camel-k-runtime-servlet
+    camel-k-runtime-knative:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-runtime-knative
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-cloud
+      - groupId: org.apache.camel.k
+        artifactId: camel-k-loader-yaml
+      - groupId: org.apache.camel.k
+        artifactId: camel-k-loader-knative
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative-api
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative-http
+    camel-k-runtime-main:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-runtime-main
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-core-engine
+      - groupId: org.apache.camel
+        artifactId: camel-main
+      - groupId: org.apache.camel
+        artifactId: camel-properties
+    camel-k-runtime-servlet:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-runtime-servlet
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-servlet
+    camel-kafka:
+      groupId: org.apache.camel
+      artifactId: camel-kafka
+      schemes:
+      - id: kafka
+        http: false
+        passive: false
+    camel-knative:
+      groupId: org.apache.camel.k
+      artifactId: camel-knative
+      schemes:
+      - id: knative
+        http: true
+        passive: false
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-cloud
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative-api
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative-http
+    camel-kubernetes:
+      groupId: org.apache.camel
+      artifactId: camel-kubernetes
+      schemes:
+      - id: kubernetes-config-maps
+        http: false
+        passive: false
+      - id: kubernetes-deployments
+        http: false
+        passive: false
+      - id: kubernetes-hpa
+        http: false
+        passive: false
+      - id: kubernetes-job
+        http: false
+        passive: false
+      - id: kubernetes-namespaces
+        http: false
+        passive: false
+      - id: kubernetes-nodes
+        http: false
+        passive: false
+      - id: kubernetes-persistent-volumes
+        http: false
+        passive: false
+      - id: kubernetes-persistent-volumes-claims
+        http: false
+        passive: false
+      - id: kubernetes-pods
+        http: false
+        passive: false
+      - id: kubernetes-replication-controllers
+        http: false
+        passive: false
+      - id: kubernetes-resources-quota
+        http: false
+        passive: false
+      - id: kubernetes-secrets
+        http: false
+        passive: false
+      - id: kubernetes-service-accounts
+        http: false
+        passive: false
+      - id: kubernetes-services
+        http: false
+        passive: false
+      - id: openshift-build-configs
+        http: false
+        passive: false
+      - id: openshift-builds
+        http: false
+        passive: false
+    camel-language:
+      groupId: org.apache.camel
+      artifactId: camel-language
+      schemes:
+      - id: language
+        http: false
+        passive: true
+    camel-ldap:
+      groupId: org.apache.camel
+      artifactId: camel-ldap
+      schemes:
+      - id: ldap
+        http: false
+        passive: false
+    camel-ldif:
+      groupId: org.apache.camel
+      artifactId: camel-ldif
+      schemes:
+      - id: ldif
+        http: false
+        passive: false
+    camel-linkedin:
+      groupId: org.apache.camel
+      artifactId: camel-linkedin
+      schemes:
+      - id: linkedin
+        http: false
+        passive: false
+    camel-log:
+      groupId: org.apache.camel
+      artifactId: camel-log
+      schemes:
+      - id: log
+        http: false
+        passive: true
+    camel-lucene:
+      groupId: org.apache.camel
+      artifactId: camel-lucene
+      schemes:
+      - id: lucene
+        http: false
+        passive: false
+    camel-lumberjack:
+      groupId: org.apache.camel
+      artifactId: camel-lumberjack
+      schemes:
+      - id: lumberjack
+        http: false
+        passive: false
+    camel-lzf:
+      groupId: org.apache.camel
+      artifactId: camel-lzf
+      dataformats:
+      - lzf
+    camel-mail:
+      groupId: org.apache.camel
+      artifactId: camel-mail
+      schemes:
+      - id: imap
+        http: false
+        passive: false
+      - id: imaps
+        http: false
+        passive: false
+      - id: pop3
+        http: false
+        passive: false
+      - id: pop3s
+        http: false
+        passive: false
+      - id: smtp
+        http: false
+        passive: false
+      - id: smtps
+        http: false
+        passive: false
+      dataformats:
+      - mime-multipart
+    camel-master:
+      groupId: org.apache.camel
+      artifactId: camel-master
+      schemes:
+      - id: master
+        http: false
+        passive: false
+    camel-metrics:
+      groupId: org.apache.camel
+      artifactId: camel-metrics
+      schemes:
+      - id: metrics
+        http: false
+        passive: false
+    camel-micrometer:
+      groupId: org.apache.camel
+      artifactId: camel-micrometer
+      schemes:
+      - id: micrometer
+        http: false
+        passive: false
+    camel-microprofile-metrics:
+      groupId: org.apache.camel
+      artifactId: camel-microprofile-metrics
+      schemes:
+      - id: microprofile-metrics
+        http: false
+        passive: false
+    camel-milo:
+      groupId: org.apache.camel
+      artifactId: camel-milo
+      schemes:
+      - id: milo-client
+        http: false
+        passive: false
+      - id: milo-server
+        http: false
+        passive: false
+    camel-mina:
+      groupId: org.apache.camel
+      artifactId: camel-mina
+      schemes:
+      - id: mina
+        http: false
+        passive: false
+    camel-mllp:
+      groupId: org.apache.camel
+      artifactId: camel-mllp
+      schemes:
+      - id: mllp
+        http: false
+        passive: false
+    camel-mock:
+      groupId: org.apache.camel
+      artifactId: camel-mock
+      schemes:
+      - id: mock
+        http: false
+        passive: true
+    camel-mongodb:
+      groupId: org.apache.camel
+      artifactId: camel-mongodb
+      schemes:
+      - id: mongodb
+        http: false
+        passive: false
+    camel-mongodb-gridfs:
+      groupId: org.apache.camel
+      artifactId: camel-mongodb-gridfs
+      schemes:
+      - id: mongodb-gridfs
+        http: false
+        passive: false
+    camel-mqtt:
+      groupId: org.apache.camel
+      artifactId: camel-mqtt
+      schemes:
+      - id: mqtt
+        http: false
+        passive: false
+    camel-msv:
+      groupId: org.apache.camel
+      artifactId: camel-msv
+      schemes:
+      - id: msv
+        http: false
+        passive: false
+    camel-mustache:
+      groupId: org.apache.camel
+      artifactId: camel-mustache
+      schemes:
+      - id: mustache
+        http: false
+        passive: false
+    camel-mvel:
+      groupId: org.apache.camel
+      artifactId: camel-mvel
+      schemes:
+      - id: mvel
+        http: false
+        passive: false
+      languages:
+      - mvel
+    camel-mybatis:
+      groupId: org.apache.camel
+      artifactId: camel-mybatis
+      schemes:
+      - id: mybatis
+        http: false
+        passive: false
+      - id: mybatis-bean
+        http: false
+        passive: false
+    camel-nagios:
+      groupId: org.apache.camel
+      artifactId: camel-nagios
+      schemes:
+      - id: nagios
+        http: false
+        passive: false
+    camel-nats:
+      groupId: org.apache.camel
+      artifactId: camel-nats
+      schemes:
+      - id: nats
+        http: false
+        passive: false
+    camel-netty:
+      groupId: org.apache.camel
+      artifactId: camel-netty
+      schemes:
+      - id: netty
+        http: false
+        passive: false
+    camel-netty-http:
+      groupId: org.apache.camel
+      artifactId: camel-netty-http
+      schemes:
+      - id: netty-http
+        http: true
+        passive: false
+    camel-nsq:
+      groupId: org.apache.camel
+      artifactId: camel-nsq
+      schemes:
+      - id: nsq
+        http: false
+        passive: false
+    camel-ognl:
+      groupId: org.apache.camel
+      artifactId: camel-ognl
+      languages:
+      - ognl
+    camel-olingo2:
+      groupId: org.apache.camel
+      artifactId: camel-olingo2
+      schemes:
+      - id: olingo2
+        http: false
+        passive: false
+    camel-olingo4:
+      groupId: org.apache.camel
+      artifactId: camel-olingo4
+      schemes:
+      - id: olingo4
+        http: false
+        passive: false
+    camel-openstack:
+      groupId: org.apache.camel
+      artifactId: camel-openstack
+      schemes:
+      - id: openstack-cinder
+        http: false
+        passive: false
+      - id: openstack-glance
+        http: false
+        passive: false
+      - id: openstack-keystone
+        http: false
+        passive: false
+      - id: openstack-neutron
+        http: false
+        passive: false
+      - id: openstack-nova
+        http: false
+        passive: false
+      - id: openstack-swift
+        http: false
+        passive: false
+    camel-optaplanner:
+      groupId: org.apache.camel
+      artifactId: camel-optaplanner
+      schemes:
+      - id: optaplanner
+        http: false
+        passive: false
+    camel-paho:
+      groupId: org.apache.camel
+      artifactId: camel-paho
+      schemes:
+      - id: paho
+        http: false
+        passive: false
+    camel-paxlogging:
+      groupId: org.apache.camel
+      artifactId: camel-paxlogging
+      schemes:
+      - id: paxlogging
+        http: false
+        passive: false
+    camel-pdf:
+      groupId: org.apache.camel
+      artifactId: camel-pdf
+      schemes:
+      - id: pdf
+        http: false
+        passive: false
+    camel-pg-replication-slot:
+      groupId: org.apache.camel
+      artifactId: camel-pg-replication-slot
+      schemes:
+      - id: pg-replication-slot
+        http: false
+        passive: false
+    camel-pgevent:
+      groupId: org.apache.camel
+      artifactId: camel-pgevent
+      schemes:
+      - id: pgevent
+        http: false
+        passive: false
+    camel-printer:
+      groupId: org.apache.camel
+      artifactId: camel-printer
+      schemes:
+      - id: lpr
+        http: false
+        passive: false
+    camel-properties:
+      groupId: org.apache.camel
+      artifactId: camel-properties
+      schemes:
+      - id: properties
+        http: false
+        passive: true
+    camel-protobuf:
+      groupId: org.apache.camel
+      artifactId: camel-protobuf
+      dataformats:
+      - protobuf
+    camel-pubnub:
+      groupId: org.apache.camel
+      artifactId: camel-pubnub
+      schemes:
+      - id: pubnub
+        http: false
+        passive: false
+    camel-pulsar:
+      groupId: org.apache.camel
+      artifactId: camel-pulsar
+      schemes:
+      - id: pulsar
+        http: false
+        passive: false
+    camel-quartz:
+      groupId: org.apache.camel
+      artifactId: camel-quartz
+      schemes:
+      - id: quartz
+        http: false
+        passive: false
+    camel-quickfix:
+      groupId: org.apache.camel
+      artifactId: camel-quickfix
+      schemes:
+      - id: quickfix
+        http: false
+        passive: false
+    camel-rabbitmq:
+      groupId: org.apache.camel
+      artifactId: camel-rabbitmq
+      schemes:
+      - id: rabbitmq
+        http: false
+        passive: false
+    camel-reactive-streams:
+      groupId: org.apache.camel
+      artifactId: camel-reactive-streams
+      schemes:
+      - id: reactive-streams
+        http: false
+        passive: false
+    camel-ref:
+      groupId: org.apache.camel
+      artifactId: camel-ref
+      schemes:
+      - id: ref
+        http: false
+        passive: true
+    camel-rest:
+      groupId: org.apache.camel
+      artifactId: camel-rest
+      schemes:
+      - id: rest
+        http: true
+        passive: false
+      - id: rest-api
+        http: false
+        passive: false
+    camel-rest-swagger:
+      groupId: org.apache.camel
+      artifactId: camel-rest-swagger
+      schemes:
+      - id: rest-swagger
+        http: false
+        passive: false
+    camel-restlet:
+      groupId: org.apache.camel
+      artifactId: camel-restlet
+      schemes:
+      - id: restlet
+        http: true
+        passive: false
+    camel-rss:
+      groupId: org.apache.camel
+      artifactId: camel-rss
+      schemes:
+      - id: rss
+        http: false
+        passive: false
+      dataformats:
+      - rss
+    camel-saga:
+      groupId: org.apache.camel
+      artifactId: camel-saga
+      schemes:
+      - id: saga
+        http: false
+        passive: false
+    camel-salesforce:
+      groupId: org.apache.camel
+      artifactId: camel-salesforce
+      schemes:
+      - id: salesforce
+        http: false
+        passive: false
+    camel-sap-netweaver:
+      groupId: org.apache.camel
+      artifactId: camel-sap-netweaver
+      schemes:
+      - id: sap-netweaver
+        http: false
+        passive: false
+    camel-saxon:
+      groupId: org.apache.camel
+      artifactId: camel-saxon
+      schemes:
+      - id: xquery
+        http: false
+        passive: false
+      languages:
+      - xquery
+    camel-scheduler:
+      groupId: org.apache.camel
+      artifactId: camel-scheduler
+      schemes:
+      - id: scheduler
+        http: false
+        passive: false
+    camel-schematron:
+      groupId: org.apache.camel
+      artifactId: camel-schematron
+      schemes:
+      - id: schematron
+        http: false
+        passive: false
+    camel-seda:
+      groupId: org.apache.camel
+      artifactId: camel-seda
+      schemes:
+      - id: seda
+        http: false
+        passive: true
+    camel-service:
+      groupId: org.apache.camel
+      artifactId: camel-service
+      schemes:
+      - id: service
+        http: false
+        passive: false
+    camel-servicenow:
+      groupId: org.apache.camel
+      artifactId: camel-servicenow
+      schemes:
+      - id: servicenow
+        http: false
+        passive: false
+    camel-servlet:
+      groupId: org.apache.camel
+      artifactId: camel-servlet
+      schemes:
+      - id: servlet
+        http: true
+        passive: false
+    camel-sip:
+      groupId: org.apache.camel
+      artifactId: camel-sip
+      schemes:
+      - id: sip
+        http: false
+        passive: false
+      - id: sips
+        http: false
+        passive: false
+    camel-sjms:
+      groupId: org.apache.camel
+      artifactId: camel-sjms
+      schemes:
+      - id: sjms
+        http: false
+        passive: false
+      - id: sjms-batch
+        http: false
+        passive: false
+    camel-sjms2:
+      groupId: org.apache.camel
+      artifactId: camel-sjms2
+      schemes:
+      - id: sjms2
+        http: false
+        passive: false
+    camel-slack:
+      groupId: org.apache.camel
+      artifactId: camel-slack
+      schemes:
+      - id: slack
+        http: false
+        passive: false
+    camel-smpp:
+      groupId: org.apache.camel
+      artifactId: camel-smpp
+      schemes:
+      - id: smpp
+        http: false
+        passive: false
+      - id: smpps
+        http: false
+        passive: false
+    camel-snakeyaml:
+      groupId: org.apache.camel
+      artifactId: camel-snakeyaml
+      dataformats:
+      - yaml-snakeyaml
+    camel-snmp:
+      groupId: org.apache.camel
+      artifactId: camel-snmp
+      schemes:
+      - id: snmp
+        http: false
+        passive: false
+    camel-soap:
+      groupId: org.apache.camel
+      artifactId: camel-soap
+      dataformats:
+      - soapjaxb
+    camel-solr:
+      groupId: org.apache.camel
+      artifactId: camel-solr
+      schemes:
+      - id: solr
+        http: false
+        passive: false
+      - id: solrs
+        http: false
+        passive: false
+      - id: solrCloud
+        http: false
+        passive: false
+    camel-soroush:
+      groupId: org.apache.camel
+      artifactId: camel-soroush
+      schemes:
+      - id: soroush
+        http: false
+        passive: false
+    camel-spark:
+      groupId: org.apache.camel
+      artifactId: camel-spark
+      schemes:
+      - id: spark
+        http: false
+        passive: false
+    camel-spark-rest:
+      groupId: org.apache.camel
+      artifactId: camel-spark-rest
+      schemes:
+      - id: spark-rest
+        http: true
+        passive: false
+    camel-splunk:
+      groupId: org.apache.camel
+      artifactId: camel-splunk
+      schemes:
+      - id: splunk
+        http: false
+        passive: false
+    camel-spring:
+      groupId: org.apache.camel
+      artifactId: camel-spring
+      schemes:
+      - id: spring-event
+        http: false
+        passive: false
+      languages:
+      - spel
+    camel-spring-batch:
+      groupId: org.apache.camel
+      artifactId: camel-spring-batch
+      schemes:
+      - id: spring-batch
+        http: false
+        passive: false
+    camel-spring-integration:
+      groupId: org.apache.camel
+      artifactId: camel-spring-integration
+      schemes:
+      - id: spring-integration
+        http: false
+        passive: false
+    camel-spring-ldap:
+      groupId: org.apache.camel
+      artifactId: camel-spring-ldap
+      schemes:
+      - id: spring-ldap
+        http: false
+        passive: false
+    camel-spring-redis:
+      groupId: org.apache.camel
+      artifactId: camel-spring-redis
+      schemes:
+      - id: spring-redis
+        http: false
+        passive: false
+    camel-spring-ws:
+      groupId: org.apache.camel
+      artifactId: camel-spring-ws
+      schemes:
+      - id: spring-ws
+        http: true
+        passive: false
+    camel-sql:
+      groupId: org.apache.camel
+      artifactId: camel-sql
+      schemes:
+      - id: sql
+        http: false
+        passive: false
+      - id: sql-stored
+        http: false
+        passive: false
+    camel-ssh:
+      groupId: org.apache.camel
+      artifactId: camel-ssh
+      schemes:
+      - id: ssh
+        http: false
+        passive: false
+    camel-stax:
+      groupId: org.apache.camel
+      artifactId: camel-stax
+      schemes:
+      - id: stax
+        http: false
+        passive: false
+    camel-stomp:
+      groupId: org.apache.camel
+      artifactId: camel-stomp
+      schemes:
+      - id: stomp
+        http: false
+        passive: false
+    camel-stream:
+      groupId: org.apache.camel
+      artifactId: camel-stream
+      schemes:
+      - id: stream
+        http: false
+        passive: false
+    camel-stringtemplate:
+      groupId: org.apache.camel
+      artifactId: camel-stringtemplate
+      schemes:
+      - id: string-template
+        http: false
+        passive: false
+    camel-stub:
+      groupId: org.apache.camel
+      artifactId: camel-stub
+      schemes:
+      - id: stub
+        http: false
+        passive: true
+    camel-syslog:
+      groupId: org.apache.camel
+      artifactId: camel-syslog
+      dataformats:
+      - syslog
+    camel-tagsoup:
+      groupId: org.apache.camel
+      artifactId: camel-tagsoup
+      dataformats:
+      - tidyMarkup
+    camel-tarfile:
+      groupId: org.apache.camel
+      artifactId: camel-tarfile
+      dataformats:
+      - tarfile
+    camel-telegram:
+      groupId: org.apache.camel
+      artifactId: camel-telegram
+      schemes:
+      - id: telegram
+        http: false
+        passive: false
+    camel-thrift:
+      groupId: org.apache.camel
+      artifactId: camel-thrift
+      schemes:
+      - id: thrift
+        http: false
+        passive: false
+      dataformats:
+      - thrift
+    camel-tika:
+      groupId: org.apache.camel
+      artifactId: camel-tika
+      schemes:
+      - id: tika
+        http: false
+        passive: false
+    camel-timer:
+      groupId: org.apache.camel
+      artifactId: camel-timer
+      schemes:
+      - id: timer
+        http: false
+        passive: false
+    camel-twilio:
+      groupId: org.apache.camel
+      artifactId: camel-twilio
+      schemes:
+      - id: twilio
+        http: false
+        passive: false
+    camel-twitter:
+      groupId: org.apache.camel
+      artifactId: camel-twitter
+      schemes:
+      - id: twitter-directmessage
+        http: false
+        passive: false
+      - id: twitter-search
+        http: false
+        passive: false
+      - id: twitter-timeline
+        http: false
+        passive: false
+    camel-undertow:
+      groupId: org.apache.camel
+      artifactId: camel-undertow
+      schemes:
+      - id: undertow
+        http: true
+        passive: false
+    camel-univocity-parsers:
+      groupId: org.apache.camel
+      artifactId: camel-univocity-parsers
+      dataformats:
+      - univocity-csv
+      - univocity-fixed
+      - univocity-tsv
+    camel-validator:
+      groupId: org.apache.camel
+      artifactId: camel-validator
+      schemes:
+      - id: validator
+        http: false
+        passive: true
+    camel-velocity:
+      groupId: org.apache.camel
+      artifactId: camel-velocity
+      schemes:
+      - id: velocity
+        http: false
+        passive: false
+    camel-vertx:
+      groupId: org.apache.camel
+      artifactId: camel-vertx
+      schemes:
+      - id: vertx
+        http: false
+        passive: false
+    camel-vm:
+      groupId: org.apache.camel
+      artifactId: camel-vm
+      schemes:
+      - id: vm
+        http: false
+        passive: true
+    camel-weather:
+      groupId: org.apache.camel
+      artifactId: camel-weather
+      schemes:
+      - id: weather
+        http: false
+        passive: false
+    camel-web3j:
+      groupId: org.apache.camel
+      artifactId: camel-web3j
+      schemes:
+      - id: web3j
+        http: false
+        passive: false
+    camel-webhook:
+      groupId: org.apache.camel
+      artifactId: camel-webhook
+      schemes:
+      - id: webhook
+        http: true
+        passive: false
+    camel-websocket:
+      groupId: org.apache.camel
+      artifactId: camel-websocket
+      schemes:
+      - id: websocket
+        http: true
+        passive: false
+    camel-websocket-jsr356:
+      groupId: org.apache.camel
+      artifactId: camel-websocket-jsr356
+      schemes:
+      - id: websocket-jsr356
+        http: false
+        passive: false
+    camel-wordpress:
+      groupId: org.apache.camel
+      artifactId: camel-wordpress
+      schemes:
+      - id: wordpress
+        http: false
+        passive: false
+    camel-xchange:
+      groupId: org.apache.camel
+      artifactId: camel-xchange
+      schemes:
+      - id: xchange
+        http: false
+        passive: false
+    camel-xmlsecurity:
+      groupId: org.apache.camel
+      artifactId: camel-xmlsecurity
+      schemes:
+      - id: xmlsecurity
+        http: false
+        passive: false
+      dataformats:
+      - secureXML
+    camel-xmpp:
+      groupId: org.apache.camel
+      artifactId: camel-xmpp
+      schemes:
+      - id: xmpp
+        http: false
+        passive: false
+    camel-xpath:
+      groupId: org.apache.camel
+      artifactId: camel-xpath
+      languages:
+      - xpath
+    camel-xslt:
+      groupId: org.apache.camel
+      artifactId: camel-xslt
+      schemes:
+      - id: xslt
+        http: false
+        passive: false
+    camel-xstream:
+      groupId: org.apache.camel
+      artifactId: camel-xstream
+      dataformats:
+      - json-xstream
+      - xstream
+    camel-yammer:
+      groupId: org.apache.camel
+      artifactId: camel-yammer
+      schemes:
+      - id: yammer
+        http: false
+        passive: false
+    camel-zendesk:
+      groupId: org.apache.camel
+      artifactId: camel-zendesk
+      schemes:
+      - id: zendesk
+        http: false
+        passive: false
+    camel-zip-deflater:
+      groupId: org.apache.camel
+      artifactId: camel-zip-deflater
+      dataformats:
+      - gzipdeflater
+      - zipdeflater
+    camel-zipfile:
+      groupId: org.apache.camel
+      artifactId: camel-zipfile
+      dataformats:
+      - zipfile
+    camel-zookeeper:
+      groupId: org.apache.camel
+      artifactId: camel-zookeeper
+      schemes:
+      - id: zookeeper
+        http: false
+        passive: false
+    camel-zookeeper-master:
+      groupId: org.apache.camel
+      artifactId: camel-zookeeper-master
+      schemes:
+      - id: zookeeper-master
+        http: false
+        passive: false
diff --git a/deploy/camel-quarkus-catalog-0.3.0-1.0.7.yaml b/deploy/camel-catalog-quarkus-0.3.0-1.0.7-SNAPSHOT.yaml
similarity index 98%
rename from deploy/camel-quarkus-catalog-0.3.0-1.0.7.yaml
rename to deploy/camel-catalog-quarkus-0.3.0-1.0.7-SNAPSHOT.yaml
index a4103f7..96e336c 100644
--- a/deploy/camel-quarkus-catalog-0.3.0-1.0.7.yaml
+++ b/deploy/camel-catalog-quarkus-0.3.0-1.0.7-SNAPSHOT.yaml
@@ -18,16 +18,16 @@
 apiVersion: camel.apache.org/v1alpha1
 kind: CamelCatalog
 metadata:
-  name: camel-quarkus-catalog-0.3.0-1.0.7
+  name: camel-quarkus-catalog-0.3.0-1.0.7-SNAPSHOT
   labels:
     app: camel-k
     camel.apache.org/catalog.version: 3.0.0-RC3
     camel.apache.org/catalog.loader.version: 3.0.0-RC3
-    camel.apache.org/runtime.version: 1.0.7
+    camel.apache.org/runtime.version: 1.0.7-SNAPSHOT
     camel.apache.org/runtime.provider: quarkus
 spec:
   version: 3.0.0-RC3
-  runtimeVersion: 1.0.7
+  runtimeVersion: 1.0.7-SNAPSHOT
   runtimeProvider:
     quarkus:
       camelQuarkusVersion: 0.3.0
diff --git a/deploy/resources.go b/deploy/resources.go
index b845b7e..bb1720b 100644
--- a/deploy/resources.go
+++ b/deploy/resources.go
@@ -6942,7 +6942,7 @@ spec:
         passive: false
 
 `
-	Resources["camel-quarkus-catalog-0.3.0-1.0.7.yaml"] =
+	Resources["camel-catalog-3.0.0-RC1-1.0.7-SNAPSHOT.yaml"] =
 		`
 # ---------------------------------------------------------------------------
 # Licensed to the Apache Software Foundation (ASF) under one or more
@@ -6964,16 +6964,2233 @@ spec:
 apiVersion: camel.apache.org/v1alpha1
 kind: CamelCatalog
 metadata:
-  name: camel-quarkus-catalog-0.3.0-1.0.7
+  name: camel-catalog-3.0.0-rc1-1.0.7-SNAPSHOT
+  labels:
+    app: camel-k
+    camel.apache.org/catalog.version: 3.0.0-RC1
+    camel.apache.org/catalog.loader.version: 3.0.0-RC1
+    camel.apache.org/runtime.version: 1.0.7-SNAPSHOT
+spec:
+  version: 3.0.0-RC1
+  runtimeVersion: 1.0.7-SNAPSHOT
+  artifacts:
+    camel-activemq:
+      groupId: org.apache.camel
+      artifactId: camel-activemq
+      schemes:
+      - id: activemq
+        http: false
+        passive: false
+    camel-ahc:
+      groupId: org.apache.camel
+      artifactId: camel-ahc
+      schemes:
+      - id: ahc
+        http: true
+        passive: false
+    camel-ahc-ws:
+      groupId: org.apache.camel
+      artifactId: camel-ahc-ws
+      schemes:
+      - id: ahc-ws
+        http: true
+        passive: false
+      - id: ahc-wss
+        http: false
+        passive: false
+    camel-amqp:
+      groupId: org.apache.camel
+      artifactId: camel-amqp
+      schemes:
+      - id: amqp
+        http: false
+        passive: false
+    camel-any23:
+      groupId: org.apache.camel
+      artifactId: camel-any23
+      dataformats:
+      - any23
+    camel-apns:
+      groupId: org.apache.camel
+      artifactId: camel-apns
+      schemes:
+      - id: apns
+        http: false
+        passive: false
+    camel-as2:
+      groupId: org.apache.camel
+      artifactId: camel-as2
+      schemes:
+      - id: as2
+        http: false
+        passive: false
+    camel-asn1:
+      groupId: org.apache.camel
+      artifactId: camel-asn1
+      dataformats:
+      - asn1
+    camel-asterisk:
+      groupId: org.apache.camel
+      artifactId: camel-asterisk
+      schemes:
+      - id: asterisk
+        http: false
+        passive: false
+    camel-atmos:
+      groupId: org.apache.camel
+      artifactId: camel-atmos
+      schemes:
+      - id: atmos
+        http: false
+        passive: false
+    camel-atmosphere-websocket:
+      groupId: org.apache.camel
+      artifactId: camel-atmosphere-websocket
+      schemes:
+      - id: atmosphere-websocket
+        http: true
+        passive: false
+    camel-atom:
+      groupId: org.apache.camel
+      artifactId: camel-atom
+      schemes:
+      - id: atom
+        http: false
+        passive: false
+    camel-atomix:
+      groupId: org.apache.camel
+      artifactId: camel-atomix
+      schemes:
+      - id: atomix-map
+        http: false
+        passive: false
+      - id: atomix-messaging
+        http: false
+        passive: false
+      - id: atomix-multimap
+        http: false
+        passive: false
+      - id: atomix-queue
+        http: false
+        passive: false
+      - id: atomix-set
+        http: false
+        passive: false
+      - id: atomix-value
+        http: false
+        passive: false
+    camel-avro:
+      groupId: org.apache.camel
+      artifactId: camel-avro
+      schemes:
+      - id: avro
+        http: false
+        passive: false
+      dataformats:
+      - avro
+    camel-aws-cw:
+      groupId: org.apache.camel
+      artifactId: camel-aws-cw
+      schemes:
+      - id: aws-cw
+        http: false
+        passive: false
+    camel-aws-ddb:
+      groupId: org.apache.camel
+      artifactId: camel-aws-ddb
+      schemes:
+      - id: aws-ddb
+        http: false
+        passive: false
+      - id: aws-ddbstream
+        http: false
+        passive: false
+    camel-aws-ec2:
+      groupId: org.apache.camel
+      artifactId: camel-aws-ec2
+      schemes:
+      - id: aws-ec2
+        http: false
+        passive: false
+    camel-aws-ecs:
+      groupId: org.apache.camel
+      artifactId: camel-aws-ecs
+      schemes:
+      - id: aws-ecs
+        http: false
+        passive: false
+    camel-aws-eks:
+      groupId: org.apache.camel
+      artifactId: camel-aws-eks
+      schemes:
+      - id: aws-eks
+        http: false
+        passive: false
+    camel-aws-iam:
+      groupId: org.apache.camel
+      artifactId: camel-aws-iam
+      schemes:
+      - id: aws-iam
+        http: false
+        passive: false
+    camel-aws-kinesis:
+      groupId: org.apache.camel
+      artifactId: camel-aws-kinesis
+      schemes:
+      - id: aws-kinesis
+        http: false
+        passive: false
+      - id: aws-kinesis-firehose
+        http: false
+        passive: false
+    camel-aws-kms:
+      groupId: org.apache.camel
+      artifactId: camel-aws-kms
+      schemes:
+      - id: aws-kms
+        http: false
+        passive: false
+    camel-aws-lambda:
+      groupId: org.apache.camel
+      artifactId: camel-aws-lambda
+      schemes:
+      - id: aws-lambda
+        http: false
+        passive: false
+    camel-aws-mq:
+      groupId: org.apache.camel
+      artifactId: camel-aws-mq
+      schemes:
+      - id: aws-mq
+        http: false
+        passive: false
+    camel-aws-msk:
+      groupId: org.apache.camel
+      artifactId: camel-aws-msk
+      schemes:
+      - id: aws-msk
+        http: false
+        passive: false
+    camel-aws-s3:
+      groupId: org.apache.camel
+      artifactId: camel-aws-s3
+      schemes:
+      - id: aws-s3
+        http: false
+        passive: false
+    camel-aws-sdb:
+      groupId: org.apache.camel
+      artifactId: camel-aws-sdb
+      schemes:
+      - id: aws-sdb
+        http: false
+        passive: false
+    camel-aws-ses:
+      groupId: org.apache.camel
+      artifactId: camel-aws-ses
+      schemes:
+      - id: aws-ses
+        http: false
+        passive: false
+    camel-aws-sns:
+      groupId: org.apache.camel
+      artifactId: camel-aws-sns
+      schemes:
+      - id: aws-sns
+        http: false
+        passive: false
+    camel-aws-sqs:
+      groupId: org.apache.camel
+      artifactId: camel-aws-sqs
+      schemes:
+      - id: aws-sqs
+        http: false
+        passive: false
+    camel-aws-swf:
+      groupId: org.apache.camel
+      artifactId: camel-aws-swf
+      schemes:
+      - id: aws-swf
+        http: false
+        passive: false
+    camel-azure:
+      groupId: org.apache.camel
+      artifactId: camel-azure
+      schemes:
+      - id: azure-blob
+        http: false
+        passive: false
+      - id: azure-queue
+        http: false
+        passive: false
+    camel-barcode:
+      groupId: org.apache.camel
+      artifactId: camel-barcode
+      dataformats:
+      - barcode
+    camel-base:
+      groupId: org.apache.camel
+      artifactId: camel-base
+      languages:
+      - constant
+      - exchangeProperty
+      - file
+      - header
+      - ref
+      - simple
+      - tokenize
+    camel-base64:
+      groupId: org.apache.camel
+      artifactId: camel-base64
+      dataformats:
+      - base64
+    camel-bean:
+      groupId: org.apache.camel
+      artifactId: camel-bean
+      schemes:
+      - id: bean
+        http: false
+        passive: true
+      - id: class
+        http: false
+        passive: true
+      languages:
+      - bean
+    camel-bean-validator:
+      groupId: org.apache.camel
+      artifactId: camel-bean-validator
+      schemes:
+      - id: bean-validator
+        http: false
+        passive: false
+    camel-beanio:
+      groupId: org.apache.camel
+      artifactId: camel-beanio
+      dataformats:
+      - beanio
+    camel-beanstalk:
+      groupId: org.apache.camel
+      artifactId: camel-beanstalk
+      schemes:
+      - id: beanstalk
+        http: false
+        passive: false
+    camel-bindy:
+      groupId: org.apache.camel
+      artifactId: camel-bindy
+      dataformats:
+      - bindy-csv
+      - bindy-fixed
+      - bindy-kvp
+    camel-bonita:
+      groupId: org.apache.camel
+      artifactId: camel-bonita
+      schemes:
+      - id: bonita
+        http: false
+        passive: false
+    camel-box:
+      groupId: org.apache.camel
+      artifactId: camel-box
+      schemes:
+      - id: box
+        http: false
+        passive: false
+    camel-braintree:
+      groupId: org.apache.camel
+      artifactId: camel-braintree
+      schemes:
+      - id: braintree
+        http: false
+        passive: false
+    camel-browse:
+      groupId: org.apache.camel
+      artifactId: camel-browse
+      schemes:
+      - id: browse
+        http: false
+        passive: true
+    camel-caffeine:
+      groupId: org.apache.camel
+      artifactId: camel-caffeine
+      schemes:
+      - id: caffeine-cache
+        http: false
+        passive: false
+      - id: caffeine-loadcache
+        http: false
+        passive: false
+    camel-cassandraql:
+      groupId: org.apache.camel
+      artifactId: camel-cassandraql
+      schemes:
+      - id: cql
+        http: false
+        passive: false
+    camel-cbor:
+      groupId: org.apache.camel
+      artifactId: camel-cbor
+      dataformats:
+      - cbor
+    camel-chatscript:
+      groupId: org.apache.camel
+      artifactId: camel-chatscript
+      schemes:
+      - id: chatscript
+        http: false
+        passive: false
+    camel-chunk:
+      groupId: org.apache.camel
+      artifactId: camel-chunk
+      schemes:
+      - id: chunk
+        http: false
+        passive: false
+    camel-cm-sms:
+      groupId: org.apache.camel
+      artifactId: camel-cm-sms
+      schemes:
+      - id: cm-sms
+        http: false
+        passive: false
+    camel-cmis:
+      groupId: org.apache.camel
+      artifactId: camel-cmis
+      schemes:
+      - id: cmis
+        http: false
+        passive: false
+    camel-coap:
+      groupId: org.apache.camel
+      artifactId: camel-coap
+      schemes:
+      - id: coap
+        http: false
+        passive: false
+      - id: coaps
+        http: false
+        passive: false
+      - id: coap+tcp
+        http: false
+        passive: false
+      - id: coaps+tcp
+        http: false
+        passive: false
+    camel-cometd:
+      groupId: org.apache.camel
+      artifactId: camel-cometd
+      schemes:
+      - id: cometd
+        http: false
+        passive: false
+      - id: cometds
+        http: false
+        passive: false
+    camel-consul:
+      groupId: org.apache.camel
+      artifactId: camel-consul
+      schemes:
+      - id: consul
+        http: false
+        passive: false
+    camel-controlbus:
+      groupId: org.apache.camel
+      artifactId: camel-controlbus
+      schemes:
+      - id: controlbus
+        http: false
+        passive: true
+    camel-corda:
+      groupId: org.apache.camel
+      artifactId: camel-corda
+      schemes:
+      - id: corda
+        http: false
+        passive: false
+    camel-couchbase:
+      groupId: org.apache.camel
+      artifactId: camel-couchbase
+      schemes:
+      - id: couchbase
+        http: false
+        passive: false
+    camel-couchdb:
+      groupId: org.apache.camel
+      artifactId: camel-couchdb
+      schemes:
+      - id: couchdb
+        http: false
+        passive: false
+    camel-crypto:
+      groupId: org.apache.camel
+      artifactId: camel-crypto
+      schemes:
+      - id: crypto
+        http: false
+        passive: false
+      dataformats:
+      - crypto
+      - pgp
+    camel-crypto-cms:
+      groupId: org.apache.camel
+      artifactId: camel-crypto-cms
+      schemes:
+      - id: crypto-cms
+        http: false
+        passive: false
+    camel-csv:
+      groupId: org.apache.camel
+      artifactId: camel-csv
+      dataformats:
+      - csv
+    camel-cxf:
+      groupId: org.apache.camel
+      artifactId: camel-cxf
+      schemes:
+      - id: cxf
+        http: true
+        passive: false
+      - id: cxfrs
+        http: true
+        passive: false
+    camel-dataformat:
+      groupId: org.apache.camel
+      artifactId: camel-dataformat
+      schemes:
+      - id: dataformat
+        http: false
+        passive: true
+    camel-dataset:
+      groupId: org.apache.camel
+      artifactId: camel-dataset
+      schemes:
+      - id: dataset
+        http: false
+        passive: true
+      - id: dataset-test
+        http: false
+        passive: false
+    camel-digitalocean:
+      groupId: org.apache.camel
+      artifactId: camel-digitalocean
+      schemes:
+      - id: digitalocean
+        http: false
+        passive: false
+    camel-direct:
+      groupId: org.apache.camel
+      artifactId: camel-direct
+      schemes:
+      - id: direct
+        http: false
+        passive: true
+    camel-directvm:
+      groupId: org.apache.camel
+      artifactId: camel-directvm
+      schemes:
+      - id: direct-vm
+        http: false
+        passive: true
+    camel-disruptor:
+      groupId: org.apache.camel
+      artifactId: camel-disruptor
+      schemes:
+      - id: disruptor
+        http: false
+        passive: false
+      - id: disruptor-vm
+        http: false
+        passive: false
+    camel-dns:
+      groupId: org.apache.camel
+      artifactId: camel-dns
+      schemes:
+      - id: dns
+        http: false
+        passive: false
+    camel-docker:
+      groupId: org.apache.camel
+      artifactId: camel-docker
+      schemes:
+      - id: docker
+        http: false
+        passive: false
+    camel-dozer:
+      groupId: org.apache.camel
+      artifactId: camel-dozer
+      schemes:
+      - id: dozer
+        http: false
+        passive: false
+    camel-drill:
+      groupId: org.apache.camel
+      artifactId: camel-drill
+      schemes:
+      - id: drill
+        http: false
+        passive: false
+    camel-dropbox:
+      groupId: org.apache.camel
+      artifactId: camel-dropbox
+      schemes:
+      - id: dropbox
+        http: false
+        passive: false
+    camel-ehcache:
+      groupId: org.apache.camel
+      artifactId: camel-ehcache
+      schemes:
+      - id: ehcache
+        http: false
+        passive: false
+    camel-elasticsearch-rest:
+      groupId: org.apache.camel
+      artifactId: camel-elasticsearch-rest
+      schemes:
+      - id: elasticsearch-rest
+        http: false
+        passive: false
+    camel-elsql:
+      groupId: org.apache.camel
+      artifactId: camel-elsql
+      schemes:
+      - id: elsql
+        http: false
+        passive: false
+    camel-etcd:
+      groupId: org.apache.camel
+      artifactId: camel-etcd
+      schemes:
+      - id: etcd
+        http: false
+        passive: false
+    camel-eventadmin:
+      groupId: org.apache.camel
+      artifactId: camel-eventadmin
+      schemes:
+      - id: eventadmin
+        http: false
+        passive: false
+    camel-exec:
+      groupId: org.apache.camel
+      artifactId: camel-exec
+      schemes:
+      - id: exec
+        http: false
+        passive: false
+    camel-facebook:
+      groupId: org.apache.camel
+      artifactId: camel-facebook
+      schemes:
+      - id: facebook
+        http: false
+        passive: false
+    camel-fastjson:
+      groupId: org.apache.camel
+      artifactId: camel-fastjson
+      dataformats:
+      - json-fastjson
+    camel-fhir:
+      groupId: org.apache.camel
+      artifactId: camel-fhir
+      schemes:
+      - id: fhir
+        http: false
+        passive: false
+      dataformats:
+      - fhirJson
+      - fhirXml
+    camel-file:
+      groupId: org.apache.camel
+      artifactId: camel-file
+      schemes:
+      - id: file
+        http: false
+        passive: false
+    camel-file-watch:
+      groupId: org.apache.camel
+      artifactId: camel-file-watch
+      schemes:
+      - id: file-watch
+        http: false
+        passive: false
+    camel-flatpack:
+      groupId: org.apache.camel
+      artifactId: camel-flatpack
+      schemes:
+      - id: flatpack
+        http: false
+        passive: false
+      dataformats:
+      - flatpack
+    camel-flink:
+      groupId: org.apache.camel
+      artifactId: camel-flink
+      schemes:
+      - id: flink
+        http: false
+        passive: false
+    camel-fop:
+      groupId: org.apache.camel
+      artifactId: camel-fop
+      schemes:
+      - id: fop
+        http: false
+        passive: false
+    camel-freemarker:
+      groupId: org.apache.camel
+      artifactId: camel-freemarker
+      schemes:
+      - id: freemarker
+        http: false
+        passive: false
+    camel-ftp:
+      groupId: org.apache.camel
+      artifactId: camel-ftp
+      schemes:
+      - id: ftp
+        http: false
+        passive: false
+      - id: ftps
+        http: false
+        passive: false
+      - id: sftp
+        http: false
+        passive: false
+    camel-ganglia:
+      groupId: org.apache.camel
+      artifactId: camel-ganglia
+      schemes:
+      - id: ganglia
+        http: false
+        passive: false
+    camel-geocoder:
+      groupId: org.apache.camel
+      artifactId: camel-geocoder
+      schemes:
+      - id: geocoder
+        http: false
+        passive: false
+    camel-git:
+      groupId: org.apache.camel
+      artifactId: camel-git
+      schemes:
+      - id: git
+        http: false
+        passive: false
+    camel-github:
+      groupId: org.apache.camel
+      artifactId: camel-github
+      schemes:
+      - id: github
+        http: false
+        passive: false
+    camel-google-bigquery:
+      groupId: org.apache.camel
+      artifactId: camel-google-bigquery
+      schemes:
+      - id: google-bigquery
+        http: false
+        passive: false
+      - id: google-bigquery-sql
+        http: false
+        passive: false
+    camel-google-calendar:
+      groupId: org.apache.camel
+      artifactId: camel-google-calendar
+      schemes:
+      - id: google-calendar
+        http: false
+        passive: false
+      - id: google-calendar-stream
+        http: false
+        passive: false
+    camel-google-drive:
+      groupId: org.apache.camel
+      artifactId: camel-google-drive
+      schemes:
+      - id: google-drive
+        http: false
+        passive: false
+    camel-google-mail:
+      groupId: org.apache.camel
+      artifactId: camel-google-mail
+      schemes:
+      - id: google-mail
+        http: false
+        passive: false
+      - id: google-mail-stream
+        http: false
+        passive: false
+    camel-google-pubsub:
+      groupId: org.apache.camel
+      artifactId: camel-google-pubsub
+      schemes:
+      - id: google-pubsub
+        http: false
+        passive: false
+    camel-google-sheets:
+      groupId: org.apache.camel
+      artifactId: camel-google-sheets
+      schemes:
+      - id: google-sheets
+        http: false
+        passive: false
+      - id: google-sheets-stream
+        http: false
+        passive: false
+    camel-gora:
+      groupId: org.apache.camel
+      artifactId: camel-gora
+      schemes:
+      - id: gora
+        http: false
+        passive: false
+    camel-grape:
+      groupId: org.apache.camel
+      artifactId: camel-grape
+      schemes:
+      - id: grape
+        http: false
+        passive: false
+    camel-grok:
+      groupId: org.apache.camel
+      artifactId: camel-grok
+      dataformats:
+      - grok
+    camel-groovy:
+      groupId: org.apache.camel
+      artifactId: camel-groovy
+      languages:
+      - groovy
+    camel-grpc:
+      groupId: org.apache.camel
+      artifactId: camel-grpc
+      schemes:
+      - id: grpc
+        http: true
+        passive: false
+    camel-gson:
+      groupId: org.apache.camel
+      artifactId: camel-gson
+      dataformats:
+      - json-gson
+    camel-guava-eventbus:
+      groupId: org.apache.camel
+      artifactId: camel-guava-eventbus
+      schemes:
+      - id: guava-eventbus
+        http: false
+        passive: false
+    camel-hazelcast:
+      groupId: org.apache.camel
+      artifactId: camel-hazelcast
+      schemes:
+      - id: hazelcast-atomicvalue
+        http: false
+        passive: false
+      - id: hazelcast-instance
+        http: false
+        passive: false
+      - id: hazelcast-list
+        http: false
+        passive: false
+      - id: hazelcast-map
+        http: false
+        passive: false
+      - id: hazelcast-multimap
+        http: false
+        passive: false
+      - id: hazelcast-queue
+        http: false
+        passive: false
+      - id: hazelcast-replicatedmap
+        http: false
+        passive: false
+      - id: hazelcast-ringbuffer
+        http: false
+        passive: false
+      - id: hazelcast-seda
+        http: false
+        passive: false
+      - id: hazelcast-set
+        http: false
+        passive: false
+      - id: hazelcast-topic
+        http: false
+        passive: false
+    camel-hbase:
+      groupId: org.apache.camel
+      artifactId: camel-hbase
+      schemes:
+      - id: hbase
+        http: false
+        passive: false
+    camel-hdfs:
+      groupId: org.apache.camel
+      artifactId: camel-hdfs
+      schemes:
+      - id: hdfs
+        http: false
+        passive: false
+    camel-hipchat:
+      groupId: org.apache.camel
+      artifactId: camel-hipchat
+      schemes:
+      - id: hipchat
+        http: false
+        passive: false
+    camel-hl7:
+      groupId: org.apache.camel
+      artifactId: camel-hl7
+      languages:
+      - hl7terser
+      dataformats:
+      - hl7
+    camel-http:
+      groupId: org.apache.camel
+      artifactId: camel-http
+      schemes:
+      - id: http
+        http: false
+        passive: false
+      - id: https
+        http: false
+        passive: false
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-file
+    camel-ical:
+      groupId: org.apache.camel
+      artifactId: camel-ical
+      dataformats:
+      - ical
+    camel-iec60870:
+      groupId: org.apache.camel
+      artifactId: camel-iec60870
+      schemes:
+      - id: iec60870-client
+        http: false
+        passive: false
+      - id: iec60870-server
+        http: false
+        passive: false
+    camel-ignite:
+      groupId: org.apache.camel
+      artifactId: camel-ignite
+      schemes:
+      - id: ignite-cache
+        http: false
+        passive: false
+      - id: ignite-compute
+        http: false
+        passive: false
+      - id: ignite-events
+        http: false
+        passive: false
+      - id: ignite-idgen
+        http: false
+        passive: false
+      - id: ignite-messaging
+        http: false
+        passive: false
+      - id: ignite-queue
+        http: false
+        passive: false
+      - id: ignite-set
+        http: false
+        passive: false
+    camel-infinispan:
+      groupId: org.apache.camel
+      artifactId: camel-infinispan
+      schemes:
+      - id: infinispan
+        http: false
+        passive: false
+    camel-influxdb:
+      groupId: org.apache.camel
+      artifactId: camel-influxdb
+      schemes:
+      - id: influxdb
+        http: false
+        passive: false
+    camel-iota:
+      groupId: org.apache.camel
+      artifactId: camel-iota
+      schemes:
+      - id: iota
+        http: false
+        passive: false
+    camel-ipfs:
+      groupId: org.apache.camel
+      artifactId: camel-ipfs
+      schemes:
+      - id: ipfs
+        http: false
+        passive: false
+    camel-irc:
+      groupId: org.apache.camel
+      artifactId: camel-irc
+      schemes:
+      - id: irc
+        http: false
+        passive: false
+    camel-ironmq:
+      groupId: org.apache.camel
+      artifactId: camel-ironmq
+      schemes:
+      - id: ironmq
+        http: false
+        passive: false
+    camel-jackson:
+      groupId: org.apache.camel
+      artifactId: camel-jackson
+      dataformats:
+      - json-jackson
+    camel-jacksonxml:
+      groupId: org.apache.camel
+      artifactId: camel-jacksonxml
+      dataformats:
+      - jacksonxml
+    camel-jaxb:
+      groupId: org.apache.camel
+      artifactId: camel-jaxb
+      dataformats:
+      - jaxb
+    camel-jaxp:
+      groupId: org.apache.camel
+      artifactId: camel-jaxp
+      languages:
+      - xtokenize
+    camel-jbpm:
+      groupId: org.apache.camel
+      artifactId: camel-jbpm
+      schemes:
+      - id: jbpm
+        http: false
+        passive: false
+    camel-jcache:
+      groupId: org.apache.camel
+      artifactId: camel-jcache
+      schemes:
+      - id: jcache
+        http: false
+        passive: false
+    camel-jclouds:
+      groupId: org.apache.camel
+      artifactId: camel-jclouds
+      schemes:
+      - id: jclouds
+        http: false
+        passive: false
+    camel-jcr:
+      groupId: org.apache.camel
+      artifactId: camel-jcr
+      schemes:
+      - id: jcr
+        http: false
+        passive: false
+    camel-jdbc:
+      groupId: org.apache.camel
+      artifactId: camel-jdbc
+      schemes:
+      - id: jdbc
+        http: false
+        passive: false
+    camel-jetty:
+      groupId: org.apache.camel
+      artifactId: camel-jetty
+      schemes:
+      - id: jetty
+        http: true
+        passive: false
+    camel-jgroups:
+      groupId: org.apache.camel
+      artifactId: camel-jgroups
+      schemes:
+      - id: jgroups
+        http: false
+        passive: false
+    camel-jgroups-raft:
+      groupId: org.apache.camel
+      artifactId: camel-jgroups-raft
+      schemes:
+      - id: jgroups-raft
+        http: false
+        passive: false
+    camel-jing:
+      groupId: org.apache.camel
+      artifactId: camel-jing
+      schemes:
+      - id: jing
+        http: false
+        passive: false
+    camel-jira:
+      groupId: org.apache.camel
+      artifactId: camel-jira
+      schemes:
+      - id: jira
+        http: false
+        passive: false
+    camel-jms:
+      groupId: org.apache.camel
+      artifactId: camel-jms
+      schemes:
+      - id: jms
+        http: false
+        passive: false
+    camel-jmx:
+      groupId: org.apache.camel
+      artifactId: camel-jmx
+      schemes:
+      - id: jmx
+        http: false
+        passive: false
+    camel-johnzon:
+      groupId: org.apache.camel
+      artifactId: camel-johnzon
+      dataformats:
+      - json-johnzon
+    camel-jolt:
+      groupId: org.apache.camel
+      artifactId: camel-jolt
+      schemes:
+      - id: jolt
+        http: false
+        passive: false
+    camel-jooq:
+      groupId: org.apache.camel
+      artifactId: camel-jooq
+      schemes:
+      - id: jooq
+        http: false
+        passive: false
+    camel-jpa:
+      groupId: org.apache.camel
+      artifactId: camel-jpa
+      schemes:
+      - id: jpa
+        http: false
+        passive: false
+    camel-jsch:
+      groupId: org.apache.camel
+      artifactId: camel-jsch
+      schemes:
+      - id: scp
+        http: false
+        passive: false
+    camel-json-validator:
+      groupId: org.apache.camel
+      artifactId: camel-json-validator
+      schemes:
+      - id: json-validator
+        http: false
+        passive: false
+    camel-jsonapi:
+      groupId: org.apache.camel
+      artifactId: camel-jsonapi
+      dataformats:
+      - jsonApi
+    camel-jsonpath:
+      groupId: org.apache.camel
+      artifactId: camel-jsonpath
+      languages:
+      - jsonpath
+    camel-jt400:
+      groupId: org.apache.camel
+      artifactId: camel-jt400
+      schemes:
+      - id: jt400
+        http: false
+        passive: false
+    camel-k-loader-groovy:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-groovy
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-endpointdsl
+      - groupId: org.apache.camel
+        artifactId: camel-groovy
+    camel-k-loader-java:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-java
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-endpointdsl
+    camel-k-loader-js:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-js
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-endpointdsl
+    camel-k-loader-knative:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-knative
+    camel-k-loader-kotlin:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-kotlin
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-endpointdsl
+    camel-k-loader-xml:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-xml
+    camel-k-runtime-health:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-runtime-health
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-servlet
+      - groupId: org.apache.camel.k
+        artifactId: camel-k-runtime-servlet
+    camel-k-runtime-knative:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-runtime-knative
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-cloud
+      - groupId: org.apache.camel.k
+        artifactId: camel-k-loader-yaml
+      - groupId: org.apache.camel.k
+        artifactId: camel-k-loader-knative
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative-api
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative-http
+    camel-k-runtime-main:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-runtime-main
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-core-engine
+      - groupId: org.apache.camel
+        artifactId: camel-main
+      - groupId: org.apache.camel
+        artifactId: camel-properties
+    camel-k-runtime-servlet:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-runtime-servlet
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-servlet
+    camel-kafka:
+      groupId: org.apache.camel
+      artifactId: camel-kafka
+      schemes:
+      - id: kafka
+        http: false
+        passive: false
+    camel-knative:
+      groupId: org.apache.camel.k
+      artifactId: camel-knative
+      schemes:
+      - id: knative
+        http: true
+        passive: false
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-cloud
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative-api
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative-http
+    camel-kubernetes:
+      groupId: org.apache.camel
+      artifactId: camel-kubernetes
+      schemes:
+      - id: kubernetes-config-maps
+        http: false
+        passive: false
+      - id: kubernetes-deployments
+        http: false
+        passive: false
+      - id: kubernetes-hpa
+        http: false
+        passive: false
+      - id: kubernetes-job
+        http: false
+        passive: false
+      - id: kubernetes-namespaces
+        http: false
+        passive: false
+      - id: kubernetes-nodes
+        http: false
+        passive: false
+      - id: kubernetes-persistent-volumes
+        http: false
+        passive: false
+      - id: kubernetes-persistent-volumes-claims
+        http: false
+        passive: false
+      - id: kubernetes-pods
+        http: false
+        passive: false
+      - id: kubernetes-replication-controllers
+        http: false
+        passive: false
+      - id: kubernetes-resources-quota
+        http: false
+        passive: false
+      - id: kubernetes-secrets
+        http: false
+        passive: false
+      - id: kubernetes-service-accounts
+        http: false
+        passive: false
+      - id: kubernetes-services
+        http: false
+        passive: false
+      - id: openshift-build-configs
+        http: false
+        passive: false
+      - id: openshift-builds
+        http: false
+        passive: false
+    camel-language:
+      groupId: org.apache.camel
+      artifactId: camel-language
+      schemes:
+      - id: language
+        http: false
+        passive: true
+    camel-ldap:
+      groupId: org.apache.camel
+      artifactId: camel-ldap
+      schemes:
+      - id: ldap
+        http: false
+        passive: false
+    camel-ldif:
+      groupId: org.apache.camel
+      artifactId: camel-ldif
+      schemes:
+      - id: ldif
+        http: false
+        passive: false
+    camel-linkedin:
+      groupId: org.apache.camel
+      artifactId: camel-linkedin
+      schemes:
+      - id: linkedin
+        http: false
+        passive: false
+    camel-log:
+      groupId: org.apache.camel
+      artifactId: camel-log
+      schemes:
+      - id: log
+        http: false
+        passive: true
+    camel-lucene:
+      groupId: org.apache.camel
+      artifactId: camel-lucene
+      schemes:
+      - id: lucene
+        http: false
+        passive: false
+    camel-lumberjack:
+      groupId: org.apache.camel
+      artifactId: camel-lumberjack
+      schemes:
+      - id: lumberjack
+        http: false
+        passive: false
+    camel-lzf:
+      groupId: org.apache.camel
+      artifactId: camel-lzf
+      dataformats:
+      - lzf
+    camel-mail:
+      groupId: org.apache.camel
+      artifactId: camel-mail
+      schemes:
+      - id: imap
+        http: false
+        passive: false
+      - id: imaps
+        http: false
+        passive: false
+      - id: pop3
+        http: false
+        passive: false
+      - id: pop3s
+        http: false
+        passive: false
+      - id: smtp
+        http: false
+        passive: false
+      - id: smtps
+        http: false
+        passive: false
+      dataformats:
+      - mime-multipart
+    camel-master:
+      groupId: org.apache.camel
+      artifactId: camel-master
+      schemes:
+      - id: master
+        http: false
+        passive: false
+    camel-metrics:
+      groupId: org.apache.camel
+      artifactId: camel-metrics
+      schemes:
+      - id: metrics
+        http: false
+        passive: false
+    camel-micrometer:
+      groupId: org.apache.camel
+      artifactId: camel-micrometer
+      schemes:
+      - id: micrometer
+        http: false
+        passive: false
+    camel-microprofile-metrics:
+      groupId: org.apache.camel
+      artifactId: camel-microprofile-metrics
+      schemes:
+      - id: microprofile-metrics
+        http: false
+        passive: false
+    camel-milo:
+      groupId: org.apache.camel
+      artifactId: camel-milo
+      schemes:
+      - id: milo-client
+        http: false
+        passive: false
+      - id: milo-server
+        http: false
+        passive: false
+    camel-mina:
+      groupId: org.apache.camel
+      artifactId: camel-mina
+      schemes:
+      - id: mina
+        http: false
+        passive: false
+    camel-mllp:
+      groupId: org.apache.camel
+      artifactId: camel-mllp
+      schemes:
+      - id: mllp
+        http: false
+        passive: false
+    camel-mock:
+      groupId: org.apache.camel
+      artifactId: camel-mock
+      schemes:
+      - id: mock
+        http: false
+        passive: true
+    camel-mongodb:
+      groupId: org.apache.camel
+      artifactId: camel-mongodb
+      schemes:
+      - id: mongodb
+        http: false
+        passive: false
+    camel-mongodb-gridfs:
+      groupId: org.apache.camel
+      artifactId: camel-mongodb-gridfs
+      schemes:
+      - id: mongodb-gridfs
+        http: false
+        passive: false
+    camel-mqtt:
+      groupId: org.apache.camel
+      artifactId: camel-mqtt
+      schemes:
+      - id: mqtt
+        http: false
+        passive: false
+    camel-msv:
+      groupId: org.apache.camel
+      artifactId: camel-msv
+      schemes:
+      - id: msv
+        http: false
+        passive: false
+    camel-mustache:
+      groupId: org.apache.camel
+      artifactId: camel-mustache
+      schemes:
+      - id: mustache
+        http: false
+        passive: false
+    camel-mvel:
+      groupId: org.apache.camel
+      artifactId: camel-mvel
+      schemes:
+      - id: mvel
+        http: false
+        passive: false
+      languages:
+      - mvel
+    camel-mybatis:
+      groupId: org.apache.camel
+      artifactId: camel-mybatis
+      schemes:
+      - id: mybatis
+        http: false
+        passive: false
+      - id: mybatis-bean
+        http: false
+        passive: false
+    camel-nagios:
+      groupId: org.apache.camel
+      artifactId: camel-nagios
+      schemes:
+      - id: nagios
+        http: false
+        passive: false
+    camel-nats:
+      groupId: org.apache.camel
+      artifactId: camel-nats
+      schemes:
+      - id: nats
+        http: false
+        passive: false
+    camel-netty:
+      groupId: org.apache.camel
+      artifactId: camel-netty
+      schemes:
+      - id: netty
+        http: false
+        passive: false
+    camel-netty-http:
+      groupId: org.apache.camel
+      artifactId: camel-netty-http
+      schemes:
+      - id: netty-http
+        http: true
+        passive: false
+    camel-nsq:
+      groupId: org.apache.camel
+      artifactId: camel-nsq
+      schemes:
+      - id: nsq
+        http: false
+        passive: false
+    camel-ognl:
+      groupId: org.apache.camel
+      artifactId: camel-ognl
+      languages:
+      - ognl
+    camel-olingo2:
+      groupId: org.apache.camel
+      artifactId: camel-olingo2
+      schemes:
+      - id: olingo2
+        http: false
+        passive: false
+    camel-olingo4:
+      groupId: org.apache.camel
+      artifactId: camel-olingo4
+      schemes:
+      - id: olingo4
+        http: false
+        passive: false
+    camel-openstack:
+      groupId: org.apache.camel
+      artifactId: camel-openstack
+      schemes:
+      - id: openstack-cinder
+        http: false
+        passive: false
+      - id: openstack-glance
+        http: false
+        passive: false
+      - id: openstack-keystone
+        http: false
+        passive: false
+      - id: openstack-neutron
+        http: false
+        passive: false
+      - id: openstack-nova
+        http: false
+        passive: false
+      - id: openstack-swift
+        http: false
+        passive: false
+    camel-optaplanner:
+      groupId: org.apache.camel
+      artifactId: camel-optaplanner
+      schemes:
+      - id: optaplanner
+        http: false
+        passive: false
+    camel-paho:
+      groupId: org.apache.camel
+      artifactId: camel-paho
+      schemes:
+      - id: paho
+        http: false
+        passive: false
+    camel-paxlogging:
+      groupId: org.apache.camel
+      artifactId: camel-paxlogging
+      schemes:
+      - id: paxlogging
+        http: false
+        passive: false
+    camel-pdf:
+      groupId: org.apache.camel
+      artifactId: camel-pdf
+      schemes:
+      - id: pdf
+        http: false
+        passive: false
+    camel-pg-replication-slot:
+      groupId: org.apache.camel
+      artifactId: camel-pg-replication-slot
+      schemes:
+      - id: pg-replication-slot
+        http: false
+        passive: false
+    camel-pgevent:
+      groupId: org.apache.camel
+      artifactId: camel-pgevent
+      schemes:
+      - id: pgevent
+        http: false
+        passive: false
+    camel-printer:
+      groupId: org.apache.camel
+      artifactId: camel-printer
+      schemes:
+      - id: lpr
+        http: false
+        passive: false
+    camel-properties:
+      groupId: org.apache.camel
+      artifactId: camel-properties
+      schemes:
+      - id: properties
+        http: false
+        passive: true
+    camel-protobuf:
+      groupId: org.apache.camel
+      artifactId: camel-protobuf
+      dataformats:
+      - protobuf
+    camel-pubnub:
+      groupId: org.apache.camel
+      artifactId: camel-pubnub
+      schemes:
+      - id: pubnub
+        http: false
+        passive: false
+    camel-pulsar:
+      groupId: org.apache.camel
+      artifactId: camel-pulsar
+      schemes:
+      - id: pulsar
+        http: false
+        passive: false
+    camel-quartz:
+      groupId: org.apache.camel
+      artifactId: camel-quartz
+      schemes:
+      - id: quartz
+        http: false
+        passive: false
+    camel-quickfix:
+      groupId: org.apache.camel
+      artifactId: camel-quickfix
+      schemes:
+      - id: quickfix
+        http: false
+        passive: false
+    camel-rabbitmq:
+      groupId: org.apache.camel
+      artifactId: camel-rabbitmq
+      schemes:
+      - id: rabbitmq
+        http: false
+        passive: false
+    camel-reactive-streams:
+      groupId: org.apache.camel
+      artifactId: camel-reactive-streams
+      schemes:
+      - id: reactive-streams
+        http: false
+        passive: false
+    camel-ref:
+      groupId: org.apache.camel
+      artifactId: camel-ref
+      schemes:
+      - id: ref
+        http: false
+        passive: true
+    camel-rest:
+      groupId: org.apache.camel
+      artifactId: camel-rest
+      schemes:
+      - id: rest
+        http: true
+        passive: false
+      - id: rest-api
+        http: false
+        passive: false
+    camel-rest-swagger:
+      groupId: org.apache.camel
+      artifactId: camel-rest-swagger
+      schemes:
+      - id: rest-swagger
+        http: false
+        passive: false
+    camel-restlet:
+      groupId: org.apache.camel
+      artifactId: camel-restlet
+      schemes:
+      - id: restlet
+        http: true
+        passive: false
+    camel-rss:
+      groupId: org.apache.camel
+      artifactId: camel-rss
+      schemes:
+      - id: rss
+        http: false
+        passive: false
+      dataformats:
+      - rss
+    camel-saga:
+      groupId: org.apache.camel
+      artifactId: camel-saga
+      schemes:
+      - id: saga
+        http: false
+        passive: false
+    camel-salesforce:
+      groupId: org.apache.camel
+      artifactId: camel-salesforce
+      schemes:
+      - id: salesforce
+        http: false
+        passive: false
+    camel-sap-netweaver:
+      groupId: org.apache.camel
+      artifactId: camel-sap-netweaver
+      schemes:
+      - id: sap-netweaver
+        http: false
+        passive: false
+    camel-saxon:
+      groupId: org.apache.camel
+      artifactId: camel-saxon
+      schemes:
+      - id: xquery
+        http: false
+        passive: false
+      languages:
+      - xquery
+    camel-scheduler:
+      groupId: org.apache.camel
+      artifactId: camel-scheduler
+      schemes:
+      - id: scheduler
+        http: false
+        passive: false
+    camel-schematron:
+      groupId: org.apache.camel
+      artifactId: camel-schematron
+      schemes:
+      - id: schematron
+        http: false
+        passive: false
+    camel-seda:
+      groupId: org.apache.camel
+      artifactId: camel-seda
+      schemes:
+      - id: seda
+        http: false
+        passive: true
+    camel-service:
+      groupId: org.apache.camel
+      artifactId: camel-service
+      schemes:
+      - id: service
+        http: false
+        passive: false
+    camel-servicenow:
+      groupId: org.apache.camel
+      artifactId: camel-servicenow
+      schemes:
+      - id: servicenow
+        http: false
+        passive: false
+    camel-servlet:
+      groupId: org.apache.camel
+      artifactId: camel-servlet
+      schemes:
+      - id: servlet
+        http: true
+        passive: false
+    camel-sip:
+      groupId: org.apache.camel
+      artifactId: camel-sip
+      schemes:
+      - id: sip
+        http: false
+        passive: false
+      - id: sips
+        http: false
+        passive: false
+    camel-sjms:
+      groupId: org.apache.camel
+      artifactId: camel-sjms
+      schemes:
+      - id: sjms
+        http: false
+        passive: false
+      - id: sjms-batch
+        http: false
+        passive: false
+    camel-sjms2:
+      groupId: org.apache.camel
+      artifactId: camel-sjms2
+      schemes:
+      - id: sjms2
+        http: false
+        passive: false
+    camel-slack:
+      groupId: org.apache.camel
+      artifactId: camel-slack
+      schemes:
+      - id: slack
+        http: false
+        passive: false
+    camel-smpp:
+      groupId: org.apache.camel
+      artifactId: camel-smpp
+      schemes:
+      - id: smpp
+        http: false
+        passive: false
+      - id: smpps
+        http: false
+        passive: false
+    camel-snakeyaml:
+      groupId: org.apache.camel
+      artifactId: camel-snakeyaml
+      dataformats:
+      - yaml-snakeyaml
+    camel-snmp:
+      groupId: org.apache.camel
+      artifactId: camel-snmp
+      schemes:
+      - id: snmp
+        http: false
+        passive: false
+    camel-soap:
+      groupId: org.apache.camel
+      artifactId: camel-soap
+      dataformats:
+      - soapjaxb
+    camel-solr:
+      groupId: org.apache.camel
+      artifactId: camel-solr
+      schemes:
+      - id: solr
+        http: false
+        passive: false
+      - id: solrs
+        http: false
+        passive: false
+      - id: solrCloud
+        http: false
+        passive: false
+    camel-soroush:
+      groupId: org.apache.camel
+      artifactId: camel-soroush
+      schemes:
+      - id: soroush
+        http: false
+        passive: false
+    camel-spark:
+      groupId: org.apache.camel
+      artifactId: camel-spark
+      schemes:
+      - id: spark
+        http: false
+        passive: false
+    camel-spark-rest:
+      groupId: org.apache.camel
+      artifactId: camel-spark-rest
+      schemes:
+      - id: spark-rest
+        http: true
+        passive: false
+    camel-splunk:
+      groupId: org.apache.camel
+      artifactId: camel-splunk
+      schemes:
+      - id: splunk
+        http: false
+        passive: false
+    camel-spring:
+      groupId: org.apache.camel
+      artifactId: camel-spring
+      schemes:
+      - id: spring-event
+        http: false
+        passive: false
+      languages:
+      - spel
+    camel-spring-batch:
+      groupId: org.apache.camel
+      artifactId: camel-spring-batch
+      schemes:
+      - id: spring-batch
+        http: false
+        passive: false
+    camel-spring-integration:
+      groupId: org.apache.camel
+      artifactId: camel-spring-integration
+      schemes:
+      - id: spring-integration
+        http: false
+        passive: false
+    camel-spring-ldap:
+      groupId: org.apache.camel
+      artifactId: camel-spring-ldap
+      schemes:
+      - id: spring-ldap
+        http: false
+        passive: false
+    camel-spring-redis:
+      groupId: org.apache.camel
+      artifactId: camel-spring-redis
+      schemes:
+      - id: spring-redis
+        http: false
+        passive: false
+    camel-spring-ws:
+      groupId: org.apache.camel
+      artifactId: camel-spring-ws
+      schemes:
+      - id: spring-ws
+        http: true
+        passive: false
+    camel-sql:
+      groupId: org.apache.camel
+      artifactId: camel-sql
+      schemes:
+      - id: sql
+        http: false
+        passive: false
+      - id: sql-stored
+        http: false
+        passive: false
+    camel-ssh:
+      groupId: org.apache.camel
+      artifactId: camel-ssh
+      schemes:
+      - id: ssh
+        http: false
+        passive: false
+    camel-stax:
+      groupId: org.apache.camel
+      artifactId: camel-stax
+      schemes:
+      - id: stax
+        http: false
+        passive: false
+    camel-stomp:
+      groupId: org.apache.camel
+      artifactId: camel-stomp
+      schemes:
+      - id: stomp
+        http: false
+        passive: false
+    camel-stream:
+      groupId: org.apache.camel
+      artifactId: camel-stream
+      schemes:
+      - id: stream
+        http: false
+        passive: false
+    camel-stringtemplate:
+      groupId: org.apache.camel
+      artifactId: camel-stringtemplate
+      schemes:
+      - id: string-template
+        http: false
+        passive: false
+    camel-stub:
+      groupId: org.apache.camel
+      artifactId: camel-stub
+      schemes:
+      - id: stub
+        http: false
+        passive: true
+    camel-syslog:
+      groupId: org.apache.camel
+      artifactId: camel-syslog
+      dataformats:
+      - syslog
+    camel-tagsoup:
+      groupId: org.apache.camel
+      artifactId: camel-tagsoup
+      dataformats:
+      - tidyMarkup
+    camel-tarfile:
+      groupId: org.apache.camel
+      artifactId: camel-tarfile
+      dataformats:
+      - tarfile
+    camel-telegram:
+      groupId: org.apache.camel
+      artifactId: camel-telegram
+      schemes:
+      - id: telegram
+        http: false
+        passive: false
+    camel-thrift:
+      groupId: org.apache.camel
+      artifactId: camel-thrift
+      schemes:
+      - id: thrift
+        http: false
+        passive: false
+      dataformats:
+      - thrift
+    camel-tika:
+      groupId: org.apache.camel
+      artifactId: camel-tika
+      schemes:
+      - id: tika
+        http: false
+        passive: false
+    camel-timer:
+      groupId: org.apache.camel
+      artifactId: camel-timer
+      schemes:
+      - id: timer
+        http: false
+        passive: false
+    camel-twilio:
+      groupId: org.apache.camel
+      artifactId: camel-twilio
+      schemes:
+      - id: twilio
+        http: false
+        passive: false
+    camel-twitter:
+      groupId: org.apache.camel
+      artifactId: camel-twitter
+      schemes:
+      - id: twitter-directmessage
+        http: false
+        passive: false
+      - id: twitter-search
+        http: false
+        passive: false
+      - id: twitter-timeline
+        http: false
+        passive: false
+    camel-undertow:
+      groupId: org.apache.camel
+      artifactId: camel-undertow
+      schemes:
+      - id: undertow
+        http: true
+        passive: false
+    camel-univocity-parsers:
+      groupId: org.apache.camel
+      artifactId: camel-univocity-parsers
+      dataformats:
+      - univocity-csv
+      - univocity-fixed
+      - univocity-tsv
+    camel-validator:
+      groupId: org.apache.camel
+      artifactId: camel-validator
+      schemes:
+      - id: validator
+        http: false
+        passive: true
+    camel-velocity:
+      groupId: org.apache.camel
+      artifactId: camel-velocity
+      schemes:
+      - id: velocity
+        http: false
+        passive: false
+    camel-vertx:
+      groupId: org.apache.camel
+      artifactId: camel-vertx
+      schemes:
+      - id: vertx
+        http: false
+        passive: false
+    camel-vm:
+      groupId: org.apache.camel
+      artifactId: camel-vm
+      schemes:
+      - id: vm
+        http: false
+        passive: true
+    camel-weather:
+      groupId: org.apache.camel
+      artifactId: camel-weather
+      schemes:
+      - id: weather
+        http: false
+        passive: false
+    camel-web3j:
+      groupId: org.apache.camel
+      artifactId: camel-web3j
+      schemes:
+      - id: web3j
+        http: false
+        passive: false
+    camel-webhook:
+      groupId: org.apache.camel
+      artifactId: camel-webhook
+      schemes:
+      - id: webhook
+        http: true
+        passive: false
+    camel-websocket:
+      groupId: org.apache.camel
+      artifactId: camel-websocket
+      schemes:
+      - id: websocket
+        http: true
+        passive: false
+    camel-websocket-jsr356:
+      groupId: org.apache.camel
+      artifactId: camel-websocket-jsr356
+      schemes:
+      - id: websocket-jsr356
+        http: false
+        passive: false
+    camel-wordpress:
+      groupId: org.apache.camel
+      artifactId: camel-wordpress
+      schemes:
+      - id: wordpress
+        http: false
+        passive: false
+    camel-xchange:
+      groupId: org.apache.camel
+      artifactId: camel-xchange
+      schemes:
+      - id: xchange
+        http: false
+        passive: false
+    camel-xmlsecurity:
+      groupId: org.apache.camel
+      artifactId: camel-xmlsecurity
+      schemes:
+      - id: xmlsecurity
+        http: false
+        passive: false
+      dataformats:
+      - secureXML
+    camel-xmpp:
+      groupId: org.apache.camel
+      artifactId: camel-xmpp
+      schemes:
+      - id: xmpp
+        http: false
+        passive: false
+    camel-xpath:
+      groupId: org.apache.camel
+      artifactId: camel-xpath
+      languages:
+      - xpath
+    camel-xslt:
+      groupId: org.apache.camel
+      artifactId: camel-xslt
+      schemes:
+      - id: xslt
+        http: false
+        passive: false
+    camel-xstream:
+      groupId: org.apache.camel
+      artifactId: camel-xstream
+      dataformats:
+      - json-xstream
+      - xstream
+    camel-yammer:
+      groupId: org.apache.camel
+      artifactId: camel-yammer
+      schemes:
+      - id: yammer
+        http: false
+        passive: false
+    camel-zendesk:
+      groupId: org.apache.camel
+      artifactId: camel-zendesk
+      schemes:
+      - id: zendesk
+        http: false
+        passive: false
+    camel-zip-deflater:
+      groupId: org.apache.camel
+      artifactId: camel-zip-deflater
+      dataformats:
+      - gzipdeflater
+      - zipdeflater
+    camel-zipfile:
+      groupId: org.apache.camel
+      artifactId: camel-zipfile
+      dataformats:
+      - zipfile
+    camel-zookeeper:
+      groupId: org.apache.camel
+      artifactId: camel-zookeeper
+      schemes:
+      - id: zookeeper
+        http: false
+        passive: false
+    camel-zookeeper-master:
+      groupId: org.apache.camel
+      artifactId: camel-zookeeper-master
+      schemes:
+      - id: zookeeper-master
+        http: false
+        passive: false
+
+`
+	Resources["camel-catalog-quarkus-0.3.0-1.0.7-SNAPSHOT.yaml"] =
+		`
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+apiVersion: camel.apache.org/v1alpha1
+kind: CamelCatalog
+metadata:
+  name: camel-quarkus-catalog-0.3.0-1.0.7-SNAPSHOT
   labels:
     app: camel-k
     camel.apache.org/catalog.version: 3.0.0-RC3
     camel.apache.org/catalog.loader.version: 3.0.0-RC3
-    camel.apache.org/runtime.version: 1.0.7
+    camel.apache.org/runtime.version: 1.0.7-SNAPSHOT
     camel.apache.org/runtime.provider: quarkus
 spec:
   version: 3.0.0-RC3
-  runtimeVersion: 1.0.7
+  runtimeVersion: 1.0.7-SNAPSHOT
   runtimeProvider:
     quarkus:
       camelQuarkusVersion: 0.3.0
diff --git a/pkg/util/camel/catalog.go b/pkg/util/camel/catalog.go
index 17224ea..6a9b6da 100644
--- a/pkg/util/camel/catalog.go
+++ b/pkg/util/camel/catalog.go
@@ -42,8 +42,21 @@ func DefaultCatalog() (*RuntimeCatalog, error) {
 
 // QuarkusCatalog --
 func QuarkusCatalog() (*RuntimeCatalog, error) {
-	return catalogForRuntimeProvider(v1alpha1.QuarkusRuntimeProvider{
-		// Can be replaced with the default Camel Quarkus version when it's stable
+	catalogs := make([]v1alpha1.CamelCatalog, 0)
+
+	for name, content := range deploy.Resources {
+		if strings.HasPrefix(name, "camel-catalog-") {
+			var c v1alpha1.CamelCatalog
+			if err := yaml2.Unmarshal([]byte(content), &c); err != nil {
+				return nil, err
+			}
+
+			catalogs = append(catalogs, c)
+		}
+	}
+
+	// FIXME: to be replaced with catalogForRuntimeProvider when 1.0.7 is released
+	return findBestMatch(catalogs, "3.0.0-RC3", "1.0.7-SNAPSHOT", v1alpha1.QuarkusRuntimeProvider{
 		CamelQuarkusVersion: defaults.CamelQuarkusVersionConstraint,
 		QuarkusVersion:      defaults.DefaultQuarkusVersion,
 	})


[camel-k] 05/38: feat(quarkus): Add initial Camel Quarkus catalog

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 5267041c537c11308816615a80ce7581925ad729
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Tue Oct 22 15:29:58 2019 +0200

    feat(quarkus): Add initial Camel Quarkus catalog
---
 deploy/camel-catalog-quarkus-3.0.0-RC1-1.0.5.yaml | 304 +++++++++++++++++++++
 deploy/resources.go                               | 307 ++++++++++++++++++++++
 2 files changed, 611 insertions(+)

diff --git a/deploy/camel-catalog-quarkus-3.0.0-RC1-1.0.5.yaml b/deploy/camel-catalog-quarkus-3.0.0-RC1-1.0.5.yaml
new file mode 100644
index 0000000..a335145
--- /dev/null
+++ b/deploy/camel-catalog-quarkus-3.0.0-RC1-1.0.5.yaml
@@ -0,0 +1,304 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+apiVersion: camel.apache.org/v1alpha1
+kind: CamelCatalog
+metadata:
+  name: camel-catalog-quarkus-3.0.0-rc1-1.0.5
+  labels:
+    app: camel-k
+    camel.apache.org/catalog.version: 3.0.0-RC1
+    camel.apache.org/catalog.loader.version: 3.0.0-RC1
+    camel.apache.org/runtime.version: 1.0.5
+    camel.apache.org/runtime.provider: quarkus
+spec:
+  version: 3.0.0-RC1
+  runtimeVersion: 1.0.5
+  runtimeProvider:
+    quarkus:
+      camelQuarkusVersion: 0.2.0
+      quarkusVersion: 0.21.2
+  artifacts:
+    camel-k-loader-groovy:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-groovy
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-endpointdsl
+      - groupId: org.apache.camel
+        artifactId: camel-groovy
+    camel-k-loader-java:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-java
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-endpointdsl
+    camel-k-loader-js:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-js
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-endpointdsl
+    camel-k-loader-knative:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-knative
+    camel-k-loader-kotlin:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-kotlin
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-endpointdsl
+    camel-k-loader-xml:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-xml
+    camel-k-runtime-health:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-runtime-health
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-servlet
+      - groupId: org.apache.camel.k
+        artifactId: camel-k-runtime-servlet
+    camel-k-runtime-knative:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-runtime-knative
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-cloud
+      - groupId: org.apache.camel.k
+        artifactId: camel-k-loader-yaml
+      - groupId: org.apache.camel.k
+        artifactId: camel-k-loader-knative
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative-api
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative-http
+    camel-k-runtime-main:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-runtime-main
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-core-engine
+      - groupId: org.apache.camel
+        artifactId: camel-main
+      - groupId: org.apache.camel
+        artifactId: camel-properties
+    camel-k-runtime-servlet:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-runtime-servlet
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-servlet
+    camel-knative:
+      groupId: org.apache.camel.k
+      artifactId: camel-knative
+      schemes:
+      - id: knative
+        http: true
+        passive: false
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-cloud
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative-api
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative-http
+    camel-quarkus-aws-eks:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-aws-eks
+      schemes:
+      - id: aws-eks
+        http: false
+        passive: false
+    camel-quarkus-aws-s3:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-aws-s3
+      schemes:
+      - id: aws-s3
+        http: false
+        passive: false
+    camel-quarkus-aws-sns:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-aws-sns
+      schemes:
+      - id: aws-sns
+        http: false
+        passive: false
+    camel-quarkus-aws-sqs:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-aws-sqs
+      schemes:
+      - id: aws-sqs
+        http: false
+        passive: false
+    camel-quarkus-bean:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-bean
+      schemes:
+      - id: bean
+        http: false
+        passive: true
+      - id: class
+        http: false
+        passive: true
+      languages:
+      - bean
+    camel-quarkus-core:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-core
+      languages:
+      - constant
+      - exchangeProperty
+      - file
+      - header
+      - ref
+      - simple
+      - tokenize
+    camel-quarkus-csv:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-csv
+      dataformats:
+      - csv
+    camel-quarkus-direct:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-direct
+      schemes:
+      - id: direct
+        http: false
+        passive: true
+    camel-quarkus-infinispan:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-infinispan
+      schemes:
+      - id: infinispan
+        http: false
+        passive: false
+    camel-quarkus-jdbc:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-jdbc
+      schemes:
+      - id: jdbc
+        http: false
+        passive: false
+    camel-quarkus-log:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-log
+      schemes:
+      - id: log
+        http: false
+        passive: true
+    camel-quarkus-mail:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-mail
+      schemes:
+      - id: imap
+        http: false
+        passive: false
+      - id: imaps
+        http: false
+        passive: false
+      - id: pop3
+        http: false
+        passive: false
+      - id: pop3s
+        http: false
+        passive: false
+      - id: smtp
+        http: false
+        passive: false
+      - id: smtps
+        http: false
+        passive: false
+      dataformats:
+      - mime-multipart
+    camel-quarkus-microprofile-metrics:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-microprofile-metrics
+      schemes:
+      - id: microprofile-metrics
+        http: false
+        passive: false
+    camel-quarkus-netty-http:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-netty-http
+      schemes:
+      - id: netty-http
+        http: true
+        passive: false
+    camel-quarkus-paho:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-paho
+      schemes:
+      - id: paho
+        http: false
+        passive: false
+    camel-quarkus-rest:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-rest
+      schemes:
+      - id: rest
+        http: true
+        passive: false
+      - id: rest-api
+        http: false
+        passive: false
+    camel-quarkus-salesforce:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-salesforce
+      schemes:
+      - id: salesforce
+        http: false
+        passive: false
+    camel-quarkus-servlet:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-servlet
+      schemes:
+      - id: servlet
+        http: true
+        passive: false
+    camel-quarkus-tarfile:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-tarfile
+      dataformats:
+      - tarfile
+    camel-quarkus-timer:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-timer
+      schemes:
+      - id: timer
+        http: false
+        passive: false
+    camel-quarkus-twitter:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-twitter
+      schemes:
+      - id: twitter-directmessage
+        http: false
+        passive: false
+      - id: twitter-search
+        http: false
+        passive: false
+      - id: twitter-timeline
+        http: false
+        passive: false
+    camel-quarkus-zipfile:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-zipfile
+      dataformats:
+      - zipfile
diff --git a/deploy/resources.go b/deploy/resources.go
index 7199602..ab5d14d 100644
--- a/deploy/resources.go
+++ b/deploy/resources.go
@@ -6942,6 +6942,313 @@ spec:
         passive: false
 
 `
+	Resources["camel-catalog-quarkus-3.0.0-RC1-1.0.5.yaml"] =
+		`
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+apiVersion: camel.apache.org/v1alpha1
+kind: CamelCatalog
+metadata:
+  name: camel-catalog-quarkus-3.0.0-rc1-1.0.5
+  labels:
+    app: camel-k
+    camel.apache.org/catalog.version: 3.0.0-RC1
+    camel.apache.org/catalog.loader.version: 3.0.0-RC1
+    camel.apache.org/runtime.version: 1.0.5
+    camel.apache.org/runtime.provider: quarkus
+spec:
+  version: 3.0.0-RC1
+  runtimeVersion: 1.0.5
+  runtimeProvider:
+    quarkus:
+      camelQuarkusVersion: 0.2.0
+      quarkusVersion: 0.21.2
+  artifacts:
+    camel-k-loader-groovy:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-groovy
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-endpointdsl
+      - groupId: org.apache.camel
+        artifactId: camel-groovy
+    camel-k-loader-java:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-java
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-endpointdsl
+    camel-k-loader-js:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-js
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-endpointdsl
+    camel-k-loader-knative:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-knative
+    camel-k-loader-kotlin:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-kotlin
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-endpointdsl
+    camel-k-loader-xml:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-loader-xml
+    camel-k-runtime-health:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-runtime-health
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-servlet
+      - groupId: org.apache.camel.k
+        artifactId: camel-k-runtime-servlet
+    camel-k-runtime-knative:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-runtime-knative
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-cloud
+      - groupId: org.apache.camel.k
+        artifactId: camel-k-loader-yaml
+      - groupId: org.apache.camel.k
+        artifactId: camel-k-loader-knative
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative-api
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative-http
+    camel-k-runtime-main:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-runtime-main
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-core-engine
+      - groupId: org.apache.camel
+        artifactId: camel-main
+      - groupId: org.apache.camel
+        artifactId: camel-properties
+    camel-k-runtime-servlet:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-runtime-servlet
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-servlet
+    camel-knative:
+      groupId: org.apache.camel.k
+      artifactId: camel-knative
+      schemes:
+      - id: knative
+        http: true
+        passive: false
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-cloud
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative-api
+      - groupId: org.apache.camel.k
+        artifactId: camel-knative-http
+    camel-quarkus-aws-eks:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-aws-eks
+      schemes:
+      - id: aws-eks
+        http: false
+        passive: false
+    camel-quarkus-aws-s3:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-aws-s3
+      schemes:
+      - id: aws-s3
+        http: false
+        passive: false
+    camel-quarkus-aws-sns:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-aws-sns
+      schemes:
+      - id: aws-sns
+        http: false
+        passive: false
+    camel-quarkus-aws-sqs:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-aws-sqs
+      schemes:
+      - id: aws-sqs
+        http: false
+        passive: false
+    camel-quarkus-bean:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-bean
+      schemes:
+      - id: bean
+        http: false
+        passive: true
+      - id: class
+        http: false
+        passive: true
+      languages:
+      - bean
+    camel-quarkus-core:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-core
+      languages:
+      - constant
+      - exchangeProperty
+      - file
+      - header
+      - ref
+      - simple
+      - tokenize
+    camel-quarkus-csv:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-csv
+      dataformats:
+      - csv
+    camel-quarkus-direct:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-direct
+      schemes:
+      - id: direct
+        http: false
+        passive: true
+    camel-quarkus-infinispan:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-infinispan
+      schemes:
+      - id: infinispan
+        http: false
+        passive: false
+    camel-quarkus-jdbc:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-jdbc
+      schemes:
+      - id: jdbc
+        http: false
+        passive: false
+    camel-quarkus-log:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-log
+      schemes:
+      - id: log
+        http: false
+        passive: true
+    camel-quarkus-mail:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-mail
+      schemes:
+      - id: imap
+        http: false
+        passive: false
+      - id: imaps
+        http: false
+        passive: false
+      - id: pop3
+        http: false
+        passive: false
+      - id: pop3s
+        http: false
+        passive: false
+      - id: smtp
+        http: false
+        passive: false
+      - id: smtps
+        http: false
+        passive: false
+      dataformats:
+      - mime-multipart
+    camel-quarkus-microprofile-metrics:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-microprofile-metrics
+      schemes:
+      - id: microprofile-metrics
+        http: false
+        passive: false
+    camel-quarkus-netty-http:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-netty-http
+      schemes:
+      - id: netty-http
+        http: true
+        passive: false
+    camel-quarkus-paho:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-paho
+      schemes:
+      - id: paho
+        http: false
+        passive: false
+    camel-quarkus-rest:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-rest
+      schemes:
+      - id: rest
+        http: true
+        passive: false
+      - id: rest-api
+        http: false
+        passive: false
+    camel-quarkus-salesforce:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-salesforce
+      schemes:
+      - id: salesforce
+        http: false
+        passive: false
+    camel-quarkus-servlet:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-servlet
+      schemes:
+      - id: servlet
+        http: true
+        passive: false
+    camel-quarkus-tarfile:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-tarfile
+      dataformats:
+      - tarfile
+    camel-quarkus-timer:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-timer
+      schemes:
+      - id: timer
+        http: false
+        passive: false
+    camel-quarkus-twitter:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-twitter
+      schemes:
+      - id: twitter-directmessage
+        http: false
+        passive: false
+      - id: twitter-search
+        http: false
+        passive: false
+      - id: twitter-timeline
+        http: false
+        passive: false
+    camel-quarkus-zipfile:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-zipfile
+      dataformats:
+      - zipfile
+`
 	Resources["crd-build.yaml"] =
 		`
 # ---------------------------------------------------------------------------


[camel-k] 08/38: feat(quarkus): Sanitize Camel Quarkus dependencies

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit a453b6636bde1af06b08fd6c1b6da450046c40d2
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Tue Oct 22 15:37:18 2019 +0200

    feat(quarkus): Sanitize Camel Quarkus dependencies
---
 pkg/builder/builder_steps.go | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pkg/builder/builder_steps.go b/pkg/builder/builder_steps.go
index 32a54fa..878ef56 100644
--- a/pkg/builder/builder_steps.go
+++ b/pkg/builder/builder_steps.go
@@ -217,13 +217,13 @@ func sanitizeDependencies(ctx *Context) error {
 	for i := 0; i < len(ctx.Maven.Project.Dependencies); i++ {
 		dep := ctx.Maven.Project.Dependencies[i]
 
+		// It may be externalized into runtime provider specific steps
 		switch dep.GroupID {
 		case "org.apache.camel":
-			//
-			// Remove the version so we force using the one configured by the bom
-			//
-			ctx.Maven.Project.Dependencies[i].Version = ""
+			fallthrough
 		case "org.apache.camel.k":
+			fallthrough
+		case "org.apache.camel.quarkus":
 			//
 			// Remove the version so we force using the one configured by the bom
 			//


[camel-k] 24/38: feat(quarkus): Support generating Camel Quarkus catalog on the flight

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 86df7cf10e3903110f8ae62eb424a90f3a9dcb38
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Fri Oct 25 12:17:41 2019 +0200

    feat(quarkus): Support generating Camel Quarkus catalog on the flight
---
 pkg/trait/quarkus.go      | 50 +++++++++++++++++++++++++++++++++++----
 pkg/util/camel/catalog.go | 60 +++++++++++++++++++++++++++++------------------
 2 files changed, 82 insertions(+), 28 deletions(-)

diff --git a/pkg/trait/quarkus.go b/pkg/trait/quarkus.go
index 9dfe8ba..208a551 100644
--- a/pkg/trait/quarkus.go
+++ b/pkg/trait/quarkus.go
@@ -23,6 +23,8 @@ import (
 
 	"github.com/pkg/errors"
 
+	k8serrors "k8s.io/apimachinery/pkg/api/errors"
+
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/builder/runtime"
 	"github.com/apache/camel-k/pkg/metadata"
@@ -30,6 +32,7 @@ import (
 	"github.com/apache/camel-k/pkg/util/camel"
 	"github.com/apache/camel-k/pkg/util/defaults"
 	"github.com/apache/camel-k/pkg/util/envvar"
+	"github.com/apache/camel-k/pkg/util/maven"
 )
 
 type quarkusTrait struct {
@@ -62,17 +65,54 @@ func (t *quarkusTrait) loadOrCreateCatalog(e *Environment, camelVersion string,
 		return errors.New("unable to determine namespace")
 	}
 
-	c, err := camel.LoadCatalog(e.C, e.Client, ns, camelVersion, runtimeVersion, v1alpha1.QuarkusRuntimeProvider{
-		CamelQuarkusVersion: t.determineCamelQuarkusVersion(e),
-		QuarkusVersion:      t.determineQuarkusVersion(e),
+	camelQuarkusVersion := t.determineCamelQuarkusVersion(e)
+	quarkusVersion := t.determineQuarkusVersion(e)
+
+	catalog, err := camel.LoadCatalog(e.C, e.Client, ns, camelVersion, runtimeVersion, v1alpha1.QuarkusRuntimeProvider{
+		CamelQuarkusVersion: camelQuarkusVersion,
+		QuarkusVersion:      quarkusVersion,
 	})
 	if err != nil {
 		return err
 	}
 
-	e.CamelCatalog = c
+	if catalog == nil {
+		// if the catalog is not found in the cluster, try to create it if
+		// the required versions (camel, runtime and provider) are not expressed as
+		// semver constraints
+		if exactVersionRegexp.MatchString(camelVersion) && exactVersionRegexp.MatchString(runtimeVersion) &&
+			exactVersionRegexp.MatchString(camelQuarkusVersion) && exactVersionRegexp.MatchString(quarkusVersion) {
+			catalog, err = camel.GenerateCatalogWithProvider(e.C, e.Client, ns, e.Platform.Spec.Build.Maven, camelVersion, runtimeVersion,
+				"quarkus",
+				&maven.Dependency{
+					GroupID:    "org.apache.camel.quarkus",
+					ArtifactID: "camel-catalog-quarkus",
+					Version:    camelQuarkusVersion,
+				})
+			if err != nil {
+				return err
+			}
+
+			// sanitize catalog name
+			catalogName := "camel-catalog-quarkus" + strings.ToLower(camelVersion+"-"+runtimeVersion)
+
+			cx := v1alpha1.NewCamelCatalogWithSpecs(ns, catalogName, catalog.CamelCatalogSpec)
+			cx.Labels = make(map[string]string)
+			cx.Labels["app"] = "camel-k"
+			cx.Labels["camel.apache.org/catalog.version"] = camelVersion
+			cx.Labels["camel.apache.org/catalog.loader.version"] = camelVersion
+			cx.Labels["camel.apache.org/runtime.version"] = runtimeVersion
+			cx.Labels["camel.apache.org/runtime.provider"] = "quarkus"
+			cx.Labels["camel.apache.org/catalog.generated"] = True
+
+			err = e.Client.Create(e.C, &cx)
+			if err != nil && !k8serrors.IsAlreadyExists(err) {
+				return err
+			}
+		}
+	}
 
-	// TODO: generate a catalog if nil
+	e.CamelCatalog = catalog
 
 	return nil
 }
diff --git a/pkg/util/camel/catalog.go b/pkg/util/camel/catalog.go
index 4505334..b83eebc 100644
--- a/pkg/util/camel/catalog.go
+++ b/pkg/util/camel/catalog.go
@@ -67,7 +67,14 @@ func catalogForRuntimeProvider(provider interface{}) (*RuntimeCatalog, error) {
 }
 
 // GenerateCatalog --
-func GenerateCatalog(ctx context.Context, client k8sclient.Reader, namespace string, mvn v1alpha1.MavenSpec, camelVersion string, runtimeVersion string) (*RuntimeCatalog, error) {
+func GenerateCatalog(ctx context.Context, client k8sclient.Reader, namespace string, mvn v1alpha1.MavenSpec,
+	camelVersion string, runtimeVersion string) (*RuntimeCatalog, error) {
+	return GenerateCatalogWithProvider(ctx, client, namespace, mvn, camelVersion, runtimeVersion, "", nil)
+}
+
+// GenerateCatalogWithProvider --
+func GenerateCatalogWithProvider(ctx context.Context, client k8sclient.Reader, namespace string, mvn v1alpha1.MavenSpec,
+	camelVersion string, runtimeVersion string, providerName string, providerDependency *maven.Dependency) (*RuntimeCatalog, error) {
 	root := os.TempDir()
 	tmpDir, err := ioutil.TempDir(root, "camel-catalog")
 	if err != nil {
@@ -80,13 +87,16 @@ func GenerateCatalog(ctx context.Context, client k8sclient.Reader, namespace str
 		return nil, err
 	}
 
-	project := generateMavenProject(camelVersion, runtimeVersion)
+	project := generateMavenProject(camelVersion, runtimeVersion, providerDependency)
 
 	mc := maven.NewContext(tmpDir, project)
 	mc.LocalRepository = mvn.LocalRepository
 	mc.Timeout = mvn.Timeout.Duration
 	mc.AddSystemProperty("catalog.path", tmpDir)
 	mc.AddSystemProperty("catalog.file", "catalog.yaml")
+	if providerName != "" {
+		mc.AddSystemProperty("catalog.runtime", providerName)
+	}
 
 	settings, err := kubernetes.ResolveValueSource(ctx, client, namespace, &mvn.Settings)
 	if err != nil {
@@ -114,33 +124,37 @@ func GenerateCatalog(ctx context.Context, client k8sclient.Reader, namespace str
 	return NewRuntimeCatalog(catalog.Spec), nil
 }
 
-func generateMavenProject(camelVersion string, runtimeVersion string) maven.Project {
+func generateMavenProject(camelVersion string, runtimeVersion string, providerDependency *maven.Dependency) maven.Project {
 	p := maven.NewProjectWithGAV("org.apache.camel.k.integration", "camel-k-catalog-generator", defaults.Version)
 
-	p.Build = &maven.Build{
-		DefaultGoal: "generate-resources",
-		Plugins: []maven.Plugin{
+	plugin := maven.Plugin{
+		GroupID:    "org.apache.camel.k",
+		ArtifactID: "camel-k-maven-plugin",
+		Version:    runtimeVersion,
+		Executions: []maven.Execution{
 			{
-				GroupID:    "org.apache.camel.k",
-				ArtifactID: "camel-k-maven-plugin",
-				Version:    runtimeVersion,
-				Executions: []maven.Execution{
-					{
-						ID: "generate-catalog",
-						Goals: []string{
-							"generate-catalog",
-						},
-					},
-				},
-				Dependencies: []maven.Dependency{
-					{
-						GroupID:    "org.apache.camel",
-						ArtifactID: "camel-catalog",
-						Version:    camelVersion,
-					},
+				ID: "generate-catalog",
+				Goals: []string{
+					"generate-catalog",
 				},
 			},
 		},
+		Dependencies: []maven.Dependency{
+			{
+				GroupID:    "org.apache.camel",
+				ArtifactID: "camel-catalog",
+				Version:    camelVersion,
+			},
+		},
+	}
+
+	if providerDependency != nil {
+		plugin.Dependencies = append(plugin.Dependencies, *providerDependency)
+	}
+
+	p.Build = &maven.Build{
+		DefaultGoal: "generate-resources",
+		Plugins:     []maven.Plugin{plugin},
 	}
 
 	return p


[camel-k] 33/38: fix(quarkus): Let Camel Quarkus drive the Camel version for catalog generation

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit b1fd43bde41b7b2f1bcf6d5b830dcc8970928080
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Oct 30 11:24:38 2019 +0100

    fix(quarkus): Let Camel Quarkus drive the Camel version for catalog generation
---
 build/maven/pom-catalog.xml | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/build/maven/pom-catalog.xml b/build/maven/pom-catalog.xml
index 2a212f4..c8a7d86 100644
--- a/build/maven/pom-catalog.xml
+++ b/build/maven/pom-catalog.xml
@@ -76,17 +76,13 @@
                             </execution>
                         </executions>
                         <dependencies>
-                            <dependency>
-                                <groupId>org.apache.camel</groupId>
-                                <artifactId>camel-catalog</artifactId>
-                                <version>${camel.version}</version>
-                            </dependency>
+                            <!-- The Camel dependency version is driven by Camel Quarkus -->
                             <dependency>
                                 <groupId>org.apache.camel.quarkus</groupId>
                                 <artifactId>camel-catalog-quarkus</artifactId>
                                 <version>${camel-quarkus.version}</version>
                             </dependency>
-                            <!-- This is required to retrieve the Quarkus version -->
+                            <!-- This is required to retrieve the Quarkus dependency version -->
                             <dependency>
                                 <groupId>org.apache.camel.quarkus</groupId>
                                 <artifactId>camel-quarkus-core</artifactId>


[camel-k] 17/38: fix(build): Set build with Camel catalog runtime version for exact matching

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit dcfb8a36795998b83f25057666ab278d9efadc48
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Thu Oct 24 12:17:52 2019 +0200

    fix(build): Set build with Camel catalog runtime version for exact matching
---
 pkg/controller/integrationkit/build.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/controller/integrationkit/build.go b/pkg/controller/integrationkit/build.go
index cbc1471..a7f2319 100644
--- a/pkg/controller/integrationkit/build.go
+++ b/pkg/controller/integrationkit/build.go
@@ -94,7 +94,7 @@ func (action *buildAction) handleBuildSubmitted(ctx context.Context, kit *v1alph
 			Spec: v1alpha1.BuildSpec{
 				Meta:            kit.ObjectMeta,
 				CamelVersion:    env.CamelCatalog.Version,
-				RuntimeVersion:  env.RuntimeVersion,
+				RuntimeVersion:  env.CamelCatalog.RuntimeVersion,
 				RuntimeProvider: env.CamelCatalog.RuntimeProvider,
 				Platform:        env.Platform.Spec,
 				Dependencies:    kit.Spec.Dependencies,


[camel-k] 28/38: feat(quarkus): Filter kits based on integration or catalog runtime provider info

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 042310641db2d1f93b97ad3cffc0a291986db986
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Mon Oct 28 12:24:17 2019 +0100

    feat(quarkus): Filter kits based on integration or catalog runtime provider info
---
 pkg/builder/builder_steps.go       | 13 ++++++++++-
 pkg/controller/integration/util.go | 46 +++++++++++++++++++++++---------------
 2 files changed, 40 insertions(+), 19 deletions(-)

diff --git a/pkg/builder/builder_steps.go b/pkg/builder/builder_steps.go
index 23d15be..3e08e79 100644
--- a/pkg/builder/builder_steps.go
+++ b/pkg/builder/builder_steps.go
@@ -349,10 +349,21 @@ func listPublishedImages(context *Context) ([]publishedImage, error) {
 		if kit.Status.RuntimeVersion != context.Catalog.RuntimeVersion {
 			continue
 		}
+
+		// TODO: should ideally be made generic
+		if kit.Status.RuntimeProvider == nil && context.Catalog.RuntimeProvider != nil ||
+			kit.Status.RuntimeProvider != nil && context.Catalog.RuntimeProvider == nil ||
+			kit.Status.RuntimeProvider != nil && context.Catalog.RuntimeProvider != nil &&
+				(kit.Status.RuntimeProvider.Quarkus != nil && context.Catalog.RuntimeProvider.Quarkus == nil ||
+					kit.Status.RuntimeProvider.Quarkus == nil && context.Catalog.RuntimeProvider.Quarkus != nil ||
+					*kit.Status.RuntimeProvider.Quarkus != *context.Catalog.RuntimeProvider.Quarkus) {
+			continue
+		}
+
 		if kit.Status.Phase != v1alpha1.IntegrationKitPhaseReady || kit.Labels == nil {
 			continue
 		}
-		if ctxType, present := kit.Labels["camel.apache.org/kit.type"]; !present || ctxType != v1alpha1.IntegrationKitTypePlatform {
+		if kitType, present := kit.Labels["camel.apache.org/kit.type"]; !present || kitType != v1alpha1.IntegrationKitTypePlatform {
 			continue
 		}
 
diff --git a/pkg/controller/integration/util.go b/pkg/controller/integration/util.go
index b3d61c4..39e3495 100644
--- a/pkg/controller/integration/util.go
+++ b/pkg/controller/integration/util.go
@@ -20,10 +20,10 @@ package integration
 import (
 	"context"
 
-	k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
-
 	"github.com/pkg/errors"
 
+	k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
+
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/util"
 	"github.com/apache/camel-k/pkg/util/kubernetes"
@@ -45,30 +45,40 @@ func LookupKitForIntegration(ctx context.Context, c k8sclient.Reader, integratio
 		return kit, nil
 	}
 
-	ctxList := v1alpha1.NewIntegrationKitList()
-	if err := c.List(ctx, &ctxList, k8sclient.InNamespace(integration.Namespace)); err != nil {
+	kits := v1alpha1.NewIntegrationKitList()
+	if err := c.List(ctx, &kits, k8sclient.InNamespace(integration.Namespace)); err != nil {
 		return nil, err
 	}
 
-	for _, ctx := range ctxList.Items {
-		ctx := ctx // pin
+	for _, kit := range kits.Items {
+		kit := kit // pin
 
-		if ctx.Status.Phase == v1alpha1.IntegrationKitPhaseError {
+		if kit.Status.Phase == v1alpha1.IntegrationKitPhaseError {
 			continue
 		}
-		if ctx.Status.CamelVersion != integration.Status.CamelVersion {
+		if kit.Status.CamelVersion != integration.Status.CamelVersion {
 			continue
 		}
-		if ctx.Status.RuntimeVersion != integration.Status.RuntimeVersion {
+		if kit.Status.RuntimeVersion != integration.Status.RuntimeVersion {
 			continue
 		}
-		if ctx.Status.Version != integration.Status.Version {
+		if kit.Status.Version != integration.Status.Version {
+			continue
+		}
+
+		// TODO: should ideally be made generic
+		if integration.Status.RuntimeProvider == nil && kit.Status.RuntimeProvider != nil ||
+			integration.Status.RuntimeProvider != nil && kit.Status.RuntimeProvider == nil ||
+			integration.Status.RuntimeProvider != nil && kit.Status.RuntimeProvider != nil &&
+				(integration.Status.RuntimeProvider.Quarkus != nil && kit.Status.RuntimeProvider.Quarkus == nil ||
+					integration.Status.RuntimeProvider.Quarkus == nil && kit.Status.RuntimeProvider.Quarkus != nil ||
+					*integration.Status.RuntimeProvider.Quarkus != *kit.Status.RuntimeProvider.Quarkus) {
 			continue
 		}
 
-		if allowed, ok := allowedLookupLabels[ctx.Labels["camel.apache.org/kit.type"]]; ok && allowed {
+		if allowed, ok := allowedLookupLabels[kit.Labels["camel.apache.org/kit.type"]]; ok && allowed {
 			ideps := len(integration.Status.Dependencies)
-			cdeps := len(ctx.Spec.Dependencies)
+			cdeps := len(kit.Spec.Dependencies)
 
 			if ideps != cdeps {
 				continue
@@ -86,12 +96,12 @@ func LookupKitForIntegration(ctx context.Context, c k8sclient.Reader, integratio
 			// A kit can be used only if it contains a subset of the traits and related configurations
 			// declared on integration.
 			//
-			if !HasMatchingTraits(&ctx, integration) {
+			if !HasMatchingTraits(&kit, integration) {
 				continue
 			}
 
-			if util.StringSliceContains(ctx.Spec.Dependencies, integration.Status.Dependencies) {
-				return &ctx, nil
+			if util.StringSliceContains(kit.Spec.Dependencies, integration.Status.Dependencies) {
+				return &kit, nil
 			}
 		}
 	}
@@ -101,14 +111,14 @@ func LookupKitForIntegration(ctx context.Context, c k8sclient.Reader, integratio
 
 // HasMatchingTraits compare traits defined on kit against those defined on integration.
 func HasMatchingTraits(kit *v1alpha1.IntegrationKit, integration *v1alpha1.Integration) bool {
-	for ctxTraitName, ctxTraitConf := range kit.Spec.Traits {
-		iTraitConf, ok := integration.Spec.Traits[ctxTraitName]
+	for kitTraitName, kitTraitConf := range kit.Spec.Traits {
+		iTraitConf, ok := integration.Spec.Traits[kitTraitName]
 		if !ok {
 			// skip it because trait configured on kit is not defined on integration.
 			return false
 		}
 
-		for ck, cv := range ctxTraitConf.Configuration {
+		for ck, cv := range kitTraitConf.Configuration {
 			iv, ok := iTraitConf.Configuration[ck]
 
 			if !ok {


[camel-k] 10/38: feat(quarkus): Only load catalogs matching the specified runtime provider

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit bf77dc8b8c31aa4804831e62647848d9f58a2e3d
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Oct 23 12:06:25 2019 +0200

    feat(quarkus): Only load catalogs matching the specified runtime provider
---
 pkg/trait/gc.go                 | 11 ++---------
 pkg/util/camel/camel_runtime.go | 10 +++++++++-
 pkg/util/controller/util.go     | 31 +++++++++++++++++++++++++++++++
 3 files changed, 42 insertions(+), 10 deletions(-)

diff --git a/pkg/trait/gc.go b/pkg/trait/gc.go
index 07deb52..3d60852 100644
--- a/pkg/trait/gc.go
+++ b/pkg/trait/gc.go
@@ -33,6 +33,7 @@ import (
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/client"
 	"github.com/apache/camel-k/pkg/util"
+	controllerUtil "github.com/apache/camel-k/pkg/util/controller"
 )
 
 type garbageCollectorTrait struct {
@@ -153,7 +154,7 @@ func lookUpResources(ctx context.Context, client client.Client, namespace string
 		}
 		options := []controller.ListOption{
 			controller.InNamespace(namespace),
-			matchingSelector{selector: selector},
+			controllerUtil.MatchingSelector{Selector: selector},
 		}
 		if err := client.List(ctx, &list, options...); err != nil {
 			if k8serrors.IsNotFound(err) || k8serrors.IsForbidden(err) {
@@ -192,11 +193,3 @@ func getDiscoveryTypesWithVerbs(client client.Client, verbs []string) ([]metav1.
 
 	return types, nil
 }
-
-type matchingSelector struct {
-	selector labels.Selector
-}
-
-func (s matchingSelector) ApplyToList(opts *controller.ListOptions) {
-	opts.LabelSelector = s.selector
-}
diff --git a/pkg/util/camel/camel_runtime.go b/pkg/util/camel/camel_runtime.go
index 331d648..b62b967 100644
--- a/pkg/util/camel/camel_runtime.go
+++ b/pkg/util/camel/camel_runtime.go
@@ -21,10 +21,14 @@ import (
 	"context"
 	"fmt"
 
+	"k8s.io/apimachinery/pkg/labels"
+	"k8s.io/apimachinery/pkg/selection"
+
 	k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/client"
+	controllerUtil "github.com/apache/camel-k/pkg/util/controller"
 )
 
 // LoadCatalog --
@@ -33,7 +37,11 @@ func LoadCatalog(ctx context.Context, client client.Client, namespace string, ca
 		k8sclient.InNamespace(namespace),
 	}
 
-	if _, ok := provider.(v1alpha1.QuarkusRuntimeProvider); ok {
+	if provider == nil {
+		integration, _ := labels.NewRequirement("camel.apache.org/runtime.provider", selection.DoesNotExist, []string{})
+		selector := labels.NewSelector().Add(*integration)
+		options = append(options, controllerUtil.MatchingSelector{Selector: selector})
+	} else if _, ok := provider.(v1alpha1.QuarkusRuntimeProvider); ok {
 		options = append(options, k8sclient.MatchingLabels{
 			"camel.apache.org/runtime.provider": "quarkus",
 		})
diff --git a/pkg/util/controller/util.go b/pkg/util/controller/util.go
new file mode 100644
index 0000000..007abf6
--- /dev/null
+++ b/pkg/util/controller/util.go
@@ -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 controller
+
+import (
+	"k8s.io/apimachinery/pkg/labels"
+	"sigs.k8s.io/controller-runtime/pkg/client"
+)
+
+type MatchingSelector struct {
+	Selector labels.Selector
+}
+
+func (s MatchingSelector) ApplyToList(opts *client.ListOptions) {
+	opts.LabelSelector = s.Selector
+}


[camel-k] 15/38: feat(quarkus): Use the camel-quarkus protocol for language dependencies

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 768b56dadbc12c1b7f7eabcec2a5e1e249946df4
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Oct 23 16:25:51 2019 +0200

    feat(quarkus): Use the camel-quarkus protocol for language dependencies
---
 pkg/util/camel/camel_runtime_catalog.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pkg/util/camel/camel_runtime_catalog.go b/pkg/util/camel/camel_runtime_catalog.go
index da0ee4d..a69386e 100644
--- a/pkg/util/camel/camel_runtime_catalog.go
+++ b/pkg/util/camel/camel_runtime_catalog.go
@@ -40,7 +40,11 @@ func NewRuntimeCatalog(spec v1alpha1.CamelCatalogSpec) *RuntimeCatalog {
 		for _, language := range artifact.Languages {
 			// Skip languages in common dependencies since they are always available to integrations
 			if artifact.ArtifactID != "camel-base" {
-				catalog.languageDependencies[language] = strings.Replace(artifact.ArtifactID, "camel-", "camel:", 1)
+				if catalog.RuntimeProvider != nil && catalog.RuntimeProvider.Quarkus != nil {
+					catalog.languageDependencies[language] = strings.Replace(artifact.ArtifactID, "camel-quarkus-", "camel-quarkus:", 1)
+				} else {
+					catalog.languageDependencies[language] = strings.Replace(artifact.ArtifactID, "camel-", "camel:", 1)
+				}
 			}
 		}
 	}


[camel-k] 13/38: feat(quarkus): Start shaping a runtime trait interface

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit d9380d0a65b534542b2dc2d0bb942b0bcffb3157
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Oct 23 12:42:01 2019 +0200

    feat(quarkus): Start shaping a runtime trait interface
---
 pkg/trait/camel.go        | 40 ++++++++++++++++++++++------------------
 pkg/trait/dependencies.go | 16 ++++++++++------
 pkg/trait/quarkus.go      | 15 +++++++++------
 3 files changed, 41 insertions(+), 30 deletions(-)

diff --git a/pkg/trait/camel.go b/pkg/trait/camel.go
index c7c8a61..66f7024 100644
--- a/pkg/trait/camel.go
+++ b/pkg/trait/camel.go
@@ -70,21 +70,22 @@ func (t *camelTrait) Apply(e *Environment) error {
 	}
 
 	if e.CamelCatalog == nil {
-		var catalog *camel.RuntimeCatalog
-		var err error
 		quarkus := e.Catalog.GetTrait("quarkus").(*quarkusTrait)
 		if quarkus.isEnabled() {
-			catalog, err = quarkus.loadOrCreateCatalog(e, cv, rv)
+			err := quarkus.loadOrCreateCatalog(e, cv, rv)
+			if err != nil {
+				return err
+			}
 		} else {
-			catalog, err = t.loadOrCreateCatalog(e, cv, rv)
-		}
-		if err != nil {
-			return err
-		} else if catalog == nil {
-			return fmt.Errorf("unable to find catalog for: %s", cv)
+			err := t.loadOrCreateCatalog(e, cv, rv)
+			if err != nil {
+				return err
+			}
 		}
+	}
 
-		e.CamelCatalog = catalog
+	if e.CamelCatalog == nil {
+		return fmt.Errorf("unable to find catalog for: %s", cv)
 	}
 
 	e.RuntimeVersion = rv
@@ -103,15 +104,15 @@ func (t *camelTrait) Apply(e *Environment) error {
 	return nil
 }
 
-func (t *camelTrait) loadOrCreateCatalog(e *Environment, camelVersion string, runtimeVersion string) (*camel.RuntimeCatalog, error) {
+func (t *camelTrait) loadOrCreateCatalog(e *Environment, camelVersion string, runtimeVersion string) error {
 	ns := e.DetermineNamespace()
 	if ns == "" {
-		return nil, errors.New("unable to determine namespace")
+		return errors.New("unable to determine namespace")
 	}
 
 	c, err := camel.LoadCatalog(e.C, e.Client, ns, camelVersion, runtimeVersion, nil)
 	if err != nil {
-		return nil, err
+		return err
 	}
 
 	if c == nil {
@@ -120,17 +121,17 @@ func (t *camelTrait) loadOrCreateCatalog(e *Environment, camelVersion string, ru
 		// semver constraints
 		cvHasFixedVersion, err := regexp.MatchString(`^(\d+)\.(\d+)\.([\w-\.]+)$`, camelVersion)
 		if err != nil {
-			return nil, err
+			return err
 		}
 		rvHasFixedVersion, err := regexp.MatchString(`^(\d+)\.(\d+)\.([\w-\.]+)$`, runtimeVersion)
 		if err != nil {
-			return nil, err
+			return err
 		}
 
 		if cvHasFixedVersion && rvHasFixedVersion {
 			c, err = t.generateCatalog(e, camelVersion, runtimeVersion)
 			if err != nil {
-				return nil, err
+				return err
 			}
 
 			// sanitize catalog name
@@ -146,11 +147,14 @@ func (t *camelTrait) loadOrCreateCatalog(e *Environment, camelVersion string, ru
 
 			err = e.Client.Create(e.C, &cx)
 			if err != nil && !k8serrors.IsAlreadyExists(err) {
-				return nil, err
+				return err
 			}
 		}
 	}
-	return c, nil
+
+	e.CamelCatalog = c
+
+	return nil
 }
 
 func (t *camelTrait) generateCatalog(e *Environment, camelVersion string, runtimeVersion string) (*camel.RuntimeCatalog, error) {
diff --git a/pkg/trait/dependencies.go b/pkg/trait/dependencies.go
index 69fb824..d143fac 100644
--- a/pkg/trait/dependencies.go
+++ b/pkg/trait/dependencies.go
@@ -45,30 +45,34 @@ func (t *dependenciesTrait) Configure(e *Environment) (bool, error) {
 }
 
 func (t *dependenciesTrait) Apply(e *Environment) error {
-	dependencies := make([]string, 0)
 	if e.Integration.Spec.Dependencies != nil {
+		dependencies := make([]string, 0)
 		for _, dep := range e.Integration.Spec.Dependencies {
 			util.StringSliceUniqueAdd(&dependencies, dep)
+			e.Integration.Status.Dependencies = dependencies
 		}
+	} else {
+		e.Integration.Status.Dependencies = make([]string, 0)
 	}
 
 	quarkus := e.Catalog.GetTrait("quarkus").(*quarkusTrait)
 	if quarkus.isEnabled() {
-		err := quarkus.addRuntimeDependencies(e, &dependencies)
+		err := quarkus.addRuntimeDependencies(e)
 		if err != nil {
 			return err
 		}
 	} else {
-		addDefaultRuntimeDependencies(e, &dependencies)
+		addDefaultRuntimeDependencies(e)
 	}
 
 	// sort the dependencies to get always the same list if they don't change
-	sort.Strings(dependencies)
-	e.Integration.Status.Dependencies = dependencies
+	sort.Strings(e.Integration.Status.Dependencies)
 	return nil
 }
 
-func addDefaultRuntimeDependencies(e *Environment, dependencies *[]string) {
+func addDefaultRuntimeDependencies(e *Environment) {
+	dependencies := &e.Integration.Status.Dependencies
+
 	for _, s := range e.Integration.Sources() {
 		meta := metadata.Extract(e.CamelCatalog, s)
 
diff --git a/pkg/trait/quarkus.go b/pkg/trait/quarkus.go
index 37085ed..5139ce7 100644
--- a/pkg/trait/quarkus.go
+++ b/pkg/trait/quarkus.go
@@ -54,10 +54,10 @@ func (t *quarkusTrait) Apply(e *Environment) error {
 	return nil
 }
 
-func (t *quarkusTrait) loadOrCreateCatalog(e *Environment, camelVersion string, runtimeVersion string) (*camel.RuntimeCatalog, error) {
+func (t *quarkusTrait) loadOrCreateCatalog(e *Environment, camelVersion string, runtimeVersion string) error {
 	ns := e.DetermineNamespace()
 	if ns == "" {
-		return nil, errors.New("unable to determine namespace")
+		return errors.New("unable to determine namespace")
 	}
 
 	c, err := camel.LoadCatalog(e.C, e.Client, ns, camelVersion, runtimeVersion, v1alpha1.QuarkusRuntimeProvider{
@@ -66,12 +66,14 @@ func (t *quarkusTrait) loadOrCreateCatalog(e *Environment, camelVersion string,
 		QuarkusVersion:      "0.21.2",
 	})
 	if err != nil {
-		return nil, err
+		return err
 	}
 
+	e.CamelCatalog = c
+
 	// TODO: generate a catalog if nil
 
-	return c, nil
+	return nil
 }
 
 func (t *quarkusTrait) addBuildSteps(e *Environment) {
@@ -82,7 +84,9 @@ func (t *quarkusTrait) addClasspath(e *Environment) {
 	// No-op as we rely on the Quarkus runner
 }
 
-func (t *quarkusTrait) addRuntimeDependencies(e *Environment, dependencies *[]string) error {
+func (t *quarkusTrait) addRuntimeDependencies(e *Environment) error {
+	dependencies := &e.Integration.Status.Dependencies
+
 	for _, s := range e.Integration.Sources() {
 		meta := metadata.Extract(e.CamelCatalog, s)
 
@@ -102,7 +106,6 @@ func (t *quarkusTrait) addRuntimeDependencies(e *Environment, dependencies *[]st
 			addRuntimeDependency("camel-k-quarkus-knative", dependencies)
 		}
 
-		// main required by default
 		addRuntimeDependency("camel-k-runtime-quarkus", dependencies)
 
 		for _, d := range meta.Dependencies.List() {


[camel-k] 18/38: feat(quarkus): Add Camel Quarkus and Quarkus versions trait configuration options

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 081e3e6a6f4fae6aafe0b324fdb1f6c8a78c5c42
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Thu Oct 24 12:20:16 2019 +0200

    feat(quarkus): Add Camel Quarkus and Quarkus versions trait configuration options
---
 pkg/trait/camel.go       | 37 +++++++++++++++++++++++++++---------
 pkg/trait/quarkus.go     | 49 ++++++++++++++++++++++++++++++++++++++++++++----
 pkg/trait/trait_types.go | 34 ---------------------------------
 3 files changed, 73 insertions(+), 47 deletions(-)

diff --git a/pkg/trait/camel.go b/pkg/trait/camel.go
index 66f7024..3cd0bd9 100644
--- a/pkg/trait/camel.go
+++ b/pkg/trait/camel.go
@@ -59,15 +59,8 @@ func (t *camelTrait) Configure(e *Environment) (bool, error) {
 }
 
 func (t *camelTrait) Apply(e *Environment) error {
-	cv := e.DetermineCamelVersion()
-	rv := e.DetermineRuntimeVersion()
-
-	if t.Version != "" {
-		cv = t.Version
-	}
-	if t.RuntimeVersion != "" {
-		rv = t.RuntimeVersion
-	}
+	cv := t.determineCamelVersion(e)
+	rv := t.determineRuntimeVersion(e)
 
 	if e.CamelCatalog == nil {
 		quarkus := e.Catalog.GetTrait("quarkus").(*quarkusTrait)
@@ -240,3 +233,29 @@ func (t *camelTrait) generateMavenProject(camelVersion string, runtimeVersion st
 
 	return p
 }
+
+func (t *camelTrait) determineCamelVersion(e *Environment) string {
+	if t.Version != "" {
+		return t.Version
+	}
+	if e.Integration != nil && e.Integration.Status.CamelVersion != "" {
+		return e.Integration.Status.CamelVersion
+	}
+	if e.IntegrationKit != nil && e.IntegrationKit.Status.CamelVersion != "" {
+		return e.IntegrationKit.Status.CamelVersion
+	}
+	return e.Platform.Spec.Build.CamelVersion
+}
+
+func (t *camelTrait) determineRuntimeVersion(e *Environment) string {
+	if t.RuntimeVersion != "" {
+		return t.RuntimeVersion
+	}
+	if e.Integration != nil && e.Integration.Status.RuntimeVersion != "" {
+		return e.Integration.Status.RuntimeVersion
+	}
+	if e.IntegrationKit != nil && e.IntegrationKit.Status.RuntimeVersion != "" {
+		return e.IntegrationKit.Status.RuntimeVersion
+	}
+	return e.Platform.Spec.Build.RuntimeVersion
+}
diff --git a/pkg/trait/quarkus.go b/pkg/trait/quarkus.go
index 5139ce7..7a9ab4d 100644
--- a/pkg/trait/quarkus.go
+++ b/pkg/trait/quarkus.go
@@ -33,7 +33,9 @@ import (
 )
 
 type quarkusTrait struct {
-	BaseTrait `property:",squash"`
+	BaseTrait           `property:",squash"`
+	QuarkusVersion      string `property:"quarkus-version"`
+	CamelQuarkusVersion string `property:"camel-quarkus-version"`
 }
 
 func newQuarkusTrait() *quarkusTrait {
@@ -61,9 +63,8 @@ func (t *quarkusTrait) loadOrCreateCatalog(e *Environment, camelVersion string,
 	}
 
 	c, err := camel.LoadCatalog(e.C, e.Client, ns, camelVersion, runtimeVersion, v1alpha1.QuarkusRuntimeProvider{
-		// FIXME
-		CamelQuarkusVersion: "0.2.0",
-		QuarkusVersion:      "0.21.2",
+		CamelQuarkusVersion: t.determineCamelQuarkusVersion(e),
+		QuarkusVersion:      t.determineQuarkusVersion(e),
 	})
 	if err != nil {
 		return err
@@ -122,3 +123,43 @@ func (t *quarkusTrait) addContainerEnvironment(e *Environment) {
 func addRuntimeDependency(dependency string, dependencies *[]string) {
 	util.StringSliceUniqueAdd(dependencies, fmt.Sprintf("mvn:org.apache.camel.k/%s", dependency))
 }
+
+func (t *quarkusTrait) determineQuarkusVersion(e *Environment) string {
+	if t.QuarkusVersion != "" {
+		return t.QuarkusVersion
+	}
+	if e.Integration != nil && e.Integration.Status.RuntimeProvider != nil && e.Integration.Status.RuntimeProvider.Quarkus != nil &&
+		e.Integration.Status.RuntimeProvider.Quarkus.QuarkusVersion != "" {
+		return e.Integration.Status.RuntimeProvider.Quarkus.QuarkusVersion
+	}
+	if e.IntegrationKit != nil && e.IntegrationKit.Status.RuntimeProvider != nil && e.IntegrationKit.Status.RuntimeProvider.Quarkus != nil &&
+		e.IntegrationKit.Status.RuntimeProvider.Quarkus.QuarkusVersion != "" {
+		return e.IntegrationKit.Status.RuntimeProvider.Quarkus.QuarkusVersion
+	}
+	if e.Platform.Spec.Build.RuntimeProvider != nil && e.Platform.Spec.Build.RuntimeProvider.Quarkus != nil &&
+		e.Platform.Spec.Build.RuntimeProvider.Quarkus.QuarkusVersion != "" {
+		return e.Platform.Spec.Build.RuntimeProvider.Quarkus.QuarkusVersion
+	}
+	// FIXME
+	return "0.21.2"
+}
+
+func (t *quarkusTrait) determineCamelQuarkusVersion(e *Environment) string {
+	if t.CamelQuarkusVersion != "" {
+		return t.CamelQuarkusVersion
+	}
+	if e.Integration != nil && e.Integration.Status.RuntimeProvider != nil && e.Integration.Status.RuntimeProvider.Quarkus != nil &&
+		e.Integration.Status.RuntimeProvider.Quarkus.CamelQuarkusVersion != "" {
+		return e.Integration.Status.RuntimeProvider.Quarkus.CamelQuarkusVersion
+	}
+	if e.IntegrationKit != nil && e.IntegrationKit.Status.RuntimeProvider != nil && e.IntegrationKit.Status.RuntimeProvider.Quarkus != nil &&
+		e.IntegrationKit.Status.RuntimeProvider.Quarkus.CamelQuarkusVersion != "" {
+		return e.IntegrationKit.Status.RuntimeProvider.Quarkus.CamelQuarkusVersion
+	}
+	if e.Platform.Spec.Build.RuntimeProvider != nil && e.Platform.Spec.Build.RuntimeProvider.Quarkus != nil &&
+		e.Platform.Spec.Build.RuntimeProvider.Quarkus.CamelQuarkusVersion != "" {
+		return e.Platform.Spec.Build.RuntimeProvider.Quarkus.CamelQuarkusVersion
+	}
+	// FIXME
+	return "0.2.0"
+}
diff --git a/pkg/trait/trait_types.go b/pkg/trait/trait_types.go
index f1cb187..622953e 100644
--- a/pkg/trait/trait_types.go
+++ b/pkg/trait/trait_types.go
@@ -225,40 +225,6 @@ func (e *Environment) DetermineControllerStrategy(ctx context.Context, c control
 	return ControllerStrategyKnativeService, nil
 }
 
-// DetermineCamelVersion --
-func (e *Environment) DetermineCamelVersion() string {
-	var version string
-
-	if e.Integration != nil {
-		version = e.Integration.Status.CamelVersion
-	}
-	if e.IntegrationKit != nil && version == "" {
-		version = e.IntegrationKit.Status.CamelVersion
-	}
-	if version == "" {
-		version = e.Platform.Spec.Build.CamelVersion
-	}
-
-	return version
-}
-
-// DetermineRuntimeVersion --
-func (e *Environment) DetermineRuntimeVersion() string {
-	var version string
-
-	if e.Integration != nil {
-		version = e.Integration.Status.RuntimeVersion
-	}
-	if e.IntegrationKit != nil && version == "" {
-		version = e.IntegrationKit.Status.RuntimeVersion
-	}
-	if version == "" {
-		version = e.Platform.Spec.Build.RuntimeVersion
-	}
-
-	return version
-}
-
 // DetermineNamespace --
 func (e *Environment) DetermineNamespace() string {
 	if e.Integration != nil && e.Integration.Namespace != "" {


[camel-k] 19/38: feat(quarkus): Rely on Build runtime properties to source dependencies versions

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 8e62c2584fbd97e0410862c9cc071e10c0516b6f
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Thu Oct 24 12:21:41 2019 +0200

    feat(quarkus): Rely on Build runtime properties to source dependencies versions
---
 pkg/builder/runtime/main.go      |  4 ++--
 pkg/builder/runtime/main_test.go |  4 ++++
 pkg/builder/runtime/quarkus.go   | 16 +++++++---------
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/pkg/builder/runtime/main.go b/pkg/builder/runtime/main.go
index 03fddda..e525cc7 100644
--- a/pkg/builder/runtime/main.go
+++ b/pkg/builder/runtime/main.go
@@ -60,14 +60,14 @@ func generateProject(ctx *builder.Context) error {
 	p.DependencyManagement.Dependencies = append(p.DependencyManagement.Dependencies, maven.Dependency{
 		GroupID:    "org.apache.camel",
 		ArtifactID: "camel-bom",
-		Version:    ctx.Catalog.Version,
+		Version:    ctx.Build.CamelVersion,
 		Type:       "pom",
 		Scope:      "import",
 	})
 	p.DependencyManagement.Dependencies = append(p.DependencyManagement.Dependencies, maven.Dependency{
 		GroupID:    "org.apache.camel.k",
 		ArtifactID: "camel-k-runtime-bom",
-		Version:    ctx.Catalog.RuntimeVersion,
+		Version:    ctx.Build.RuntimeVersion,
 		Type:       "pom",
 		Scope:      "import",
 	})
diff --git a/pkg/builder/runtime/main_test.go b/pkg/builder/runtime/main_test.go
index 89c3d56..cbddc8d 100644
--- a/pkg/builder/runtime/main_test.go
+++ b/pkg/builder/runtime/main_test.go
@@ -35,6 +35,7 @@ func TestNewProject(t *testing.T) {
 	ctx := builder.Context{
 		Catalog: catalog,
 		Build: v1alpha1.BuildSpec{
+			CamelVersion:   catalog.Version,
 			RuntimeVersion: catalog.RuntimeVersion,
 			Platform: v1alpha1.IntegrationPlatformSpec{
 				Build: v1alpha1.IntegrationPlatformBuildSpec{
@@ -97,6 +98,7 @@ func TestGenerateJvmProject(t *testing.T) {
 	ctx := builder.Context{
 		Catalog: catalog,
 		Build: v1alpha1.BuildSpec{
+			CamelVersion:   catalog.Version,
 			RuntimeVersion: catalog.RuntimeVersion,
 			Platform: v1alpha1.IntegrationPlatformSpec{
 				Build: v1alpha1.IntegrationPlatformBuildSpec{
@@ -154,6 +156,7 @@ func TestGenerateGroovyProject(t *testing.T) {
 	ctx := builder.Context{
 		Catalog: catalog,
 		Build: v1alpha1.BuildSpec{
+			CamelVersion:   catalog.Version,
 			RuntimeVersion: catalog.RuntimeVersion,
 			Platform: v1alpha1.IntegrationPlatformSpec{
 				Build: v1alpha1.IntegrationPlatformBuildSpec{
@@ -215,6 +218,7 @@ func TestSanitizeDependencies(t *testing.T) {
 	ctx := builder.Context{
 		Catalog: catalog,
 		Build: v1alpha1.BuildSpec{
+			CamelVersion:   catalog.Version,
 			RuntimeVersion: catalog.RuntimeVersion,
 			Platform: v1alpha1.IntegrationPlatformSpec{
 				Build: v1alpha1.IntegrationPlatformBuildSpec{
diff --git a/pkg/builder/runtime/quarkus.go b/pkg/builder/runtime/quarkus.go
index 243f871..f25a2ae 100644
--- a/pkg/builder/runtime/quarkus.go
+++ b/pkg/builder/runtime/quarkus.go
@@ -45,15 +45,14 @@ func generateQuarkusProject(ctx *builder.Context) error {
 		maven.Dependency{
 			GroupID:    "org.apache.camel.quarkus",
 			ArtifactID: "camel-quarkus-bom",
-			Version:    "0.2.0",
-			//Version:    ctx.Catalog.Version,
-			Type:  "pom",
-			Scope: "import",
+			Version:    ctx.Build.RuntimeProvider.Quarkus.CamelQuarkusVersion,
+			Type:       "pom",
+			Scope:      "import",
 		},
 		maven.Dependency{
 			GroupID:    "org.apache.camel.k",
 			ArtifactID: "camel-k-runtime-bom",
-			Version:    ctx.Catalog.RuntimeVersion,
+			Version:    ctx.Build.RuntimeVersion,
 			Type:       "pom",
 			Scope:      "import",
 		},
@@ -64,14 +63,12 @@ func generateQuarkusProject(ctx *builder.Context) error {
 		maven.Plugin{
 			GroupID:    "io.quarkus",
 			ArtifactID: "quarkus-bootstrap-maven-plugin",
-			// TODO: must be the same as the version required by camel-k-runtime
-			Version: "0.21.2",
+			Version:    ctx.Build.RuntimeProvider.Quarkus.QuarkusVersion,
 		},
 		maven.Plugin{
 			GroupID:    "io.quarkus",
 			ArtifactID: "quarkus-maven-plugin",
-			// TODO: must be the same as the version required by camel-k-runtime
-			Version: "0.21.2",
+			Version:    ctx.Build.RuntimeProvider.Quarkus.QuarkusVersion,
 			Executions: []maven.Execution{
 				{
 					Goals: []string{
@@ -104,6 +101,7 @@ func computeQuarkusDependencies(ctx *builder.Context) error {
 	mc.AdditionalArguments = nil
 	mc.AddArguments("quarkus-bootstrap:build-tree")
 	output := new(bytes.Buffer)
+	// TODO: improve logging while capturing output
 	mc.Stdout = output
 	if err := maven.Run(mc); err != nil {
 		return errors.Wrap(err, "failure while determining dependencies")


[camel-k] 25/38: chore(test): Remove redundant type conversions

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 35e53f3c9e2af3f9e3c62126fbb5bb1dd0ff08ef
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Fri Oct 25 15:12:35 2019 +0200

    chore(test): Remove redundant type conversions
---
 pkg/trait/builder_test.go         |  8 ++++----
 pkg/trait/container_test.go       |  8 ++++----
 pkg/trait/knative_service_test.go |  6 +++---
 pkg/trait/owner_test.go           |  2 +-
 pkg/trait/route_test.go           | 12 ++++++------
 pkg/trait/service_test.go         | 18 +++++++++---------
 pkg/trait/trait_test.go           | 40 +++++++++++++++++++--------------------
 7 files changed, 47 insertions(+), 47 deletions(-)

diff --git a/pkg/trait/builder_test.go b/pkg/trait/builder_test.go
index 651d522..9fa42bf 100644
--- a/pkg/trait/builder_test.go
+++ b/pkg/trait/builder_test.go
@@ -51,7 +51,7 @@ func TestBuilderTraitNotAppliedBecauseOfNilKit(t *testing.T) {
 
 			assert.Nil(t, err)
 			assert.NotEmpty(t, e.ExecutedTraits)
-			assert.Nil(t, e.GetTrait(ID("builder")))
+			assert.Nil(t, e.GetTrait("builder"))
 			assert.Empty(t, e.Steps)
 		})
 	}
@@ -72,7 +72,7 @@ func TestBuilderTraitNotAppliedBecauseOfNilPhase(t *testing.T) {
 
 			assert.Nil(t, err)
 			assert.NotEmpty(t, e.ExecutedTraits)
-			assert.Nil(t, e.GetTrait(ID("builder")))
+			assert.Nil(t, e.GetTrait("builder"))
 			assert.Empty(t, e.Steps)
 		})
 	}
@@ -84,7 +84,7 @@ func TestS2IBuilderTrait(t *testing.T) {
 
 	assert.Nil(t, err)
 	assert.NotEmpty(t, env.ExecutedTraits)
-	assert.NotNil(t, env.GetTrait(ID("builder")))
+	assert.NotNil(t, env.GetTrait("builder"))
 	assert.NotEmpty(t, env.Steps)
 	assert.Len(t, env.Steps, 8)
 	assert.Condition(t, func() bool {
@@ -104,7 +104,7 @@ func TestKanikoBuilderTrait(t *testing.T) {
 
 	assert.Nil(t, err)
 	assert.NotEmpty(t, env.ExecutedTraits)
-	assert.NotNil(t, env.GetTrait(ID("builder")))
+	assert.NotNil(t, env.GetTrait("builder"))
 	assert.NotEmpty(t, env.Steps)
 	assert.Len(t, env.Steps, 8)
 	assert.Condition(t, func() bool {
diff --git a/pkg/trait/container_test.go b/pkg/trait/container_test.go
index 10e8787..90b9613 100644
--- a/pkg/trait/container_test.go
+++ b/pkg/trait/container_test.go
@@ -77,8 +77,8 @@ func TestContainerWithDefaults(t *testing.T) {
 
 	assert.Nil(t, err)
 	assert.NotEmpty(t, environment.ExecutedTraits)
-	assert.NotNil(t, environment.GetTrait(ID("deployment")))
-	assert.NotNil(t, environment.GetTrait(ID("container")))
+	assert.NotNil(t, environment.GetTrait("deployment"))
+	assert.NotNil(t, environment.GetTrait("container"))
 
 	d := environment.Resources.GetDeploymentForIntegration(environment.Integration)
 
@@ -139,8 +139,8 @@ func TestContainerWithCustomName(t *testing.T) {
 
 	assert.Nil(t, err)
 	assert.NotEmpty(t, environment.ExecutedTraits)
-	assert.NotNil(t, environment.GetTrait(ID("deployment")))
-	assert.NotNil(t, environment.GetTrait(ID("container")))
+	assert.NotNil(t, environment.GetTrait("deployment"))
+	assert.NotNil(t, environment.GetTrait("container"))
 
 	d := environment.Resources.GetDeploymentForIntegration(environment.Integration)
 
diff --git a/pkg/trait/knative_service_test.go b/pkg/trait/knative_service_test.go
index da9708d..661afb4 100644
--- a/pkg/trait/knative_service_test.go
+++ b/pkg/trait/knative_service_test.go
@@ -120,7 +120,7 @@ func TestKnativeService(t *testing.T) {
 
 	assert.Nil(t, err)
 	assert.NotEmpty(t, environment.ExecutedTraits)
-	assert.NotNil(t, environment.GetTrait(ID("knative")))
+	assert.NotNil(t, environment.GetTrait("knative"))
 	assert.NotNil(t, envvar.Get(environment.EnvVars, "CAMEL_KNATIVE_CONFIGURATION"))
 	assert.Equal(t, 4, environment.Resources.Size())
 
@@ -249,8 +249,8 @@ func TestKnativeServiceWithCustomContainerName(t *testing.T) {
 
 	assert.Nil(t, err)
 	assert.NotEmpty(t, environment.ExecutedTraits)
-	assert.NotNil(t, environment.GetTrait(ID("knative-service")))
-	assert.NotNil(t, environment.GetTrait(ID("container")))
+	assert.NotNil(t, environment.GetTrait("knative-service"))
+	assert.NotNil(t, environment.GetTrait("container"))
 
 	s := environment.Resources.GetKnativeService(func(service *serving.Service) bool {
 		return service.Name == KnativeServiceTestName
diff --git a/pkg/trait/owner_test.go b/pkg/trait/owner_test.go
index 8b57c0e..22206af 100644
--- a/pkg/trait/owner_test.go
+++ b/pkg/trait/owner_test.go
@@ -34,7 +34,7 @@ func TestOwner(t *testing.T) {
 	processTestEnv(t, env)
 
 	assert.NotEmpty(t, env.ExecutedTraits)
-	assert.NotNil(t, env.GetTrait(ID("owner")))
+	assert.NotNil(t, env.GetTrait("owner"))
 
 	ValidateOwnerResources(t, env, true)
 }
diff --git a/pkg/trait/route_test.go b/pkg/trait/route_test.go
index 6e7e74b..24f4895 100644
--- a/pkg/trait/route_test.go
+++ b/pkg/trait/route_test.go
@@ -103,8 +103,8 @@ func TestRoute_Default(t *testing.T) {
 
 	assert.Nil(t, err)
 	assert.NotEmpty(t, environment.ExecutedTraits)
-	assert.NotNil(t, environment.GetTrait(ID("container")))
-	assert.NotNil(t, environment.GetTrait(ID("route")))
+	assert.NotNil(t, environment.GetTrait("container"))
+	assert.NotNil(t, environment.GetTrait("route"))
 
 	route := environment.Resources.GetRoute(func(r *routev1.Route) bool {
 		return r.ObjectMeta.Name == name
@@ -132,7 +132,7 @@ func TestRoute_Disabled(t *testing.T) {
 
 	assert.Nil(t, err)
 	assert.NotEmpty(t, environment.ExecutedTraits)
-	assert.Nil(t, environment.GetTrait(ID("route")))
+	assert.Nil(t, environment.GetTrait("route"))
 
 	route := environment.Resources.GetRoute(func(r *routev1.Route) bool {
 		return r.ObjectMeta.Name == name
@@ -158,7 +158,7 @@ func TestRoute_TLS(t *testing.T) {
 
 	assert.Nil(t, err)
 	assert.NotEmpty(t, environment.ExecutedTraits)
-	assert.NotNil(t, environment.GetTrait(ID("route")))
+	assert.NotNil(t, environment.GetTrait("route"))
 
 	route := environment.Resources.GetRoute(func(r *routev1.Route) bool {
 		return r.ObjectMeta.Name == name
@@ -185,8 +185,8 @@ func TestRoute_WithCustomServicePort(t *testing.T) {
 
 	assert.Nil(t, err)
 	assert.NotEmpty(t, environment.ExecutedTraits)
-	assert.NotNil(t, environment.GetTrait(ID("container")))
-	assert.NotNil(t, environment.GetTrait(ID("route")))
+	assert.NotNil(t, environment.GetTrait("container"))
+	assert.NotNil(t, environment.GetTrait("route"))
 
 	route := environment.Resources.GetRoute(func(r *routev1.Route) bool {
 		return r.ObjectMeta.Name == name
diff --git a/pkg/trait/service_test.go b/pkg/trait/service_test.go
index 095ab00..5505de0 100644
--- a/pkg/trait/service_test.go
+++ b/pkg/trait/service_test.go
@@ -101,9 +101,9 @@ func TestServiceWithDefaults(t *testing.T) {
 
 	assert.Nil(t, err)
 	assert.NotEmpty(t, environment.ExecutedTraits)
-	assert.NotNil(t, environment.GetTrait(ID("deployment")))
-	assert.NotNil(t, environment.GetTrait(ID("service")))
-	assert.NotNil(t, environment.GetTrait(ID("container")))
+	assert.NotNil(t, environment.GetTrait("deployment"))
+	assert.NotNil(t, environment.GetTrait("service"))
+	assert.NotNil(t, environment.GetTrait("container"))
 
 	s := environment.Resources.GetService(func(service *corev1.Service) bool {
 		return service.Name == ServiceTestName
@@ -199,9 +199,9 @@ func TestService(t *testing.T) {
 
 	assert.Nil(t, err)
 	assert.NotEmpty(t, environment.ExecutedTraits)
-	assert.NotNil(t, environment.GetTrait(ID("deployment")))
-	assert.NotNil(t, environment.GetTrait(ID("service")))
-	assert.NotNil(t, environment.GetTrait(ID("container")))
+	assert.NotNil(t, environment.GetTrait("deployment"))
+	assert.NotNil(t, environment.GetTrait("service"))
+	assert.NotNil(t, environment.GetTrait("container"))
 
 	s := environment.Resources.GetService(func(service *corev1.Service) bool {
 		return service.Name == ServiceTestName
@@ -282,9 +282,9 @@ func TestServiceWithCustomContainerName(t *testing.T) {
 
 	assert.Nil(t, err)
 	assert.NotEmpty(t, environment.ExecutedTraits)
-	assert.NotNil(t, environment.GetTrait(ID("deployment")))
-	assert.NotNil(t, environment.GetTrait(ID("service")))
-	assert.NotNil(t, environment.GetTrait(ID("container")))
+	assert.NotNil(t, environment.GetTrait("deployment"))
+	assert.NotNil(t, environment.GetTrait("service"))
+	assert.NotNil(t, environment.GetTrait("container"))
 
 	d := environment.Resources.GetDeploymentForIntegration(environment.Integration)
 	assert.NotNil(t, d)
diff --git a/pkg/trait/trait_test.go b/pkg/trait/trait_test.go
index 3729e0d..16d0e6c 100644
--- a/pkg/trait/trait_test.go
+++ b/pkg/trait/trait_test.go
@@ -45,10 +45,10 @@ func TestOpenShiftTraits(t *testing.T) {
 	res := processTestEnv(t, env)
 
 	assert.NotEmpty(t, env.ExecutedTraits)
-	assert.NotNil(t, env.GetTrait(ID("deployment")))
-	assert.Nil(t, env.GetTrait(ID("service")))
-	assert.Nil(t, env.GetTrait(ID("route")))
-	assert.NotNil(t, env.GetTrait(ID("owner")))
+	assert.NotNil(t, env.GetTrait("deployment"))
+	assert.Nil(t, env.GetTrait("service"))
+	assert.Nil(t, env.GetTrait("route"))
+	assert.NotNil(t, env.GetTrait("owner"))
 	assert.NotNil(t, res.GetConfigMap(func(cm *corev1.ConfigMap) bool {
 		return cm.Name == TestProperties
 	}))
@@ -60,10 +60,10 @@ func TestOpenShiftTraits(t *testing.T) {
 func TestOpenShiftTraitsWithWeb(t *testing.T) {
 	env := createTestEnv(t, v1alpha1.IntegrationPlatformClusterOpenShift, "from('undertow:http').to('log:info')")
 	res := processTestEnv(t, env)
-	assert.NotNil(t, env.GetTrait(ID("deployment")))
-	assert.NotNil(t, env.GetTrait(ID("service")))
-	assert.NotNil(t, env.GetTrait(ID("route")))
-	assert.NotNil(t, env.GetTrait(ID("owner")))
+	assert.NotNil(t, env.GetTrait("deployment"))
+	assert.NotNil(t, env.GetTrait("service"))
+	assert.NotNil(t, env.GetTrait("route"))
+	assert.NotNil(t, env.GetTrait("owner"))
 	assert.NotNil(t, res.GetConfigMap(func(cm *corev1.ConfigMap) bool {
 		return cm.Name == TestProperties
 	}))
@@ -87,8 +87,8 @@ func TestOpenShiftTraitsWithWebAndConfig(t *testing.T) {
 		},
 	}
 	res := processTestEnv(t, env)
-	assert.NotNil(t, env.GetTrait(ID("service")))
-	assert.NotNil(t, env.GetTrait(ID("route")))
+	assert.NotNil(t, env.GetTrait("service"))
+	assert.NotNil(t, env.GetTrait("route"))
 	assert.NotNil(t, res.GetService(func(svc *corev1.Service) bool {
 		return svc.Name == TestDeploymentName && svc.Spec.Ports[0].TargetPort.StrVal == "http"
 	}))
@@ -104,8 +104,8 @@ func TestOpenShiftTraitsWithWebAndDisabledTrait(t *testing.T) {
 		},
 	}
 	res := processTestEnv(t, env)
-	assert.Nil(t, env.GetTrait(ID("service")))
-	assert.Nil(t, env.GetTrait(ID("route"))) // No route without service
+	assert.Nil(t, env.GetTrait("service"))
+	assert.Nil(t, env.GetTrait("route")) // No route without service
 	assert.Nil(t, res.GetService(func(svc *corev1.Service) bool {
 		return true
 	}))
@@ -114,10 +114,10 @@ func TestOpenShiftTraitsWithWebAndDisabledTrait(t *testing.T) {
 func TestKubernetesTraits(t *testing.T) {
 	env := createTestEnv(t, v1alpha1.IntegrationPlatformClusterKubernetes, "from('timer:tick').to('log:info')")
 	res := processTestEnv(t, env)
-	assert.NotNil(t, env.GetTrait(ID("deployment")))
-	assert.Nil(t, env.GetTrait(ID("service")))
-	assert.Nil(t, env.GetTrait(ID("route")))
-	assert.NotNil(t, env.GetTrait(ID("owner")))
+	assert.NotNil(t, env.GetTrait("deployment"))
+	assert.Nil(t, env.GetTrait("service"))
+	assert.Nil(t, env.GetTrait("route"))
+	assert.NotNil(t, env.GetTrait("owner"))
 	assert.NotNil(t, res.GetConfigMap(func(cm *corev1.ConfigMap) bool {
 		return cm.Name == TestProperties
 	}))
@@ -129,10 +129,10 @@ func TestKubernetesTraits(t *testing.T) {
 func TestKubernetesTraitsWithWeb(t *testing.T) {
 	env := createTestEnv(t, v1alpha1.IntegrationPlatformClusterKubernetes, "from('servlet:http').to('log:info')")
 	res := processTestEnv(t, env)
-	assert.NotNil(t, env.GetTrait(ID("deployment")))
-	assert.NotNil(t, env.GetTrait(ID("service")))
-	assert.Nil(t, env.GetTrait(ID("route")))
-	assert.NotNil(t, env.GetTrait(ID("owner")))
+	assert.NotNil(t, env.GetTrait("deployment"))
+	assert.NotNil(t, env.GetTrait("service"))
+	assert.Nil(t, env.GetTrait("route"))
+	assert.NotNil(t, env.GetTrait("owner"))
 	assert.NotNil(t, res.GetConfigMap(func(cm *corev1.ConfigMap) bool {
 		return cm.Name == TestProperties
 	}))


[camel-k] 35/38: feat(quarkus): Update Camel Quarkus catalog

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 9ec0333fadff07e62bd974d36cad890d75b3fc6a
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Oct 30 11:34:20 2019 +0100

    feat(quarkus): Update Camel Quarkus catalog
---
 ...yaml => camel-quarkus-catalog-0.3.0-1.0.7.yaml} | 53 +++++++++++++++++----
 deploy/resources.go                                | 55 +++++++++++++++++-----
 2 files changed, 87 insertions(+), 21 deletions(-)

diff --git a/deploy/camel-catalog-quarkus-3.0.0-RC1-1.0.5.yaml b/deploy/camel-quarkus-catalog-0.3.0-1.0.7.yaml
similarity index 87%
rename from deploy/camel-catalog-quarkus-3.0.0-RC1-1.0.5.yaml
rename to deploy/camel-quarkus-catalog-0.3.0-1.0.7.yaml
index a335145..a4103f7 100644
--- a/deploy/camel-catalog-quarkus-3.0.0-RC1-1.0.5.yaml
+++ b/deploy/camel-quarkus-catalog-0.3.0-1.0.7.yaml
@@ -18,20 +18,20 @@
 apiVersion: camel.apache.org/v1alpha1
 kind: CamelCatalog
 metadata:
-  name: camel-catalog-quarkus-3.0.0-rc1-1.0.5
+  name: camel-quarkus-catalog-0.3.0-1.0.7
   labels:
     app: camel-k
-    camel.apache.org/catalog.version: 3.0.0-RC1
-    camel.apache.org/catalog.loader.version: 3.0.0-RC1
-    camel.apache.org/runtime.version: 1.0.5
+    camel.apache.org/catalog.version: 3.0.0-RC3
+    camel.apache.org/catalog.loader.version: 3.0.0-RC3
+    camel.apache.org/runtime.version: 1.0.7
     camel.apache.org/runtime.provider: quarkus
 spec:
-  version: 3.0.0-RC1
-  runtimeVersion: 1.0.5
+  version: 3.0.0-RC3
+  runtimeVersion: 1.0.7
   runtimeProvider:
     quarkus:
-      camelQuarkusVersion: 0.2.0
-      quarkusVersion: 0.21.2
+      camelQuarkusVersion: 0.3.0
+      quarkusVersion: 0.26.1
   artifacts:
     camel-k-loader-groovy:
       groupId: org.apache.camel.k
@@ -97,14 +97,18 @@ spec:
         artifactId: camel-core-engine
       - groupId: org.apache.camel
         artifactId: camel-main
-      - groupId: org.apache.camel
-        artifactId: camel-properties
     camel-k-runtime-servlet:
       groupId: org.apache.camel.k
       artifactId: camel-k-runtime-servlet
       dependencies:
       - groupId: org.apache.camel
         artifactId: camel-servlet
+    camel-k-runtime-webhook:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-runtime-webhook
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-webhook
     camel-knative:
       groupId: org.apache.camel.k
       artifactId: camel-knative
@@ -182,6 +186,16 @@ spec:
       - id: direct
         http: false
         passive: true
+    camel-quarkus-fhir:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-fhir
+      schemes:
+      - id: fhir
+        http: false
+        passive: false
+      dataformats:
+      - fhirJson
+      - fhirXml
     camel-quarkus-infinispan:
       groupId: org.apache.camel.quarkus
       artifactId: camel-quarkus-infinispan
@@ -189,6 +203,11 @@ spec:
       - id: infinispan
         http: false
         passive: false
+    camel-quarkus-jackson:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-jackson
+      dataformats:
+      - json-jackson
     camel-quarkus-jdbc:
       groupId: org.apache.camel.quarkus
       artifactId: camel-quarkus-jdbc
@@ -272,6 +291,13 @@ spec:
       - id: servlet
         http: true
         passive: false
+    camel-quarkus-slack:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-slack
+      schemes:
+      - id: slack
+        http: false
+        passive: false
     camel-quarkus-tarfile:
       groupId: org.apache.camel.quarkus
       artifactId: camel-quarkus-tarfile
@@ -297,6 +323,13 @@ spec:
       - id: twitter-timeline
         http: false
         passive: false
+    camel-quarkus-vm:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-vm
+      schemes:
+      - id: vm
+        http: false
+        passive: true
     camel-quarkus-zipfile:
       groupId: org.apache.camel.quarkus
       artifactId: camel-quarkus-zipfile
diff --git a/deploy/resources.go b/deploy/resources.go
index ab5d14d..b845b7e 100644
--- a/deploy/resources.go
+++ b/deploy/resources.go
@@ -6942,7 +6942,7 @@ spec:
         passive: false
 
 `
-	Resources["camel-catalog-quarkus-3.0.0-RC1-1.0.5.yaml"] =
+	Resources["camel-quarkus-catalog-0.3.0-1.0.7.yaml"] =
 		`
 # ---------------------------------------------------------------------------
 # Licensed to the Apache Software Foundation (ASF) under one or more
@@ -6964,20 +6964,20 @@ spec:
 apiVersion: camel.apache.org/v1alpha1
 kind: CamelCatalog
 metadata:
-  name: camel-catalog-quarkus-3.0.0-rc1-1.0.5
+  name: camel-quarkus-catalog-0.3.0-1.0.7
   labels:
     app: camel-k
-    camel.apache.org/catalog.version: 3.0.0-RC1
-    camel.apache.org/catalog.loader.version: 3.0.0-RC1
-    camel.apache.org/runtime.version: 1.0.5
+    camel.apache.org/catalog.version: 3.0.0-RC3
+    camel.apache.org/catalog.loader.version: 3.0.0-RC3
+    camel.apache.org/runtime.version: 1.0.7
     camel.apache.org/runtime.provider: quarkus
 spec:
-  version: 3.0.0-RC1
-  runtimeVersion: 1.0.5
+  version: 3.0.0-RC3
+  runtimeVersion: 1.0.7
   runtimeProvider:
     quarkus:
-      camelQuarkusVersion: 0.2.0
-      quarkusVersion: 0.21.2
+      camelQuarkusVersion: 0.3.0
+      quarkusVersion: 0.26.1
   artifacts:
     camel-k-loader-groovy:
       groupId: org.apache.camel.k
@@ -7043,14 +7043,18 @@ spec:
         artifactId: camel-core-engine
       - groupId: org.apache.camel
         artifactId: camel-main
-      - groupId: org.apache.camel
-        artifactId: camel-properties
     camel-k-runtime-servlet:
       groupId: org.apache.camel.k
       artifactId: camel-k-runtime-servlet
       dependencies:
       - groupId: org.apache.camel
         artifactId: camel-servlet
+    camel-k-runtime-webhook:
+      groupId: org.apache.camel.k
+      artifactId: camel-k-runtime-webhook
+      dependencies:
+      - groupId: org.apache.camel
+        artifactId: camel-webhook
     camel-knative:
       groupId: org.apache.camel.k
       artifactId: camel-knative
@@ -7128,6 +7132,16 @@ spec:
       - id: direct
         http: false
         passive: true
+    camel-quarkus-fhir:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-fhir
+      schemes:
+      - id: fhir
+        http: false
+        passive: false
+      dataformats:
+      - fhirJson
+      - fhirXml
     camel-quarkus-infinispan:
       groupId: org.apache.camel.quarkus
       artifactId: camel-quarkus-infinispan
@@ -7135,6 +7149,11 @@ spec:
       - id: infinispan
         http: false
         passive: false
+    camel-quarkus-jackson:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-jackson
+      dataformats:
+      - json-jackson
     camel-quarkus-jdbc:
       groupId: org.apache.camel.quarkus
       artifactId: camel-quarkus-jdbc
@@ -7218,6 +7237,13 @@ spec:
       - id: servlet
         http: true
         passive: false
+    camel-quarkus-slack:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-slack
+      schemes:
+      - id: slack
+        http: false
+        passive: false
     camel-quarkus-tarfile:
       groupId: org.apache.camel.quarkus
       artifactId: camel-quarkus-tarfile
@@ -7243,6 +7269,13 @@ spec:
       - id: twitter-timeline
         http: false
         passive: false
+    camel-quarkus-vm:
+      groupId: org.apache.camel.quarkus
+      artifactId: camel-quarkus-vm
+      schemes:
+      - id: vm
+        http: false
+        passive: true
     camel-quarkus-zipfile:
       groupId: org.apache.camel.quarkus
       artifactId: camel-quarkus-zipfile


[camel-k] 30/38: feat(quarkus): Add Quarkus trait documentation

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit f9bdc9e1e7beed5e958e60ff5793b854290f9615
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Mon Oct 28 15:11:02 2019 +0100

    feat(quarkus): Add Quarkus trait documentation
---
 docs/modules/ROOT/pages/traits.adoc | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/docs/modules/ROOT/pages/traits.adoc b/docs/modules/ROOT/pages/traits.adoc
index 2b825ba..b694679 100644
--- a/docs/modules/ROOT/pages/traits.adoc
+++ b/docs/modules/ROOT/pages/traits.adoc
@@ -394,6 +394,24 @@ It's disabled by default.
 
 !===
 
+| quarkus
+| All
+| Activates the Quarkus runtime
+  +
+  +
+It's disabled by default.
+
+[cols="m,"]
+!===
+
+! quarkus.camel-quarkus-version
+! The Camel Quarkus version to use for the integration
+
+! quarkus.quarkus-version
+! The Quarkus version to use for the integration
+
+!===
+
 |=======================
 
 


[camel-k] 37/38: feat(quarkus): Fix camel catalog names

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 21778feb528cdacd77f563637c95131b78af59cf
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Oct 30 14:59:06 2019 +0100

    feat(quarkus): Fix camel catalog names
---
 deploy/camel-catalog-3.0.0-RC1-1.0.7-SNAPSHOT.yaml     | 2 +-
 deploy/camel-catalog-quarkus-0.3.0-1.0.7-SNAPSHOT.yaml | 2 +-
 deploy/resources.go                                    | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/deploy/camel-catalog-3.0.0-RC1-1.0.7-SNAPSHOT.yaml b/deploy/camel-catalog-3.0.0-RC1-1.0.7-SNAPSHOT.yaml
index 893e143..5ae9694 100644
--- a/deploy/camel-catalog-3.0.0-RC1-1.0.7-SNAPSHOT.yaml
+++ b/deploy/camel-catalog-3.0.0-RC1-1.0.7-SNAPSHOT.yaml
@@ -18,7 +18,7 @@
 apiVersion: camel.apache.org/v1alpha1
 kind: CamelCatalog
 metadata:
-  name: camel-catalog-3.0.0-rc1-1.0.7-SNAPSHOT
+  name: camel-catalog-3.0.0-rc1-1.0.7-snapshot
   labels:
     app: camel-k
     camel.apache.org/catalog.version: 3.0.0-RC1
diff --git a/deploy/camel-catalog-quarkus-0.3.0-1.0.7-SNAPSHOT.yaml b/deploy/camel-catalog-quarkus-0.3.0-1.0.7-SNAPSHOT.yaml
index 96e336c..9b87bfb 100644
--- a/deploy/camel-catalog-quarkus-0.3.0-1.0.7-SNAPSHOT.yaml
+++ b/deploy/camel-catalog-quarkus-0.3.0-1.0.7-SNAPSHOT.yaml
@@ -18,7 +18,7 @@
 apiVersion: camel.apache.org/v1alpha1
 kind: CamelCatalog
 metadata:
-  name: camel-quarkus-catalog-0.3.0-1.0.7-SNAPSHOT
+  name: camel-catalog-quarkus-0.3.0-1.0.7-snapshot
   labels:
     app: camel-k
     camel.apache.org/catalog.version: 3.0.0-RC3
diff --git a/deploy/resources.go b/deploy/resources.go
index bb1720b..85bc6df 100644
--- a/deploy/resources.go
+++ b/deploy/resources.go
@@ -6964,7 +6964,7 @@ spec:
 apiVersion: camel.apache.org/v1alpha1
 kind: CamelCatalog
 metadata:
-  name: camel-catalog-3.0.0-rc1-1.0.7-SNAPSHOT
+  name: camel-catalog-3.0.0-rc1-1.0.7-snapshot
   labels:
     app: camel-k
     camel.apache.org/catalog.version: 3.0.0-RC1
@@ -9181,7 +9181,7 @@ spec:
 apiVersion: camel.apache.org/v1alpha1
 kind: CamelCatalog
 metadata:
-  name: camel-quarkus-catalog-0.3.0-1.0.7-SNAPSHOT
+  name: camel-catalog-quarkus-0.3.0-1.0.7-snapshot
   labels:
     app: camel-k
     camel.apache.org/catalog.version: 3.0.0-RC3


[camel-k] 29/38: feat(quarkus): Use runtime provider label selector to list kits

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit fb6d63704c972d1186f0b0dd0513f2e85b6f9894
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Mon Oct 28 14:51:35 2019 +0100

    feat(quarkus): Use runtime provider label selector to list kits
---
 pkg/builder/builder_steps.go            | 23 ++++++++++++++++++++---
 pkg/controller/integration/build_kit.go |  4 ++++
 pkg/controller/integration/util.go      | 22 ++++++++++++++++++++--
 pkg/util/camel/camel_runtime.go         |  4 ++--
 4 files changed, 46 insertions(+), 7 deletions(-)

diff --git a/pkg/builder/builder_steps.go b/pkg/builder/builder_steps.go
index 3e08e79..d44d579 100644
--- a/pkg/builder/builder_steps.go
+++ b/pkg/builder/builder_steps.go
@@ -24,9 +24,13 @@ import (
 	"reflect"
 	"strings"
 
+	"k8s.io/apimachinery/pkg/labels"
+	"k8s.io/apimachinery/pkg/selection"
+
 	k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/util/controller"
 	"github.com/apache/camel-k/pkg/util/kubernetes"
 	"github.com/apache/camel-k/pkg/util/maven"
 	"github.com/apache/camel-k/pkg/util/tar"
@@ -329,9 +333,22 @@ func packager(ctx *Context, selector artifactsSelector) error {
 }
 
 func listPublishedImages(context *Context) ([]publishedImage, error) {
-	list := v1alpha1.NewIntegrationKitList()
+	options := []k8sclient.ListOption{
+		k8sclient.InNamespace(context.Namespace),
+	}
 
-	err := context.Client.List(context.C, &list, k8sclient.InNamespace(context.Namespace))
+	if context.Catalog.RuntimeProvider != nil && context.Catalog.RuntimeProvider.Quarkus != nil {
+		options = append(options, k8sclient.MatchingLabels{
+			"camel.apache.org/runtime.provider": "quarkus",
+		})
+	} else {
+		provider, _ := labels.NewRequirement("camel.apache.org/runtime.provider", selection.DoesNotExist, []string{})
+		selector := labels.NewSelector().Add(*provider)
+		options = append(options, controller.MatchingSelector{Selector: selector})
+	}
+
+	list := v1alpha1.NewIntegrationKitList()
+	err := context.Client.List(context.C, &list, options...)
 	if err != nil {
 		return nil, err
 	}
@@ -350,7 +367,7 @@ func listPublishedImages(context *Context) ([]publishedImage, error) {
 			continue
 		}
 
-		// TODO: should ideally be made generic
+		// TODO: should ideally be made generic from the runtime providers
 		if kit.Status.RuntimeProvider == nil && context.Catalog.RuntimeProvider != nil ||
 			kit.Status.RuntimeProvider != nil && context.Catalog.RuntimeProvider == nil ||
 			kit.Status.RuntimeProvider != nil && context.Catalog.RuntimeProvider != nil &&
diff --git a/pkg/controller/integration/build_kit.go b/pkg/controller/integration/build_kit.go
index c2976ee..beb078c 100644
--- a/pkg/controller/integration/build_kit.go
+++ b/pkg/controller/integration/build_kit.go
@@ -113,6 +113,10 @@ func (action *buildKitAction) Handle(ctx context.Context, integration *v1alpha1.
 		"camel.apache.org/kit.created.by.version": integration.ResourceVersion,
 	}
 
+	if integration.Status.RuntimeProvider != nil && integration.Status.RuntimeProvider.Quarkus != nil {
+		platformKit.Labels["camel.apache.org/runtime.provider"] = "quarkus"
+	}
+
 	// Set the kit to have the same characteristics as the integrations
 	platformKit.Spec = v1alpha1.IntegrationKitSpec{
 		Dependencies: integration.Status.Dependencies,
diff --git a/pkg/controller/integration/util.go b/pkg/controller/integration/util.go
index 39e3495..261153a 100644
--- a/pkg/controller/integration/util.go
+++ b/pkg/controller/integration/util.go
@@ -22,10 +22,14 @@ import (
 
 	"github.com/pkg/errors"
 
+	"k8s.io/apimachinery/pkg/labels"
+	"k8s.io/apimachinery/pkg/selection"
+
 	k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/util"
+	"github.com/apache/camel-k/pkg/util/controller"
 	"github.com/apache/camel-k/pkg/util/kubernetes"
 )
 
@@ -45,8 +49,22 @@ func LookupKitForIntegration(ctx context.Context, c k8sclient.Reader, integratio
 		return kit, nil
 	}
 
+	options := []k8sclient.ListOption{
+		k8sclient.InNamespace(integration.Namespace),
+	}
+
+	if integration.Status.RuntimeProvider != nil && integration.Status.RuntimeProvider.Quarkus != nil {
+		options = append(options, k8sclient.MatchingLabels{
+			"camel.apache.org/runtime.provider": "quarkus",
+		})
+	} else {
+		provider, _ := labels.NewRequirement("camel.apache.org/runtime.provider", selection.DoesNotExist, []string{})
+		selector := labels.NewSelector().Add(*provider)
+		options = append(options, controller.MatchingSelector{Selector: selector})
+	}
+
 	kits := v1alpha1.NewIntegrationKitList()
-	if err := c.List(ctx, &kits, k8sclient.InNamespace(integration.Namespace)); err != nil {
+	if err := c.List(ctx, &kits, options...); err != nil {
 		return nil, err
 	}
 
@@ -66,7 +84,7 @@ func LookupKitForIntegration(ctx context.Context, c k8sclient.Reader, integratio
 			continue
 		}
 
-		// TODO: should ideally be made generic
+		// TODO: should ideally be made generic from the runtime providers
 		if integration.Status.RuntimeProvider == nil && kit.Status.RuntimeProvider != nil ||
 			integration.Status.RuntimeProvider != nil && kit.Status.RuntimeProvider == nil ||
 			integration.Status.RuntimeProvider != nil && kit.Status.RuntimeProvider != nil &&
diff --git a/pkg/util/camel/camel_runtime.go b/pkg/util/camel/camel_runtime.go
index c9aea1b..420ebe3 100644
--- a/pkg/util/camel/camel_runtime.go
+++ b/pkg/util/camel/camel_runtime.go
@@ -37,8 +37,8 @@ func LoadCatalog(ctx context.Context, client client.Client, namespace string, ca
 	}
 
 	if provider == nil {
-		integration, _ := labels.NewRequirement("camel.apache.org/runtime.provider", selection.DoesNotExist, []string{})
-		selector := labels.NewSelector().Add(*integration)
+		requirement, _ := labels.NewRequirement("camel.apache.org/runtime.provider", selection.DoesNotExist, []string{})
+		selector := labels.NewSelector().Add(*requirement)
 		options = append(options, controller.MatchingSelector{Selector: selector})
 	} else if _, ok := provider.(v1alpha1.QuarkusRuntimeProvider); ok {
 		options = append(options, k8sclient.MatchingLabels{


[camel-k] 26/38: fix(lint): Use regexp.MustCompile

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 1066a8910e00e4bffa0c02050dc105e8ccf2bb44
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Fri Oct 25 16:28:07 2019 +0200

    fix(lint): Use regexp.MustCompile
---
 pkg/trait/util.go | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/pkg/trait/util.go b/pkg/trait/util.go
index 9c3e12c..6413f4c 100644
--- a/pkg/trait/util.go
+++ b/pkg/trait/util.go
@@ -33,15 +33,7 @@ import (
 	k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
 )
 
-var exactVersionRegexp regexp.Regexp
-
-func init() {
-	r, err := regexp.Compile(`^(\d+)\.(\d+)\.([\w-\.]+)$`)
-	if err != nil {
-		panic(err)
-	}
-	exactVersionRegexp = *r
-}
+var exactVersionRegexp = regexp.MustCompile(`^(\d+)\.(\d+)\.([\w-.]+)$`)
 
 // GetIntegrationKit retrieves the kit set on the integration
 func GetIntegrationKit(ctx context.Context, c client.Client, integration *v1alpha1.Integration) (*v1alpha1.IntegrationKit, error) {


[camel-k] 06/38: feat(quarkus): Introduce Runtime Provider API

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 02288f6a4b778b47dd7872d3f45fe560260611bd
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Tue Oct 22 15:33:14 2019 +0200

    feat(quarkus): Introduce Runtime Provider API
---
 assets/json-schema/CamelCatalog.json               | 26 +++++++++
 assets/json-schema/Integration.json                | 26 +++++++++
 assets/json-schema/IntegrationKit.json             | 26 +++++++++
 pkg/apis/camel/v1alpha1/build_types.go             | 21 ++++----
 pkg/apis/camel/v1alpha1/camelcatalog_types.go      |  7 +--
 pkg/apis/camel/v1alpha1/common_types.go            | 11 ++++
 pkg/apis/camel/v1alpha1/integration_types.go       |  1 +
 pkg/apis/camel/v1alpha1/integrationkit_types.go    | 23 ++++----
 .../camel/v1alpha1/integrationplatform_types.go    |  1 +
 pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go   | 62 ++++++++++++++++++++++
 10 files changed, 180 insertions(+), 24 deletions(-)

diff --git a/assets/json-schema/CamelCatalog.json b/assets/json-schema/CamelCatalog.json
index a1a71a8..56b0b5a 100644
--- a/assets/json-schema/CamelCatalog.json
+++ b/assets/json-schema/CamelCatalog.json
@@ -179,6 +179,10 @@
           },
           "type": "object"
         },
+        "runtimeProvider": {
+          "$schema": "http://json-schema.org/draft-04/schema#",
+          "$ref": "#/definitions/RuntimeProvider"
+        },
         "runtimeVersion": {
           "type": "string"
         },
@@ -314,6 +318,28 @@
       "additionalProperties": false,
       "type": "object"
     },
+    "QuarkusRuntimeProvider": {
+      "properties": {
+        "camelQuarkusVersion": {
+          "type": "string"
+        },
+        "quarkusVersion": {
+          "type": "string"
+        }
+      },
+      "additionalProperties": false,
+      "type": "object"
+    },
+    "RuntimeProvider": {
+      "properties": {
+        "quarkus": {
+          "$schema": "http://json-schema.org/draft-04/schema#",
+          "$ref": "#/definitions/QuarkusRuntimeProvider"
+        }
+      },
+      "additionalProperties": false,
+      "type": "object"
+    },
     "Status": {
       "properties": {
         "apiVersion": {
diff --git a/assets/json-schema/Integration.json b/assets/json-schema/Integration.json
index fcdd30b..0df80fe 100644
--- a/assets/json-schema/Integration.json
+++ b/assets/json-schema/Integration.json
@@ -342,6 +342,10 @@
         "replicas": {
           "type": "integer"
         },
+        "runtimeProvider": {
+          "$schema": "http://json-schema.org/draft-04/schema#",
+          "$ref": "#/definitions/RuntimeProvider"
+        },
         "runtimeVersion": {
           "type": "string"
         },
@@ -404,6 +408,18 @@
       "additionalProperties": false,
       "type": "object"
     },
+    "QuarkusRuntimeProvider": {
+      "properties": {
+        "camelQuarkusVersion": {
+          "type": "string"
+        },
+        "quarkusVersion": {
+          "type": "string"
+        }
+      },
+      "additionalProperties": false,
+      "type": "object"
+    },
     "ResourceSpec": {
       "properties": {
         "compression": {
@@ -431,6 +447,16 @@
       "additionalProperties": false,
       "type": "object"
     },
+    "RuntimeProvider": {
+      "properties": {
+        "quarkus": {
+          "$schema": "http://json-schema.org/draft-04/schema#",
+          "$ref": "#/definitions/QuarkusRuntimeProvider"
+        }
+      },
+      "additionalProperties": false,
+      "type": "object"
+    },
     "SourceSpec": {
       "properties": {
         "compression": {
diff --git a/assets/json-schema/IntegrationKit.json b/assets/json-schema/IntegrationKit.json
index d1a9ca9..576b537 100644
--- a/assets/json-schema/IntegrationKit.json
+++ b/assets/json-schema/IntegrationKit.json
@@ -326,6 +326,10 @@
         "platform": {
           "type": "string"
         },
+        "runtimeProvider": {
+          "$schema": "http://json-schema.org/draft-04/schema#",
+          "$ref": "#/definitions/RuntimeProvider"
+        },
         "runtimeVersion": {
           "type": "string"
         },
@@ -388,6 +392,28 @@
       "additionalProperties": false,
       "type": "object"
     },
+    "QuarkusRuntimeProvider": {
+      "properties": {
+        "camelQuarkusVersion": {
+          "type": "string"
+        },
+        "quarkusVersion": {
+          "type": "string"
+        }
+      },
+      "additionalProperties": false,
+      "type": "object"
+    },
+    "RuntimeProvider": {
+      "properties": {
+        "quarkus": {
+          "$schema": "http://json-schema.org/draft-04/schema#",
+          "$ref": "#/definitions/QuarkusRuntimeProvider"
+        }
+      },
+      "additionalProperties": false,
+      "type": "object"
+    },
     "Status": {
       "properties": {
         "apiVersion": {
diff --git a/pkg/apis/camel/v1alpha1/build_types.go b/pkg/apis/camel/v1alpha1/build_types.go
index 65d8f06..c429fa7 100644
--- a/pkg/apis/camel/v1alpha1/build_types.go
+++ b/pkg/apis/camel/v1alpha1/build_types.go
@@ -29,16 +29,17 @@ import (
 type BuildSpec struct {
 	// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
 	// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
-	Meta           metav1.ObjectMeta       `json:"meta,omitempty"`
-	Image          string                  `json:"image,omitempty"`
-	Steps          []string                `json:"steps,omitempty"`
-	CamelVersion   string                  `json:"camelVersion,omitempty"`
-	RuntimeVersion string                  `json:"runtimeVersion,omitempty"`
-	Platform       IntegrationPlatformSpec `json:"platform,omitempty"`
-	Sources        []SourceSpec            `json:"sources,omitempty"`
-	Resources      []ResourceSpec          `json:"resources,omitempty"`
-	Dependencies   []string                `json:"dependencies,omitempty"`
-	BuildDir       string                  `json:"buildDir,omitempty"`
+	Meta            metav1.ObjectMeta       `json:"meta,omitempty"`
+	Image           string                  `json:"image,omitempty"`
+	Steps           []string                `json:"steps,omitempty"`
+	CamelVersion    string                  `json:"camelVersion,omitempty"`
+	RuntimeVersion  string                  `json:"runtimeVersion,omitempty"`
+	RuntimeProvider *RuntimeProvider        `json:"runtimeProvider,omitempty"`
+	Platform        IntegrationPlatformSpec `json:"platform,omitempty"`
+	Sources         []SourceSpec            `json:"sources,omitempty"`
+	Resources       []ResourceSpec          `json:"resources,omitempty"`
+	Dependencies    []string                `json:"dependencies,omitempty"`
+	BuildDir        string                  `json:"buildDir,omitempty"`
 }
 
 // BuildStatus defines the observed state of Build
diff --git a/pkg/apis/camel/v1alpha1/camelcatalog_types.go b/pkg/apis/camel/v1alpha1/camelcatalog_types.go
index d778fb5..65a1d65 100644
--- a/pkg/apis/camel/v1alpha1/camelcatalog_types.go
+++ b/pkg/apis/camel/v1alpha1/camelcatalog_types.go
@@ -53,9 +53,10 @@ type CamelArtifact struct {
 
 // CamelCatalogSpec defines the desired state of CamelCatalog
 type CamelCatalogSpec struct {
-	Version        string                   `json:"version" yaml:"version"`
-	RuntimeVersion string                   `json:"runtimeVersion" yaml:"runtimeVersion"`
-	Artifacts      map[string]CamelArtifact `json:"artifacts" yaml:"artifacts"`
+	Version         string                   `json:"version" yaml:"version"`
+	RuntimeVersion  string                   `json:"runtimeVersion" yaml:"runtimeVersion"`
+	RuntimeProvider *RuntimeProvider         `json:"runtimeProvider,omitempty"`
+	Artifacts       map[string]CamelArtifact `json:"artifacts" yaml:"artifacts"`
 }
 
 // CamelCatalogStatus defines the observed state of CamelCatalog
diff --git a/pkg/apis/camel/v1alpha1/common_types.go b/pkg/apis/camel/v1alpha1/common_types.go
index cf74f69..abf366f 100644
--- a/pkg/apis/camel/v1alpha1/common_types.go
+++ b/pkg/apis/camel/v1alpha1/common_types.go
@@ -22,6 +22,17 @@ import (
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 
+// RuntimeProvider --
+type RuntimeProvider struct {
+	Quarkus *QuarkusRuntimeProvider `json:"quarkus,omitempty"`
+}
+
+// QuarkusRuntimeProvider --
+type QuarkusRuntimeProvider struct {
+	CamelQuarkusVersion string `json:"camelQuarkusVersion,omitempty"`
+	QuarkusVersion      string `json:"quarkusVersion,omitempty"`
+}
+
 // ConfigurationSpec --
 type ConfigurationSpec struct {
 	Type  string `json:"type"`
diff --git a/pkg/apis/camel/v1alpha1/integration_types.go b/pkg/apis/camel/v1alpha1/integration_types.go
index 3f3d775..829496e 100644
--- a/pkg/apis/camel/v1alpha1/integration_types.go
+++ b/pkg/apis/camel/v1alpha1/integration_types.go
@@ -50,6 +50,7 @@ type IntegrationStatus struct {
 	Failure          *Failure               `json:"failure,omitempty"`
 	CamelVersion     string                 `json:"camelVersion,omitempty"`
 	RuntimeVersion   string                 `json:"runtimeVersion,omitempty"`
+	RuntimeProvider  *RuntimeProvider       `json:"runtimeProvider,omitempty"`
 	Configuration    []ConfigurationSpec    `json:"configuration,omitempty"`
 	Conditions       []IntegrationCondition `json:"conditions,omitempty"`
 	Version          string                 `json:"version,omitempty"`
diff --git a/pkg/apis/camel/v1alpha1/integrationkit_types.go b/pkg/apis/camel/v1alpha1/integrationkit_types.go
index 6c56580..43b8173 100644
--- a/pkg/apis/camel/v1alpha1/integrationkit_types.go
+++ b/pkg/apis/camel/v1alpha1/integrationkit_types.go
@@ -35,17 +35,18 @@ type IntegrationKitSpec struct {
 
 // IntegrationKitStatus defines the observed state of IntegrationKit
 type IntegrationKitStatus struct {
-	Phase          IntegrationKitPhase       `json:"phase,omitempty"`
-	BaseImage      string                    `json:"baseImage,omitempty"`
-	Image          string                    `json:"image,omitempty"`
-	Digest         string                    `json:"digest,omitempty"`
-	Artifacts      []Artifact                `json:"artifacts,omitempty"`
-	Failure        *Failure                  `json:"failure,omitempty"`
-	CamelVersion   string                    `json:"camelVersion,omitempty"`
-	RuntimeVersion string                    `json:"runtimeVersion,omitempty"`
-	Platform       string                    `json:"platform,omitempty"`
-	Conditions     []IntegrationKitCondition `json:"conditions,omitempty"`
-	Version        string                    `json:"version,omitempty"`
+	Phase           IntegrationKitPhase       `json:"phase,omitempty"`
+	BaseImage       string                    `json:"baseImage,omitempty"`
+	Image           string                    `json:"image,omitempty"`
+	Digest          string                    `json:"digest,omitempty"`
+	Artifacts       []Artifact                `json:"artifacts,omitempty"`
+	Failure         *Failure                  `json:"failure,omitempty"`
+	CamelVersion    string                    `json:"camelVersion,omitempty"`
+	RuntimeVersion  string                    `json:"runtimeVersion,omitempty"`
+	RuntimeProvider *RuntimeProvider          `json:"runtimeProvider,omitempty"`
+	Platform        string                    `json:"platform,omitempty"`
+	Conditions      []IntegrationKitCondition `json:"conditions,omitempty"`
+	Version         string                    `json:"version,omitempty"`
 }
 
 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
diff --git a/pkg/apis/camel/v1alpha1/integrationplatform_types.go b/pkg/apis/camel/v1alpha1/integrationplatform_types.go
index 3c6d5c9..b41aeba 100644
--- a/pkg/apis/camel/v1alpha1/integrationplatform_types.go
+++ b/pkg/apis/camel/v1alpha1/integrationplatform_types.go
@@ -97,6 +97,7 @@ type IntegrationPlatformBuildSpec struct {
 	PublishStrategy       IntegrationPlatformBuildPublishStrategy `json:"publishStrategy,omitempty"`
 	CamelVersion          string                                  `json:"camelVersion,omitempty"`
 	RuntimeVersion        string                                  `json:"runtimeVersion,omitempty"`
+	RuntimeProvider       *RuntimeProvider                        `json:"runtimeProvider,omitempty"`
 	BaseImage             string                                  `json:"baseImage,omitempty"`
 	Properties            map[string]string                       `json:"properties,omitempty"`
 	LocalRepository       string                                  `json:"localRepository,omitempty"`
diff --git a/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go
index e290310..fff2f0a 100644
--- a/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go
+++ b/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go
@@ -113,6 +113,11 @@ func (in *BuildSpec) DeepCopyInto(out *BuildSpec) {
 		*out = make([]string, len(*in))
 		copy(*out, *in)
 	}
+	if in.RuntimeProvider != nil {
+		in, out := &in.RuntimeProvider, &out.RuntimeProvider
+		*out = new(RuntimeProvider)
+		(*in).DeepCopyInto(*out)
+	}
 	in.Platform.DeepCopyInto(&out.Platform)
 	if in.Sources != nil {
 		in, out := &in.Sources, &out.Sources
@@ -316,6 +321,11 @@ func (in *CamelCatalogList) DeepCopyObject() runtime.Object {
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
 func (in *CamelCatalogSpec) DeepCopyInto(out *CamelCatalogSpec) {
 	*out = *in
+	if in.RuntimeProvider != nil {
+		in, out := &in.RuntimeProvider, &out.RuntimeProvider
+		*out = new(RuntimeProvider)
+		(*in).DeepCopyInto(*out)
+	}
 	if in.Artifacts != nil {
 		in, out := &in.Artifacts, &out.Artifacts
 		*out = make(map[string]CamelArtifact, len(*in))
@@ -611,6 +621,11 @@ func (in *IntegrationKitStatus) DeepCopyInto(out *IntegrationKitStatus) {
 		*out = new(Failure)
 		(*in).DeepCopyInto(*out)
 	}
+	if in.RuntimeProvider != nil {
+		in, out := &in.RuntimeProvider, &out.RuntimeProvider
+		*out = new(RuntimeProvider)
+		(*in).DeepCopyInto(*out)
+	}
 	if in.Conditions != nil {
 		in, out := &in.Conditions, &out.Conditions
 		*out = make([]IntegrationKitCondition, len(*in))
@@ -695,6 +710,11 @@ func (in *IntegrationPlatform) DeepCopyObject() runtime.Object {
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
 func (in *IntegrationPlatformBuildSpec) DeepCopyInto(out *IntegrationPlatformBuildSpec) {
 	*out = *in
+	if in.RuntimeProvider != nil {
+		in, out := &in.RuntimeProvider, &out.RuntimeProvider
+		*out = new(RuntimeProvider)
+		(*in).DeepCopyInto(*out)
+	}
 	if in.Properties != nil {
 		in, out := &in.Properties, &out.Properties
 		*out = make(map[string]string, len(*in))
@@ -935,6 +955,11 @@ func (in *IntegrationStatus) DeepCopyInto(out *IntegrationStatus) {
 		*out = new(Failure)
 		(*in).DeepCopyInto(*out)
 	}
+	if in.RuntimeProvider != nil {
+		in, out := &in.RuntimeProvider, &out.RuntimeProvider
+		*out = new(RuntimeProvider)
+		(*in).DeepCopyInto(*out)
+	}
 	if in.Configuration != nil {
 		in, out := &in.Configuration, &out.Configuration
 		*out = make([]ConfigurationSpec, len(*in))
@@ -984,6 +1009,22 @@ func (in *MavenSpec) DeepCopy() *MavenSpec {
 }
 
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *QuarkusRuntimeProvider) DeepCopyInto(out *QuarkusRuntimeProvider) {
+	*out = *in
+	return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QuarkusRuntimeProvider.
+func (in *QuarkusRuntimeProvider) DeepCopy() *QuarkusRuntimeProvider {
+	if in == nil {
+		return nil
+	}
+	out := new(QuarkusRuntimeProvider)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
 func (in *ResourceSpec) DeepCopyInto(out *ResourceSpec) {
 	*out = *in
 	out.DataSpec = in.DataSpec
@@ -1001,6 +1042,27 @@ func (in *ResourceSpec) DeepCopy() *ResourceSpec {
 }
 
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *RuntimeProvider) DeepCopyInto(out *RuntimeProvider) {
+	*out = *in
+	if in.Quarkus != nil {
+		in, out := &in.Quarkus, &out.Quarkus
+		*out = new(QuarkusRuntimeProvider)
+		**out = **in
+	}
+	return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimeProvider.
+func (in *RuntimeProvider) DeepCopy() *RuntimeProvider {
+	if in == nil {
+		return nil
+	}
+	out := new(RuntimeProvider)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
 func (in *SourceSpec) DeepCopyInto(out *SourceSpec) {
 	*out = *in
 	out.DataSpec = in.DataSpec


[camel-k] 02/38: chore(build): Load Camel catalog as builder step

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 57cfaac52d2d8b2ea9bcd9609bec3997791fa6a4
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Mon Oct 21 14:55:40 2019 +0200

    chore(build): Load Camel catalog as builder step
---
 pkg/builder/builder.go         | 10 ----------
 pkg/builder/builder_steps.go   | 19 ++++++++++++++++++-
 pkg/builder/runtime/main.go    | 11 -----------
 pkg/builder/runtime/quarkus.go | 11 -----------
 pkg/trait/builder_test.go      |  4 ++--
 5 files changed, 20 insertions(+), 35 deletions(-)

diff --git a/pkg/builder/builder.go b/pkg/builder/builder.go
index 872c3df..6e9f63f 100644
--- a/pkg/builder/builder.go
+++ b/pkg/builder/builder.go
@@ -28,7 +28,6 @@ import (
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/client"
-	"github.com/apache/camel-k/pkg/util/camel"
 	"github.com/apache/camel-k/pkg/util/cancellable"
 	"github.com/apache/camel-k/pkg/util/log"
 )
@@ -71,17 +70,8 @@ func (b *defaultBuilder) Build(build v1alpha1.BuildSpec) v1alpha1.BuildStatus {
 
 	defer os.RemoveAll(builderPath)
 
-	catalog, err := camel.LoadCatalog(b.ctx, b.client, build.Meta.Namespace, build.CamelVersion, build.RuntimeVersion)
-	if err != nil {
-		log.Error(err, "Error while loading Camel catalog")
-
-		result.Phase = v1alpha1.BuildPhaseFailed
-		result.Error = err.Error()
-	}
-
 	c := Context{
 		Client:    b.client,
-		Catalog:   catalog,
 		Path:      builderPath,
 		Namespace: build.Meta.Namespace,
 		Build:     build,
diff --git a/pkg/builder/builder_steps.go b/pkg/builder/builder_steps.go
index 3e935e3..d6b1f3f 100644
--- a/pkg/builder/builder_steps.go
+++ b/pkg/builder/builder_steps.go
@@ -27,6 +27,7 @@ import (
 	k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/util/camel"
 	"github.com/apache/camel-k/pkg/util/kubernetes"
 	"github.com/apache/camel-k/pkg/util/maven"
 	"github.com/apache/camel-k/pkg/util/tar"
@@ -39,6 +40,7 @@ func init() {
 }
 
 type steps struct {
+	LoadCatalog             Step
 	GenerateProjectSettings Step
 	InjectDependencies      Step
 	SanitizeDependencies    Step
@@ -48,6 +50,10 @@ type steps struct {
 
 // Steps --
 var Steps = steps{
+	LoadCatalog: NewStep(
+		InitPhase,
+		loadCatalog,
+	),
 	GenerateProjectSettings: NewStep(
 		ProjectGenerationPhase+1,
 		generateProjectSettings,
@@ -72,6 +78,7 @@ var Steps = steps{
 
 // DefaultSteps --
 var DefaultSteps = []Step{
+	Steps.LoadCatalog,
 	Steps.GenerateProjectSettings,
 	Steps.InjectDependencies,
 	Steps.SanitizeDependencies,
@@ -104,7 +111,17 @@ func registerStep(steps ...Step) {
 	}
 }
 
-// generateProjectSettings --
+func loadCatalog(ctx *Context) error {
+	catalog, err := camel.LoadCatalog(ctx.C, ctx.Client, ctx.Build.Meta.Namespace, ctx.Build.CamelVersion, ctx.Build.RuntimeVersion)
+	if err != nil {
+		return err
+	}
+
+	ctx.Catalog = catalog
+
+	return nil
+}
+
 func generateProjectSettings(ctx *Context) error {
 	val, err := kubernetes.ResolveValueSource(ctx.C, ctx.Client, ctx.Namespace, &ctx.Build.Platform.Build.Maven.Settings)
 	if err != nil {
diff --git a/pkg/builder/runtime/main.go b/pkg/builder/runtime/main.go
index dbf6668..4b363a0 100644
--- a/pkg/builder/runtime/main.go
+++ b/pkg/builder/runtime/main.go
@@ -27,7 +27,6 @@ import (
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/builder"
-	"github.com/apache/camel-k/pkg/util/camel"
 	"github.com/apache/camel-k/pkg/util/defaults"
 	"github.com/apache/camel-k/pkg/util/maven"
 )
@@ -39,16 +38,6 @@ var MainSteps = []builder.Step{
 }
 
 func generateProject(ctx *builder.Context) error {
-	// Catalog
-	if ctx.Catalog == nil {
-		c, err := camel.LoadCatalog(ctx.C, ctx.Client, ctx.Namespace, ctx.Build.Platform.Build.CamelVersion, ctx.Build.Platform.Build.RuntimeVersion)
-		if err != nil {
-			return err
-		}
-
-		ctx.Catalog = c
-	}
-
 	p := maven.NewProjectWithGAV("org.apache.camel.k.integration", "camel-k-integration", defaults.Version)
 	p.Properties = ctx.Build.Platform.Build.Properties
 	p.DependencyManagement = &maven.DependencyManagement{Dependencies: make([]maven.Dependency, 0)}
diff --git a/pkg/builder/runtime/quarkus.go b/pkg/builder/runtime/quarkus.go
index ddca59e..df0faf5 100644
--- a/pkg/builder/runtime/quarkus.go
+++ b/pkg/builder/runtime/quarkus.go
@@ -10,7 +10,6 @@ import (
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/builder"
-	"github.com/apache/camel-k/pkg/util/camel"
 	"github.com/apache/camel-k/pkg/util/defaults"
 	"github.com/apache/camel-k/pkg/util/maven"
 )
@@ -22,16 +21,6 @@ var QuarkusSteps = []builder.Step{
 }
 
 func generateQuarkusProject(ctx *builder.Context) error {
-	// Catalog
-	if ctx.Catalog == nil {
-		c, err := camel.LoadCatalog(ctx.C, ctx.Client, ctx.Namespace, ctx.Build.Platform.Build.CamelVersion, ctx.Build.Platform.Build.RuntimeVersion)
-		if err != nil {
-			return err
-		}
-
-		ctx.Catalog = c
-	}
-
 	p := maven.NewProjectWithGAV("org.apache.camel.k.integration", "camel-k-integration", defaults.Version)
 	p.Properties = ctx.Build.Platform.Build.Properties
 	p.DependencyManagement = &maven.DependencyManagement{Dependencies: make([]maven.Dependency, 0)}
diff --git a/pkg/trait/builder_test.go b/pkg/trait/builder_test.go
index f1153d3..e3ae69e 100644
--- a/pkg/trait/builder_test.go
+++ b/pkg/trait/builder_test.go
@@ -87,7 +87,7 @@ func TestS2IBuilderTrait(t *testing.T) {
 	assert.NotEmpty(t, env.ExecutedTraits)
 	assert.NotNil(t, env.GetTrait(ID("builder")))
 	assert.NotEmpty(t, env.Steps)
-	assert.Len(t, env.Steps, 7)
+	assert.Len(t, env.Steps, 8)
 	assert.Condition(t, func() bool {
 		for _, s := range env.Steps {
 			if s == s2i.Steps.Publisher && s.Phase() == builder.ApplicationPublishPhase {
@@ -107,7 +107,7 @@ func TestKanikoBuilderTrait(t *testing.T) {
 	assert.NotEmpty(t, env.ExecutedTraits)
 	assert.NotNil(t, env.GetTrait(ID("builder")))
 	assert.NotEmpty(t, env.Steps)
-	assert.Len(t, env.Steps, 7)
+	assert.Len(t, env.Steps, 8)
 	assert.Condition(t, func() bool {
 		for _, s := range env.Steps {
 			if s == kaniko.Steps.Publisher && s.Phase() == builder.ApplicationPublishPhase {