You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2018/10/01 09:02:21 UTC
[camel-k] 02/03: chore(assembler): avoid duplicated dependencies
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 <lb...@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)
}