diff --git a/gazelle/kotlin/configure.go b/gazelle/kotlin/configure.go index ca6879ddc..4c6ea5b77 100644 --- a/gazelle/kotlin/configure.go +++ b/gazelle/kotlin/configure.go @@ -77,7 +77,6 @@ func (kt *Configurer) Configure(c *config.Config, rel string, f *rule.File) { resolver, err := jvm_maven.NewResolver( cfg.MavenInstallFile(), - cfg.ExcludedArtifacts(), logger, ) if err != nil { diff --git a/gazelle/kotlin/resolver.go b/gazelle/kotlin/resolver.go index f484000b0..40f56360e 100644 --- a/gazelle/kotlin/resolver.go +++ b/gazelle/kotlin/resolver.go @@ -9,6 +9,7 @@ import ( common "aspect.build/cli/gazelle/common" . "aspect.build/cli/gazelle/common/log" + "aspect.build/cli/gazelle/kotlin/kotlinconfig" "github.com/bazelbuild/bazel-gazelle/config" "github.com/bazelbuild/bazel-gazelle/label" "github.com/bazelbuild/bazel-gazelle/repo" @@ -192,9 +193,12 @@ func (kt *Resolver) resolveImport( jvm_import := jvm_types.NewPackageName(impt.Imp) + cfgs := c.Exts[LanguageName].(kotlinconfig.Configs) + cfg, _ := cfgs[from.Pkg] + // Maven imports if mavenResolver := kt.lang.mavenResolver; mavenResolver != nil { - if l, err := (*mavenResolver).Resolve(jvm_import); err == nil { + if l, err := (*mavenResolver).Resolve(jvm_import, cfg.ExcludedArtifacts(), cfg.MavenRepositoryName()); err == nil { return Resolution_Label, &l, nil } }