camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nferr...@apache.org
Subject [camel-k] 02/03: chore(assembler): avoid duplicated dependencies
Date Mon, 01 Oct 2018 09:02:21 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit d9f413699b7632722dcfcee75eadf7e79e344c8b
Author: lburgazzoli <lburgazzoli@gmail.com>
AuthorDate: Sun Sep 30 23:19:18 2018 +0200

    chore(assembler): avoid duplicated dependencies
---
 pkg/util/maven/maven_project.go | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/pkg/util/maven/maven_project.go b/pkg/util/maven/maven_project.go
index 95cf928..2a04968 100644
--- a/pkg/util/maven/maven_project.go
+++ b/pkg/util/maven/maven_project.go
@@ -49,6 +49,13 @@ type Dependencies struct {
 
 // Add a dependency to maven's dependencies
 func (deps *Dependencies) Add(dep Dependency) {
+	for _, d := range deps.Dependencies {
+		// Check if the given dependency is already included in the dependency list
+		if d == dep {
+			return
+		}
+	}
+
 	deps.Dependencies = append(deps.Dependencies, dep)
 }
 


Mime
View raw message