astefanutti commented on a change in pull request #2383:
URL: https://github.com/apache/camel-k/pull/2383#discussion_r648378320
##########
File path: pkg/apis/camel/v1/maven_types.go
##########
@@ -32,3 +32,10 @@ type RepositoryPolicy struct {
UpdatePolicy string `xml:"updatePolicy,omitempty"
json:"updatePolicy,omitempty"`
ChecksumPolicy string `xml:"checksumPolicy,omitempty"
json:"checksumPolicy,omitempty"`
}
+
+// Build Extension
+type Extension struct {
Review comment:
Can't we just embed the existing `MavenArtifact` struct?
##########
File path: pkg/apis/camel/v1/common_types.go
##########
@@ -105,6 +105,8 @@ type MavenSpec struct {
// Deprecated: use IntegrationPlatform.Spec.Build.Timeout instead
Timeout *metav1.Duration `json:"timeout,omitempty"`
Repositories []Repository `json:"repositories,omitempty"`
+ // Maven build extensions
Review comment:
Could we elaborate a bit the documentation, or that is straighforward?
##########
File path: pkg/cmd/install.go
##########
@@ -321,6 +323,26 @@ func (o *installCmdOptions) install(cobraCmd
*cobra.Command, _ []string) error {
}
}
}
+
+ if size := len(o.MavenBuildExtension); size > 0 {
+ platform.Spec.Build.Maven.Extension =
make([]v1.Extension, 0, size)
+ for _, extension := range o.MavenBuildExtension {
+ gav := strings.Split(extension, ":")
Review comment:
I think we already have some util methods that parse GAV somewhere.
##########
File path: pkg/cmd/install.go
##########
@@ -114,6 +114,7 @@ func newCmdInstall(rootCmdOptions *RootCmdOptions)
(*cobra.Command, *installCmdO
// Maven
cmd.Flags().String("maven-local-repository", "", "Path of the local
Maven repository")
cmd.Flags().StringArray("maven-property", nil, "Add a Maven property")
+ cmd.Flags().StringArray("maven-build-extension", nil, "Add a Maven
build extension")
Review comment:
I'd suggest `maven-extension`. My understanding is that "build" is
assumed when it comes to Maven.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]