This is an automated email from the ASF dual-hosted git repository. pcongiusti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/main by this push: new 6e3080c47 Fix: add classifier field of maven artifact 6e3080c47 is described below commit 6e3080c47df4d15ddc4f20a5425d07de5b879718 Author: Claudio Miranda <clau...@claudius.com.br> AuthorDate: Mon Dec 25 19:46:24 2023 +0000 Fix: add classifier field of maven artifact --- config/crd/bases/camel.apache.org_builds.yaml | 48 ++++++++++++++-- .../crd/bases/camel.apache.org_camelcatalogs.yaml | 54 +++++++++++++++++- .../camel.apache.org_integrationplatforms.yaml | 16 +++++- docs/modules/ROOT/partials/apis/camel-k-crds.adoc | 16 +++++- helm/camel-k/crds/crd-build.yaml | 48 ++++++++++++++-- helm/camel-k/crds/crd-camel-catalog.yaml | 54 +++++++++++++++++- helm/camel-k/crds/crd-integration-platform.yaml | 16 +++++- pkg/apis/camel/v1/maven_types.go | 6 +- pkg/apis/camel/v1/maven_types_support.go | 20 +++++-- pkg/apis/camel/v1/maven_types_support_test.go | 62 +++++++++++++++++++++ .../applyconfiguration/camel/v1/camelartifact.go | 16 ++++++ .../camel/v1/camelartifactdependency.go | 16 ++++++ .../applyconfiguration/camel/v1/camelloader.go | 16 ++++++ .../applyconfiguration/camel/v1/mavenartifact.go | 18 ++++++ pkg/resources/resources.go | 32 +++++------ pkg/trait/jolokia.go | 12 +--- pkg/trait/jolokia_test.go | 10 ++-- pkg/util/camel/camel_dependencies.go | 2 + pkg/util/jitpack/jitpack_test.go | 4 +- pkg/util/maven/maven_command.go | 48 ++++++++-------- pkg/util/maven/maven_project_test.go | 65 +++++++++++++++------- 21 files changed, 473 insertions(+), 106 deletions(-) diff --git a/config/crd/bases/camel.apache.org_builds.yaml b/config/crd/bases/camel.apache.org_builds.yaml index 28f75654f..ae2925cd2 100644 --- a/config/crd/bases/camel.apache.org_builds.yaml +++ b/config/crd/bases/camel.apache.org_builds.yaml @@ -370,15 +370,21 @@ spec: extension: description: The Maven build extensions. See https://maven.apache.org/guides/mini/guide-using-extensions.html. items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -637,15 +643,21 @@ spec: properties: dependencies: items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -663,15 +675,21 @@ spec: description: list of dependencies needed to run the application items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -1167,15 +1185,21 @@ spec: extension: description: The Maven build extensions. See https://maven.apache.org/guides/mini/guide-using-extensions.html. items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -1434,15 +1458,21 @@ spec: properties: dependencies: items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -1460,15 +1490,21 @@ spec: description: list of dependencies needed to run the application items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string diff --git a/config/crd/bases/camel.apache.org_camelcatalogs.yaml b/config/crd/bases/camel.apache.org_camelcatalogs.yaml index 6d13c21c5..4f75f02b6 100644 --- a/config/crd/bases/camel.apache.org_camelcatalogs.yaml +++ b/config/crd/bases/camel.apache.org_camelcatalogs.yaml @@ -85,6 +85,9 @@ spec: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string dataformats: description: accepted data formats items: @@ -98,6 +101,9 @@ spec: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string exclusions: description: provide a list of artifacts to exclude for this dependency @@ -119,6 +125,9 @@ spec: groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -179,6 +188,9 @@ spec: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string exclusions: description: provide a list of artifacts to exclude for this dependency @@ -200,6 +212,9 @@ spec: groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -231,6 +246,9 @@ spec: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string exclusions: description: provide a list of artifacts to exclude for this dependency @@ -252,6 +270,9 @@ spec: groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -267,6 +288,9 @@ spec: - passive type: object type: array + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -284,19 +308,28 @@ spec: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string dependencies: description: a list of additional dependencies required beside the base one items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -318,6 +351,9 @@ spec: type: string description: the metadata of the loader type: object + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -341,15 +377,21 @@ spec: properties: dependencies: items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -366,15 +408,21 @@ spec: dependencies: description: list of dependencies needed to run the application items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string diff --git a/config/crd/bases/camel.apache.org_integrationplatforms.yaml b/config/crd/bases/camel.apache.org_integrationplatforms.yaml index 97dc83d03..4d1fdf46a 100644 --- a/config/crd/bases/camel.apache.org_integrationplatforms.yaml +++ b/config/crd/bases/camel.apache.org_integrationplatforms.yaml @@ -195,15 +195,21 @@ spec: extension: description: The Maven build extensions. See https://maven.apache.org/guides/mini/guide-using-extensions.html. items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -2007,15 +2013,21 @@ spec: extension: description: The Maven build extensions. See https://maven.apache.org/guides/mini/guide-using-extensions.html. items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string diff --git a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc index c17c96335..83b136256 100644 --- a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc +++ b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc @@ -3918,7 +3918,7 @@ Language represents a supported language (Camel DSL). * <<#_camel_apache_org_v1_MavenSpec, MavenSpec>> * <<#_camel_apache_org_v1_RuntimeSpec, RuntimeSpec>> -MavenArtifact defines a GAV (Group:Artifact:Version) Maven artifact. +MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. [cols="2,2a",options="header"] |=== @@ -3939,6 +3939,13 @@ string Maven Artifact +|`type` + +string +| + + +Maven Type + |`version` + string | @@ -3946,6 +3953,13 @@ string Maven Version +|`classifier` + +string +| + + +Maven Classifier + |=== diff --git a/helm/camel-k/crds/crd-build.yaml b/helm/camel-k/crds/crd-build.yaml index 28f75654f..ae2925cd2 100644 --- a/helm/camel-k/crds/crd-build.yaml +++ b/helm/camel-k/crds/crd-build.yaml @@ -370,15 +370,21 @@ spec: extension: description: The Maven build extensions. See https://maven.apache.org/guides/mini/guide-using-extensions.html. items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -637,15 +643,21 @@ spec: properties: dependencies: items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -663,15 +675,21 @@ spec: description: list of dependencies needed to run the application items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -1167,15 +1185,21 @@ spec: extension: description: The Maven build extensions. See https://maven.apache.org/guides/mini/guide-using-extensions.html. items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -1434,15 +1458,21 @@ spec: properties: dependencies: items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -1460,15 +1490,21 @@ spec: description: list of dependencies needed to run the application items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string diff --git a/helm/camel-k/crds/crd-camel-catalog.yaml b/helm/camel-k/crds/crd-camel-catalog.yaml index 6d13c21c5..4f75f02b6 100644 --- a/helm/camel-k/crds/crd-camel-catalog.yaml +++ b/helm/camel-k/crds/crd-camel-catalog.yaml @@ -85,6 +85,9 @@ spec: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string dataformats: description: accepted data formats items: @@ -98,6 +101,9 @@ spec: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string exclusions: description: provide a list of artifacts to exclude for this dependency @@ -119,6 +125,9 @@ spec: groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -179,6 +188,9 @@ spec: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string exclusions: description: provide a list of artifacts to exclude for this dependency @@ -200,6 +212,9 @@ spec: groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -231,6 +246,9 @@ spec: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string exclusions: description: provide a list of artifacts to exclude for this dependency @@ -252,6 +270,9 @@ spec: groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -267,6 +288,9 @@ spec: - passive type: object type: array + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -284,19 +308,28 @@ spec: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string dependencies: description: a list of additional dependencies required beside the base one items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -318,6 +351,9 @@ spec: type: string description: the metadata of the loader type: object + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -341,15 +377,21 @@ spec: properties: dependencies: items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -366,15 +408,21 @@ spec: dependencies: description: list of dependencies needed to run the application items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string diff --git a/helm/camel-k/crds/crd-integration-platform.yaml b/helm/camel-k/crds/crd-integration-platform.yaml index 97dc83d03..4d1fdf46a 100644 --- a/helm/camel-k/crds/crd-integration-platform.yaml +++ b/helm/camel-k/crds/crd-integration-platform.yaml @@ -195,15 +195,21 @@ spec: extension: description: The Maven build extensions. See https://maven.apache.org/guides/mini/guide-using-extensions.html. items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string @@ -2007,15 +2013,21 @@ spec: extension: description: The Maven build extensions. See https://maven.apache.org/guides/mini/guide-using-extensions.html. items: - description: MavenArtifact defines a GAV (Group:Artifact:Version) + description: MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. properties: artifactId: description: Maven Artifact type: string + classifier: + description: Maven Classifier + type: string groupId: description: Maven Group type: string + type: + description: Maven Type + type: string version: description: Maven Version type: string diff --git a/pkg/apis/camel/v1/maven_types.go b/pkg/apis/camel/v1/maven_types.go index 1a017c5c6..e62ef46db 100644 --- a/pkg/apis/camel/v1/maven_types.go +++ b/pkg/apis/camel/v1/maven_types.go @@ -81,14 +81,18 @@ type RepositoryPolicy struct { ChecksumPolicy string `xml:"checksumPolicy,omitempty" json:"checksumPolicy,omitempty"` } -// MavenArtifact defines a GAV (Group:Artifact:Version) Maven artifact. +// MavenArtifact defines a GAV (Group:Artifact:Type:Version:Classifier) Maven artifact. type MavenArtifact struct { // Maven Group GroupID string `json:"groupId" yaml:"groupId" xml:"groupId"` // Maven Artifact ArtifactID string `json:"artifactId" yaml:"artifactId" xml:"artifactId"` + // Maven Type + Type string `json:"type,omitempty" yaml:"type,omitempty" xml:"type,omitempty"` // Maven Version Version string `json:"version,omitempty" yaml:"version,omitempty" xml:"version,omitempty"` + // Maven Classifier + Classifier string `json:"classifier,omitempty" yaml:"classifier,omitempty" xml:"classifier,omitempty"` } // Server see link:https://maven.apache.org/settings.html[Maven settings]. diff --git a/pkg/apis/camel/v1/maven_types_support.go b/pkg/apis/camel/v1/maven_types_support.go index 58cc86568..8f27571ed 100644 --- a/pkg/apis/camel/v1/maven_types_support.go +++ b/pkg/apis/camel/v1/maven_types_support.go @@ -22,12 +22,22 @@ import ( ) func (in *MavenArtifact) GetDependencyID() string { - switch { - case in.Version == "": - return "mvn:" + in.GroupID + ":" + in.ArtifactID - default: - return "mvn:" + in.GroupID + ":" + in.ArtifactID + ":" + in.Version + mvn := "mvn:" + in.GroupID + ":" + in.ArtifactID + if in.Classifier != "" { + if in.Version != "" { + mvn = mvn + ":" + in.Type + ":" + in.Version + ":" + in.Classifier + } else { + mvn = mvn + ":" + in.Type + "::" + in.Classifier + } + } else { + if in.Type != "" { + mvn = mvn + ":" + in.Type + } + if in.Version != "" { + mvn = mvn + ":" + in.Version + } } + return mvn } // nolint: musttag // the name of the xml is dynamic diff --git a/pkg/apis/camel/v1/maven_types_support_test.go b/pkg/apis/camel/v1/maven_types_support_test.go index 979e6f7e5..095b33a0a 100644 --- a/pkg/apis/camel/v1/maven_types_support_test.go +++ b/pkg/apis/camel/v1/maven_types_support_test.go @@ -140,3 +140,65 @@ func TestMarshalPluginPropertiesWithNestedProps(t *testing.T) { assert.Contains(t, result, "<prop2>baz</prop2>") assert.Contains(t, result, "<v2>bar</v2>") } + +func TestArtifactToString(t *testing.T) { + a1 := MavenArtifact{ + GroupID: "org.mygroup", + ArtifactID: "my-artifact", + } + assert.Equal(t, "mvn:org.mygroup:my-artifact", a1.GetDependencyID()) + + a2 := MavenArtifact{ + GroupID: "org.mygroup", + ArtifactID: "my-artifact", + Type: "jar", + Version: "1.2", + Classifier: "foo", + } + assert.Equal(t, "mvn:org.mygroup:my-artifact:jar:1.2:foo", a2.GetDependencyID()) + + a3 := MavenArtifact{ + GroupID: "org.mygroup", + ArtifactID: "my-artifact", + Version: "1.2", + } + assert.Equal(t, "mvn:org.mygroup:my-artifact:1.2", a3.GetDependencyID()) + + a4 := MavenArtifact{ + GroupID: "org.mygroup", + ArtifactID: "my-artifact", + Type: "jar", + Classifier: "foo", + } + assert.Equal(t, "mvn:org.mygroup:my-artifact:jar::foo", a4.GetDependencyID()) + + a5 := MavenArtifact{ + GroupID: "org.mygroup", + ArtifactID: "my-artifact", + Classifier: "foo", + Version: "1.2", + } + assert.Equal(t, "mvn:org.mygroup:my-artifact::1.2:foo", a5.GetDependencyID()) + + a6 := MavenArtifact{ + GroupID: "org.mygroup", + ArtifactID: "my-artifact", + Type: "bar", + Version: "2.2", + } + assert.Equal(t, "mvn:org.mygroup:my-artifact:bar:2.2", a6.GetDependencyID()) + + a7 := MavenArtifact{ + GroupID: "org.mygroup", + ArtifactID: "my-artifact", + Classifier: "foo", + } + assert.Equal(t, "mvn:org.mygroup:my-artifact:::foo", a7.GetDependencyID()) + + a8 := MavenArtifact{ + GroupID: "org.mygroup", + ArtifactID: "my-artifact", + Type: "jar", + } + assert.Equal(t, "mvn:org.mygroup:my-artifact:jar", a8.GetDependencyID()) +} diff --git a/pkg/client/camel/applyconfiguration/camel/v1/camelartifact.go b/pkg/client/camel/applyconfiguration/camel/v1/camelartifact.go index 5adc2bb89..e35526d9e 100644 --- a/pkg/client/camel/applyconfiguration/camel/v1/camelartifact.go +++ b/pkg/client/camel/applyconfiguration/camel/v1/camelartifact.go @@ -52,6 +52,14 @@ func (b *CamelArtifactApplyConfiguration) WithArtifactID(value string) *CamelArt return b } +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *CamelArtifactApplyConfiguration) WithType(value string) *CamelArtifactApplyConfiguration { + b.Type = &value + return b +} + // WithVersion sets the Version field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Version field is set to the value of the last call. @@ -60,6 +68,14 @@ func (b *CamelArtifactApplyConfiguration) WithVersion(value string) *CamelArtifa return b } +// WithClassifier sets the Classifier field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Classifier field is set to the value of the last call. +func (b *CamelArtifactApplyConfiguration) WithClassifier(value string) *CamelArtifactApplyConfiguration { + b.Classifier = &value + return b +} + // WithExclusions adds the given value to the Exclusions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Exclusions field. diff --git a/pkg/client/camel/applyconfiguration/camel/v1/camelartifactdependency.go b/pkg/client/camel/applyconfiguration/camel/v1/camelartifactdependency.go index 2d38809af..e067dd2c5 100644 --- a/pkg/client/camel/applyconfiguration/camel/v1/camelartifactdependency.go +++ b/pkg/client/camel/applyconfiguration/camel/v1/camelartifactdependency.go @@ -48,6 +48,14 @@ func (b *CamelArtifactDependencyApplyConfiguration) WithArtifactID(value string) return b } +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *CamelArtifactDependencyApplyConfiguration) WithType(value string) *CamelArtifactDependencyApplyConfiguration { + b.Type = &value + return b +} + // WithVersion sets the Version field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Version field is set to the value of the last call. @@ -56,6 +64,14 @@ func (b *CamelArtifactDependencyApplyConfiguration) WithVersion(value string) *C return b } +// WithClassifier sets the Classifier field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Classifier field is set to the value of the last call. +func (b *CamelArtifactDependencyApplyConfiguration) WithClassifier(value string) *CamelArtifactDependencyApplyConfiguration { + b.Classifier = &value + return b +} + // WithExclusions adds the given value to the Exclusions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Exclusions field. diff --git a/pkg/client/camel/applyconfiguration/camel/v1/camelloader.go b/pkg/client/camel/applyconfiguration/camel/v1/camelloader.go index 9ebf7d1e4..7cd291bcd 100644 --- a/pkg/client/camel/applyconfiguration/camel/v1/camelloader.go +++ b/pkg/client/camel/applyconfiguration/camel/v1/camelloader.go @@ -50,6 +50,14 @@ func (b *CamelLoaderApplyConfiguration) WithArtifactID(value string) *CamelLoade return b } +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *CamelLoaderApplyConfiguration) WithType(value string) *CamelLoaderApplyConfiguration { + b.Type = &value + return b +} + // WithVersion sets the Version field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Version field is set to the value of the last call. @@ -58,6 +66,14 @@ func (b *CamelLoaderApplyConfiguration) WithVersion(value string) *CamelLoaderAp return b } +// WithClassifier sets the Classifier field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Classifier field is set to the value of the last call. +func (b *CamelLoaderApplyConfiguration) WithClassifier(value string) *CamelLoaderApplyConfiguration { + b.Classifier = &value + return b +} + // WithLanguages adds the given value to the Languages field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Languages field. diff --git a/pkg/client/camel/applyconfiguration/camel/v1/mavenartifact.go b/pkg/client/camel/applyconfiguration/camel/v1/mavenartifact.go index 22d77c9d5..485ae5b12 100644 --- a/pkg/client/camel/applyconfiguration/camel/v1/mavenartifact.go +++ b/pkg/client/camel/applyconfiguration/camel/v1/mavenartifact.go @@ -24,7 +24,9 @@ package v1 type MavenArtifactApplyConfiguration struct { GroupID *string `json:"groupId,omitempty"` ArtifactID *string `json:"artifactId,omitempty"` + Type *string `json:"type,omitempty"` Version *string `json:"version,omitempty"` + Classifier *string `json:"classifier,omitempty"` } // MavenArtifactApplyConfiguration constructs an declarative configuration of the MavenArtifact type for use with @@ -49,6 +51,14 @@ func (b *MavenArtifactApplyConfiguration) WithArtifactID(value string) *MavenArt return b } +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *MavenArtifactApplyConfiguration) WithType(value string) *MavenArtifactApplyConfiguration { + b.Type = &value + return b +} + // WithVersion sets the Version field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Version field is set to the value of the last call. @@ -56,3 +66,11 @@ func (b *MavenArtifactApplyConfiguration) WithVersion(value string) *MavenArtifa b.Version = &value return b } + +// WithClassifier sets the Classifier field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Classifier field is set to the value of the last call. +func (b *MavenArtifactApplyConfiguration) WithClassifier(value string) *MavenArtifactApplyConfiguration { + b.Classifier = &value + return b +} diff --git a/pkg/resources/resources.go b/pkg/resources/resources.go index 09dc7fdcf..6f56683f8 100644 --- a/pkg/resources/resources.go +++ b/pkg/resources/resources.go @@ -117,44 +117,44 @@ var assets = func() http.FileSystem { "/crd/bases/camel.apache.org_builds.yaml": &vfsgen۰CompressedFileInfo{ name: "camel.apache.org_builds.yaml", modTime: time.Time{}, - uncompressedSize: 98647, + uncompressedSize: 100675, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\x5d\x93\xdb\x38\x92\xe0\x7b\xfd\x8a\x8c\xf6\x83\xcb\x11\x92\x6a\xc6\xdd\x3b\xdb\x5b\x17\x1b\x17\xb5\xe5\xee\xd9\x1a\x77\xdb\x5e\xab\xec\xe9\x89\x8d\x8d\x28\x88\x4c\x49\x68\x91\x00\x0f\x00\x4b\x56\x5f\xdc\x7f\xbf\xc0\x17\x45\x4a\x22\x09\xa8\x24\xdb\x13\x26\x5e\xba\xad\x22\x12\x99\xf8\xc8\x2f\x24\x32\x9f\xc1\xf8\x74\xed\xe2\x19\xfc\x42\x13\x64\x12\x53\x50\x1c\xd4\x12\xe1\xa6\x20\xc9\x12\x61\xca\xe7\x6a\x4d\x04\x [...] + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\x5d\x73\x1b\xb7\x92\xe8\xbb\x7e\x45\x57\xfc\x60\xb9\x4a\xa4\x12\x27\x7b\x36\xab\x5b\x5b\xb7\xb4\x72\x72\x56\xc7\xf1\xc7\x9a\xb2\x4f\x4e\x6d\x6d\x95\xc0\x99\x26\x89\x70\x06\x98\x0b\x60\x44\x33\xb7\xee\x7f\xbf\x85\xaf\xe1\x0c\xc9\x99\x01\x28\xd2\xf2\x29\x0f\x5e\x12\x53\x18\xa0\xbb\x01\xf4\x17\x1a\xdd\xcf\x60\x74\xbc\x76\xf6\x0c\x7e\xa3\x09\x32\x89\x29\x28\x0e\x6a\x81\x70\x5d\x90\x64\x81\x30\xe1\x33\xb5\x22\x02\x [...] }, "/crd/bases/camel.apache.org_camelcatalogs.yaml": &vfsgen۰CompressedFileInfo{ name: "camel.apache.org_camelcatalogs.yaml", modTime: time.Time{}, - uncompressedSize: 20192, + uncompressedSize: 22396, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5c\xdd\x73\xe3\xb6\x11\x7f\xd7\x5f\xb1\x73\x7e\xb8\xbb\x19\x49\x4e\xda\x4e\xa6\xa3\x3e\xb9\xf6\x5d\xa2\xc6\xb1\xaf\x96\xee\x32\x99\xe9\xcb\x8a\x5c\x49\x88\x49\x80\x05\x40\xe9\x94\x4e\xff\xf7\x0e\x00\x7e\x4a\xfc\x00\x65\xdf\x64\xae\x31\x9e\x24\x12\x58\xfc\xb0\xbb\xd8\x2f\x12\xbc\x80\xc9\xf3\xb5\xd1\x05\xdc\xb2\x80\xb8\xa2\x10\xb4\x00\xbd\x25\xb8\x4a\x30\xd8\x12\x2c\xc4\x5a\xef\x51\x12\xbc\x17\x29\x0f\x51\x33\xc1\x [...] + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5c\xdd\x8f\xe3\xb6\x11\x7f\xf7\x5f\x31\xb8\x7d\xb8\x3b\xc0\xf6\x26\x6d\x11\x14\xee\xd3\x76\xf7\x2e\x71\xb3\xd9\xbd\xae\x7d\x17\x04\xe8\x0b\x2d\x8d\x65\x66\x25\x52\x25\x29\xfb\x9c\xa2\xff\x7b\x41\x52\xd4\x87\xad\x0f\xca\xde\xcb\x47\x61\x3e\xd9\x12\x39\xfc\x71\x66\x38\x5f\x92\x78\x05\x93\x97\x6b\xa3\x2b\xb8\xa7\x01\x32\x89\x21\x28\x0e\x6a\x83\x70\x93\x92\x60\x83\xb0\xe0\x6b\xb5\x23\x02\xe1\x3d\xcf\x58\x48\x14\xe5\x [...] }, "/crd/bases/camel.apache.org_integrationkits.yaml": &vfsgen۰CompressedFileInfo{ name: "camel.apache.org_integrationkits.yaml", modTime: time.Time{}, - uncompressedSize: 26023, + uncompressedSize: 26309, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x3c\x5d\x6f\xe3\xb6\xb2\xef\xfe\x15\x83\xcd\xc3\x26\x80\xed\xb4\xbd\x45\x71\xe1\xd3\xbb\x40\x9a\xdd\xed\xc9\xd9\xec\x6e\x6e\x9c\x6d\x71\x70\x7a\x00\xd3\xd2\xd8\xe6\x5a\x22\x55\x92\x72\xe2\xfb\xf1\xdf\x2f\x38\x24\xf5\x61\x4b\xb2\xe2\x6c\x7a\xdb\x83\xea\x25\xb1\x44\x0e\x87\x33\xc3\xf9\xe2\x90\x27\x30\xfa\x72\xcf\xe0\x04\xae\x79\x84\x42\x63\x0c\x46\x82\x59\x21\x5c\x64\x2c\x5a\x21\x4c\xe5\xc2\xdc\x33\x85\xf0\x56\xe6\x [...] + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x3c\x5d\x6f\xe3\xb6\xb2\xef\xfe\x15\x83\xcd\xc3\x26\x80\xed\xb4\xbd\x45\x71\xe1\xd3\xbb\x40\x9a\xdd\xed\xc9\xd9\xec\x6e\x6e\x9c\x6d\x71\x70\x7a\x00\xd3\xd2\xd8\xe6\x5a\x22\x55\x92\x72\xe2\xfb\xf1\xdf\x2f\x38\x24\xf5\x61\x4b\xb2\xe2\x6c\x7a\xdb\x83\xea\x25\xb1\x44\x0e\x87\x33\xc3\xf9\xe2\x90\x27\x30\xfa\x72\xcf\xe0\x04\xae\x79\x84\x42\x63\x0c\x46\x82\x59\x21\x5c\x64\x2c\x5a\x21\x4c\xe5\xc2\xdc\x33\x85\xf0\x56\xe6\x [...] }, "/crd/bases/camel.apache.org_integrationplatforms.yaml": &vfsgen۰CompressedFileInfo{ name: "camel.apache.org_integrationplatforms.yaml", modTime: time.Time{}, - uncompressedSize: 201010, + uncompressedSize: 202162, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\xff\x73\xdb\x36\xd2\xf7\xef\xfd\x2b\x30\xee\x3c\x63\xa7\xa3\x2f\x49\xef\x69\xaf\x8f\x9f\xeb\xbd\xaf\xeb\xa4\xad\x9b\x38\xf6\x6b\x3b\xb9\xbb\x69\x3b\x15\x44\xae\x24\xc4\x24\xc0\x03\x40\xd9\xea\xdc\x1f\xff\x0e\x16\x00\x49\x49\x14\x48\x7d\xb1\xe3\xb4\x62\x67\x1a\x4b\x22\xc1\x05\xb0\xd8\x5d\x2c\x76\x3f\xfb\x39\xe9\xee\xee\xfa\xec\x73\xf2\x86\x45\xc0\x15\xc4\x44\x0b\xa2\x27\x40\x4e\x32\x1a\x4d\x80\x5c\x8b\x91\xbe\x [...] + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\xfb\x73\xdb\x36\xb6\xf0\xef\xfd\x2b\x30\xee\xdc\xb1\xd3\xd1\x23\xe9\xde\xee\xf6\xfa\x6e\xf7\xfb\x5c\x27\x6d\xdd\xc4\xb1\x3f\xdb\xc9\xde\x9d\xb6\x53\x41\xe4\x91\x84\x98\x04\x78\x01\x50\xb6\x3a\xfb\xc7\x7f\x83\x03\x80\xa4\x24\x0a\xa4\x1e\x76\x9c\x54\xec\x4c\x63\x49\x24\x78\x70\x70\x70\x5e\x38\x8f\x2f\x49\x77\x77\xd7\x17\x5f\x92\x37\x2c\x02\xae\x20\x26\x5a\x10\x3d\x01\x72\x92\xd1\x68\x02\xe4\x5a\x8c\xf4\x1d\x95\x [...] }, "/crd/bases/camel.apache.org_integrations.yaml": &vfsgen۰CompressedFileInfo{ name: "camel.apache.org_integrations.yaml", modTime: time.Time{}, - uncompressedSize: 518637, + uncompressedSize: 518923, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xfd\x7b\x73\x1b\x37\x96\x30\x8c\xff\x9f\x4f\x81\xb2\x53\x8f\xa4\x8d\x48\xd9\x99\xd9\xa9\x1d\xff\xa6\x9e\x94\x56\x96\x13\xfd\x62\xcb\x2a\x49\x49\x9e\x94\x93\x4d\xc0\x6e\x90\xc4\xa3\x6e\xa0\x17\x40\x53\xe2\xbc\x7e\xbf\xfb\x5b\x38\x00\xfa\xc2\x5b\x1f\xb4\x44\xc7\x99\x6d\x4c\x55\xc6\x14\xd9\xa7\x71\x39\x38\xf7\xcb\x73\x32\x7a\xba\xf1\xc5\x73\xf2\x96\x27\x4c\x68\x96\x12\x23\x89\x99\x33\x72\x5a\xd0\x64\xce\xc8\x8d\x9c\x [...] + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xfd\x7b\x73\x1b\x37\x96\x30\x8c\xff\x9f\x4f\x81\xb2\x53\x8f\xa4\x8d\x48\xd9\x99\xd9\xa9\x1d\xff\xa6\x9e\x94\x56\x96\x13\xfd\x62\xcb\x2a\x49\x49\x9e\x94\x93\x4d\xc0\x6e\x90\xc4\xa3\x6e\xa0\x17\x40\x53\xe2\xbc\x7e\xbf\xfb\x5b\x38\x00\xfa\xc2\x5b\x1f\xb4\x44\xc7\x99\x6d\x4c\x55\xc6\x14\xd9\xa7\x71\x39\x38\xf7\xcb\x73\x32\x7a\xba\xf1\xc5\x73\xf2\x96\x27\x4c\x68\x96\x12\x23\x89\x99\x33\x72\x5a\xd0\x64\xce\xc8\x8d\x9c\x [...] }, "/crd/bases/camel.apache.org_kameletbindings.yaml": &vfsgen۰CompressedFileInfo{ name: "camel.apache.org_kameletbindings.yaml", modTime: time.Time{}, - uncompressedSize: 600179, + uncompressedSize: 600489, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xfd\x6b\x73\x1b\x37\xb6\x30\x0a\x7f\xf7\xaf\x40\xd9\xa9\x47\xd2\x0e\x49\xd9\x99\x99\xd4\x8c\xdf\xa9\x9d\xd2\xc8\x72\xa2\x37\xb6\xcc\xb2\x94\xe4\x49\x39\xd9\x09\xd8\x0d\x92\xd8\xea\x06\x7a\x00\x34\x25\xe6\xf8\xfc\xf7\x53\x58\x00\xfa\xc2\x9b\xb0\x9a\x92\xc6\x9e\x69\x4c\x55\xc6\xa4\xd8\xab\x71\x59\x58\xf7\xcb\x33\x32\xbc\xbf\xf1\xe4\x19\x79\xc3\x13\x26\x34\x4b\x89\x91\xc4\xcc\x19\x39\x29\x68\x32\x67\xe4\x52\x4e\xcd\x [...] + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xfd\x6b\x73\x1b\x37\xb6\x30\x0a\x7f\xf7\xaf\x40\xd9\xa9\x47\xd2\x0e\x49\xd9\x99\x99\xd4\x8c\xdf\xa9\x9d\xd2\xc8\x72\xa2\x37\xb6\xcc\xb2\x94\xe4\x49\x39\xd9\x09\xd8\x0d\x92\xd8\xea\x06\x7a\x00\x34\x25\xe6\xf8\xfc\xf7\x53\x58\x00\xfa\xc2\x9b\xb0\x9a\x92\xc6\x9e\x69\x4c\x55\xc6\xa4\xd8\xab\x71\x59\x58\xf7\xcb\x33\x32\xbc\xbf\xf1\xe4\x19\x79\xc3\x13\x26\x34\x4b\x89\x91\xc4\xcc\x19\x39\x29\x68\x32\x67\xe4\x52\x4e\xcd\x [...] }, "/crd/bases/camel.apache.org_kamelets.yaml": &vfsgen۰CompressedFileInfo{ name: "camel.apache.org_kamelets.yaml", @@ -166,9 +166,9 @@ var assets = func() http.FileSystem { "/crd/bases/camel.apache.org_pipes.yaml": &vfsgen۰CompressedFileInfo{ name: "camel.apache.org_pipes.yaml", modTime: time.Time{}, - uncompressedSize: 567557, + uncompressedSize: 567867, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xfd\x7b\x73\x1b\x37\xb6\x28\x8a\xff\x9f\x4f\x81\x92\x53\x47\xd2\x8e\x48\xd9\x99\x99\xd4\x1e\xff\xa6\x4e\x4a\x5b\x96\x13\xfd\x62\xcb\x2c\x49\x49\x4e\xca\xc9\x4e\xc0\x6e\x90\xc4\x51\x37\xd0\x1b\x40\x53\x62\xae\xef\x77\xbf\x85\x05\xa0\x1f\x7c\x09\xab\x29\x69\xe4\x99\xc6\x54\x65\x4c\x8a\xbd\x1a\x8f\x85\xf5\x7e\xbc\x20\x83\x87\x1b\x5f\xbc\x20\xef\x78\xc2\x84\x66\x29\x31\x92\x98\x19\x23\x27\x05\x4d\x66\x8c\x5c\xc9\x89\x [...] + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xfd\x7b\x73\x1b\x37\xb6\x28\x8a\xff\x9f\x4f\x81\x92\x53\x47\xd2\x8e\x48\xd9\x99\x99\xd4\x1e\xff\xa6\x4e\x4a\x5b\x96\x13\xfd\x62\xcb\x2c\x49\x49\x4e\xca\xc9\x4e\xc0\x6e\x90\xc4\x51\x37\xd0\x1b\x40\x53\x62\xae\xef\x77\xbf\x85\x05\xa0\x1f\x7c\x09\xab\x29\x69\xe4\x99\xc6\x54\x65\x4c\x8a\xbd\x1a\x8f\x85\xf5\x7e\xbc\x20\x83\x87\x1b\x5f\xbc\x20\xef\x78\xc2\x84\x66\x29\x31\x92\x98\x19\x23\x27\x05\x4d\x66\x8c\x5c\xc9\x89\x [...] }, "/manager": &vfsgen۰DirInfo{ name: "manager", @@ -753,9 +753,9 @@ var assets = func() http.FileSystem { "/traits.yaml": &vfsgen۰CompressedFileInfo{ name: "traits.yaml", modTime: time.Time{}, - uncompressedSize: 73766, + uncompressedSize: 74029, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xbd\xfb\x73\x1c\xb9\x91\x30\xf8\xbb\xfe\x0a\x44\xcf\x7d\x41\x52\xd7\x0f\x4a\xfe\xec\x9d\xe5\x5a\xb3\xc7\xd1\x68\x6c\x7a\xf4\xe0\x89\x9c\xf1\xe7\xd0\x29\xdc\xe8\x2a\x74\x37\xc4\x6a\xa0\x06\x40\x91\xea\xb9\xbd\xff\xfd\x02\x99\x89\x47\x55\x57\xb3\x9b\x12\x29\x5b\xdf\x7a\x37\xc2\x23\x92\x05\x20\x91\x48\x24\xf2\x9d\xdf\xb0\xd1\xfd\xfd\xdf\xa3\x6f\xd8\x4b\x59\x08\x65\x45\xc9\x9c\x66\x6e\x29\xd8\x69\xcd\x8b\xa5\x60\x17\x [...] + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xbd\x6b\x73\x1c\xb9\x91\x00\xf8\x5d\xbf\x02\xc1\xb9\x0d\x92\xba\x7e\x50\xf2\xda\x3b\xcb\xb5\x66\x8f\xa3\xd1\x8c\x69\x49\x14\x4f\xe4\xcc\xac\x43\xa7\x70\xa3\xab\xd0\xdd\x10\xab\x81\x32\x80\x22\xd5\x73\x7b\xff\xfd\x02\x99\x89\x47\x55\x57\xb3\x9b\x12\x29\x5b\xbb\xde\x8d\xf0\x88\x64\x01\x48\x24\x12\x89\x7c\xe7\x37\x6c\x78\x7f\xff\xf7\xe8\x1b\xf6\x4a\x16\x42\x59\x51\x32\xa7\x99\x5b\x08\x76\x52\xf3\x62\x21\xd8\x85\x9e\x [...] }, } fs["/"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ diff --git a/pkg/trait/jolokia.go b/pkg/trait/jolokia.go index 057fa71e8..fa79ffea7 100644 --- a/pkg/trait/jolokia.go +++ b/pkg/trait/jolokia.go @@ -55,16 +55,6 @@ func (t *jolokiaTrait) Configure(e *Environment) (bool, *TraitCondition, error) func (t *jolokiaTrait) Apply(e *Environment) error { if e.IntegrationInPhase(v1.IntegrationPhaseInitialization) { util.StringSliceUniqueAdd(&e.Integration.Status.Capabilities, v1.CapabilityJolokia) - - // Deprecated - // remove dependencies after Camel K Runtime > 2.16.0 and no longer supported or LTS - if e.CamelCatalog.Runtime.Provider == v1.RuntimeProviderQuarkus { - util.StringSliceUniqueAdd(&e.Integration.Status.Dependencies, "camel-quarkus:management") - util.StringSliceUniqueAdd(&e.Integration.Status.Dependencies, "camel:jaxb") - } - util.StringSliceUniqueAdd(&e.Integration.Status.Dependencies, "mvn:org.jolokia:jolokia-jvm") - // - return nil } @@ -124,7 +114,7 @@ func (t *jolokiaTrait) Apply(e *Environment) error { jolokiaFilepath := "" for _, ar := range e.IntegrationKit.Status.Artifacts { - if strings.HasPrefix(ar.ID, "org.jolokia.jolokia-jvm") { + if strings.HasPrefix(ar.ID, "org.jolokia.jolokia-agent-jvm") || strings.HasPrefix(ar.ID, "org.jolokia.jolokia-jvm") { jolokiaFilepath = ar.Target break } diff --git a/pkg/trait/jolokia_test.go b/pkg/trait/jolokia_test.go index f0210e5d0..5d258903c 100644 --- a/pkg/trait/jolokia_test.go +++ b/pkg/trait/jolokia_test.go @@ -52,7 +52,7 @@ func TestApplyJolokiaTraitNominalShouldSucceed(t *testing.T) { assert.NotNil(t, container) assert.Equal(t, container.Args, []string{ - "-javaagent:dependencies/lib/main/org.jolokia.jolokia-jvm-1.7.1.jar=discoveryEnabled=false,host=*,port=8778", + "-javaagent:dependencies/lib/main/org.jolokia.jolokia-agent-jvm-1.7.1.jar=discoveryEnabled=false,host=*,port=8778", }) assert.Len(t, container.Ports, 1) @@ -79,7 +79,7 @@ func TestApplyJolokiaTraitForOpenShiftProfileShouldSucceed(t *testing.T) { assert.NotNil(t, container) assert.Equal(t, container.Args, []string{ - "-javaagent:dependencies/lib/main/org.jolokia.jolokia-jvm-1.7.1.jar=caCert=/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt," + + "-javaagent:dependencies/lib/main/org.jolokia.jolokia-agent-jvm-1.7.1.jar=caCert=/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt," + "clientPrincipal.1=cn=system:master-proxy,clientPrincipal.2=cn=hawtio-online.hawtio.svc," + "clientPrincipal.3=cn=fuse-console.fuse.svc,discoveryEnabled=false,extendedClientCheck=true," + "host=*,port=8778,protocol=https,useSslClientAuthentication=true", @@ -129,7 +129,7 @@ func TestApplyJolokiaTraitWithOptionShouldOverrideDefault(t *testing.T) { container := environment.Resources.GetContainerByName(defaultContainerName) assert.Equal(t, container.Args, []string{ - "-javaagent:dependencies/lib/main/org.jolokia.jolokia-jvm-1.7.1.jar=caCert=.cacert,clientPrincipal=cn:any," + + "-javaagent:dependencies/lib/main/org.jolokia.jolokia-agent-jvm-1.7.1.jar=caCert=.cacert,clientPrincipal=cn:any," + "discoveryEnabled=true,extendedClientCheck=false,host=explicit-host,port=8778,protocol=http," + "useSslClientAuthentication=false", }) @@ -285,8 +285,8 @@ func createNominalJolokiaTest() (*jolokiaTrait, *Environment) { Status: v1.IntegrationKitStatus{ Artifacts: []v1.Artifact{ { - ID: "org.jolokia.jolokia-jvm-1.7.1.jar", - Target: "dependencies/lib/main/org.jolokia.jolokia-jvm-1.7.1.jar", + ID: "org.jolokia.jolokia-agent-jvm-1.7.1.jar", + Target: "dependencies/lib/main/org.jolokia.jolokia-agent-jvm-1.7.1.jar", }, }, }, diff --git a/pkg/util/camel/camel_dependencies.go b/pkg/util/camel/camel_dependencies.go index 684b4403c..535f1fe33 100644 --- a/pkg/util/camel/camel_dependencies.go +++ b/pkg/util/camel/camel_dependencies.go @@ -298,6 +298,8 @@ func addDependenciesFromCatalog(project *maven.Project, catalog *RuntimeCatalog) md := maven.Dependency{ GroupID: dep.GroupID, ArtifactID: dep.ArtifactID, + Type: dep.Type, + Classifier: dep.Classifier, } project.AddDependency(md) diff --git a/pkg/util/jitpack/jitpack_test.go b/pkg/util/jitpack/jitpack_test.go index 7ea911931..fd1c10c70 100644 --- a/pkg/util/jitpack/jitpack_test.go +++ b/pkg/util/jitpack/jitpack_test.go @@ -45,11 +45,11 @@ func TestConversion(t *testing.T) { d = ToDependency(val.prefixID + ":u") assert.Nil(t, d) - d = ToDependency(val.prefixID + ":u/r/v") + d = ToDependency(val.prefixID + ":u/r/v-1.2") assert.NotNil(t, d) assert.Equal(t, val.prefixGav+".u", d.GroupID) assert.Equal(t, "r", d.ArtifactID) - assert.Equal(t, "v", d.Version) + assert.Equal(t, "v-1.2", d.Version) d = ToDependency(val.prefixID + ":u/r") assert.NotNil(t, d) diff --git a/pkg/util/maven/maven_command.go b/pkg/util/maven/maven_command.go index fc4707573..54fb1503d 100644 --- a/pkg/util/maven/maven_command.go +++ b/pkg/util/maven/maven_command.go @@ -257,33 +257,35 @@ func (c *Command) prepareMavenWrapper(ctx context.Context) error { // // The artifact id is in the form of: // -// <groupId>:<artifactId>[:<packagingType>[:<classifier>]]:(<version>|'?') +// <groupId>:<artifactId>[:<packagingType>]:(<version>)[:<classifier>] func ParseGAV(gav string) (Dependency, error) { - // <groupId>:<artifactId>[:<packagingType>[:<classifier>]]:(<version>|'?') dep := Dependency{} - rex := regexp.MustCompile("([^: ]+):([^: ]+)(:([^: ]*)(:([^: ]+))?)?(:([^: ]+))?") - res := rex.FindStringSubmatch(gav) - - if res == nil || len(res) < 9 { - return Dependency{}, errors.New("GAV must match <groupId>:<artifactId>[:<packagingType>[:<classifier>]]:(<version>|'?')") + res := strings.Split(gav, ":") + count := len(res) + if res == nil || count < 2 { + return Dependency{}, errors.New("GAV must match <groupId>:<artifactId>[:<packagingType>]:(<version>)[:<classifier>]") } - - dep.GroupID = res[1] - dep.ArtifactID = res[2] - - cnt := strings.Count(gav, ":") - switch cnt { - case 2: - dep.Version = res[4] - case 3: - dep.Type = res[4] - dep.Version = res[6] - default: - dep.Type = res[4] - dep.Classifier = res[6] - dep.Version = res[8] + dep.GroupID = res[0] + dep.ArtifactID = res[1] + switch { + case count == 3: + // gav is: org:artifact:<type:version> + numeric := regexp.MustCompile(`\d`) + if numeric.MatchString(res[2]) { + dep.Version = res[2] + } else { + dep.Type = res[2] + } + case count == 4: + // gav is: org:artifact:type:version + dep.Type = res[2] + dep.Version = res[3] + case count == 5: + // gav is: org:artifact:<type>:<version>:classifier + dep.Type = res[2] + dep.Version = res[3] + dep.Classifier = res[4] } - return dep, nil } diff --git a/pkg/util/maven/maven_project_test.go b/pkg/util/maven/maven_project_test.go index 28cf334ac..cf9adbb1d 100644 --- a/pkg/util/maven/maven_project_test.go +++ b/pkg/util/maven/maven_project_test.go @@ -140,51 +140,76 @@ func TestPomGeneration(t *testing.T) { assert.Equal(t, expectedPom, string(pom)) } -func TestParseSimpleGAV(t *testing.T) { +func TestParseGAV(t *testing.T) { dep, err := ParseGAV("org.apache.camel:camel-core:2.21.1") - assert.Nil(t, err) assert.Equal(t, dep.GroupID, "org.apache.camel") assert.Equal(t, dep.ArtifactID, "camel-core") + assert.Empty(t, dep.Type) assert.Equal(t, dep.Version, "2.21.1") - assert.Equal(t, dep.Type, "") - assert.Equal(t, dep.Classifier, "") -} - -func TestParseGAVWithType(t *testing.T) { - dep, err := ParseGAV("org.apache.camel:camel-core:war:2.21.1") + assert.Empty(t, dep.Classifier) + dep, err = ParseGAV("org.apache.camel:camel-core:war:2.21.1") assert.Nil(t, err) assert.Equal(t, dep.GroupID, "org.apache.camel") assert.Equal(t, dep.ArtifactID, "camel-core") - assert.Equal(t, dep.Version, "2.21.1") assert.Equal(t, dep.Type, "war") - assert.Equal(t, dep.Classifier, "") -} - -func TestParseGAVWithClassifierAndType(t *testing.T) { - dep, err := ParseGAV("org.apache.camel:camel-core:war:test:2.21.1") + assert.Equal(t, dep.Version, "2.21.1") + assert.Empty(t, dep.Classifier) + dep, err = ParseGAV("org.apache.camel:camel-core:war:2.21.1:test") assert.Nil(t, err) assert.Equal(t, dep.GroupID, "org.apache.camel") assert.Equal(t, dep.ArtifactID, "camel-core") - assert.Equal(t, dep.Version, "2.21.1") assert.Equal(t, dep.Type, "war") + assert.Equal(t, dep.Version, "2.21.1") assert.Equal(t, dep.Classifier, "test") -} - -func TestParseGAVMvnNoVersion(t *testing.T) { - dep, err := ParseGAV("org.apache.camel:camel-core") + dep, err = ParseGAV("org.apache.camel:camel-core") assert.Nil(t, err) assert.Equal(t, dep.GroupID, "org.apache.camel") assert.Equal(t, dep.ArtifactID, "camel-core") + assert.Empty(t, dep.Type) + assert.Empty(t, dep.Version) + assert.Empty(t, dep.Classifier) + + dep, err = ParseGAV("org.apache.camel:camel-k-core:jar::custom") + assert.Nil(t, err) + assert.Equal(t, dep.GroupID, "org.apache.camel") + assert.Equal(t, dep.ArtifactID, "camel-k-core") + assert.Equal(t, dep.Type, "jar") + assert.Empty(t, dep.Version) + assert.Equal(t, dep.Classifier, "custom") + // + dep, err = ParseGAV("org.apache.camel:camel-k-core::1.2.3:foo") + assert.Nil(t, err) + assert.Equal(t, dep.GroupID, "org.apache.camel") + assert.Equal(t, dep.ArtifactID, "camel-k-core") + assert.Empty(t, dep.Type) + assert.Equal(t, dep.Version, "1.2.3") + assert.Equal(t, dep.Classifier, "foo") + + dep, err = ParseGAV("org.apache.camel:camel-k-core:::custom") + assert.Nil(t, err) + assert.Equal(t, dep.GroupID, "org.apache.camel") + assert.Equal(t, dep.ArtifactID, "camel-k-core") + assert.Empty(t, dep.Type) + assert.Empty(t, dep.Version) + assert.Equal(t, dep.Classifier, "custom") + + dep, err = ParseGAV("org.apache.camel:camel-k-core:jar") + assert.Nil(t, err) + assert.Equal(t, dep.GroupID, "org.apache.camel") + assert.Equal(t, dep.ArtifactID, "camel-k-core") + assert.Equal(t, dep.Type, "jar") + assert.Empty(t, dep.Version) + assert.Empty(t, dep.Classifier) } func TestParseGAVErrorNoColumn(t *testing.T) { dep, err := ParseGAV("org.apache.camel.k.camel-k-runtime-noop-0.2.1-SNAPSHOT.jar") - assert.EqualError(t, err, "GAV must match <groupId>:<artifactId>[:<packagingType>[:<classifier>]]:(<version>|'?')") + assert.EqualError(t, err, "GAV must match <groupId>:<artifactId>[:<packagingType>]:(<version>)[:<classifier>]") assert.Equal(t, Dependency{}, dep) }