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:36 UTC
[camel-k] 12/38: feat(quarkus): Do not contribute artifacts to
classpath
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)