diff --git a/pkg/util/camel/camel_dependencies.go b/pkg/util/camel/camel_dependencies.go index 9f2c439e8f..44b523ef57 100644 --- a/pkg/util/camel/camel_dependencies.go +++ b/pkg/util/camel/camel_dependencies.go @@ -89,6 +89,17 @@ func ManageIntegrationDependencies( gav := strings.TrimPrefix(d, "mvn:") project.AddEncodedDependencyGAV(gav) + // TODO hack for tools.jar dependency issue in jolokia-jvm + // this block should be removed once the jolokia-jvm pom issue + // is resolved + // https://github.com/rhuss/jolokia/issues/473 + if strings.Contains(gav, "org.jolokia:jolokia-jvm") { + me := maven.Exclusion{ + GroupID: "com.sun", + ArtifactID: "tools", + } + project.AddEncodedDependencyExclusion(gav, me) + } default: if dep := jitpack.ToDependency(d); dep != nil { project.AddDependency(*dep) diff --git a/pkg/util/maven/maven_project.go b/pkg/util/maven/maven_project.go index e9ed19ddc5..ac1b86e9a4 100644 --- a/pkg/util/maven/maven_project.go +++ b/pkg/util/maven/maven_project.go @@ -109,12 +109,12 @@ func (p *Project) AddDependencies(deps ...Dependency) { } } -// AddDependencyGAV a dependency to maven's dependencies +// AddDependencyGAV adds a dependency to maven's dependencies func (p *Project) AddDependencyGAV(groupID string, artifactID string, version string) { p.AddDependency(NewDependency(groupID, artifactID, version)) } -// AddEncodedDependencyGAV a dependency to maven's dependencies +// AddEncodedDependencyGAV adds a dependency in GAV format to maven's dependencies func (p *Project) AddEncodedDependencyGAV(gav string) { if d, err := ParseGAV(gav); err == nil { // TODO: error handling @@ -145,6 +145,13 @@ func (p *Project) AddDependencyExclusions(dep Dependency, exclusions ...Exclusio } } +func (p *Project) AddEncodedDependencyExclusion(gav string, exclusion Exclusion) { + if d, err := ParseGAV(gav); err == nil { + // TODO: error handling + p.AddDependencyExclusion(d, exclusion) + } +} + type propertiesEntry struct { XMLName xml.Name Value string `xml:",chardata"`