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 3b158a0ef chore: remove registry maven dependency leftover
3b158a0ef is described below

commit 3b158a0ef1abee9a3ad19a0d07468915d23cf0d9
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Wed Dec 11 08:16:38 2024 +0100

    chore: remove registry maven dependency leftover
---
 pkg/util/camel/camel_dependencies.go | 61 ------------------------------------
 1 file changed, 61 deletions(-)

diff --git a/pkg/util/camel/camel_dependencies.go 
b/pkg/util/camel/camel_dependencies.go
index 74d23d6d2..3053d34e3 100644
--- a/pkg/util/camel/camel_dependencies.go
+++ b/pkg/util/camel/camel_dependencies.go
@@ -20,8 +20,6 @@ package camel
 import (
        "fmt"
        "io"
-       "path/filepath"
-       "strconv"
        "strings"
 
        v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
@@ -135,10 +133,6 @@ func addDependencies(project *maven.Project, dependencies 
[]string, catalog *Run
                        addCamelQuarkusComponent(project, d)
                case strings.HasPrefix(d, "mvn:"):
                        addMavenDependency(project, d)
-               case strings.HasPrefix(d, "registry-mvn:"):
-                       if err := addRegistryMavenDependency(project, d); err 
!= nil {
-                               return err
-                       }
                default:
                        if err := addJitPack(project, d); err != nil {
                                return err
@@ -203,61 +197,6 @@ func addMavenDependency(project *maven.Project, dependency 
string) {
        project.AddEncodedDependencyGAV(gav)
 }
 
-func addRegistryMavenDependency(project *maven.Project, dependency string) 
error {
-       mapping := strings.Split(dependency, "@")
-       outputFileRelativePath := mapping[1]
-       gavString := strings.TrimPrefix(mapping[0], "registry-mvn:")
-       gav, err := maven.ParseGAV(gavString)
-       if err != nil {
-               return err
-       }
-       plugin := getOrCreateBuildPlugin(project, 
"com.googlecode.maven-download-plugin", "download-maven-plugin", "1.6.8")
-       outputDirectory := "../context"
-
-       //nolint:mnd
-       isClasspath := len(mapping) == 3 && mapping[2] == "classpath"
-       if isClasspath {
-               outputDirectory = "src/main/resources"
-       }
-
-       properties := v1.PluginProperties{}
-       properties.Add("outputDirectory", filepath.Join(outputDirectory, 
filepath.Dir(outputFileRelativePath)))
-       properties.Add("outputFileName", filepath.Base(outputFileRelativePath))
-       properties.Add("groupId", gav.GroupID)
-       properties.Add("artifactId", gav.ArtifactID)
-       properties.Add("version", gav.Version)
-       properties.Add("type", gav.Type)
-
-       exec := maven.Execution{
-               ID:    strconv.Itoa(len(plugin.Executions)),
-               Phase: "validate",
-               Goals: []string{
-                       "artifact",
-               },
-               Configuration: properties,
-       }
-       plugin.Executions = append(plugin.Executions, exec)
-
-       return nil
-}
-
-func getOrCreateBuildPlugin(project *maven.Project, groupID string, artifactID 
string, version string) *maven.Plugin {
-       for i, plugin := range project.Build.Plugins {
-               if plugin.GroupID == groupID && plugin.ArtifactID == artifactID 
&& plugin.Version == version {
-                       return &project.Build.Plugins[i]
-               }
-       }
-       plugin := maven.Plugin{
-               GroupID:    groupID,
-               ArtifactID: artifactID,
-               Version:    version,
-               Executions: []maven.Execution{},
-       }
-       project.Build.Plugins = append(project.Build.Plugins, plugin)
-
-       return &project.Build.Plugins[len(project.Build.Plugins)-1]
-}
-
 func addJitPack(project *maven.Project, dependency string) error {
        dep := jitpack.ToDependency(dependency)
        if dep == nil {

Reply via email to