Skip to content

Commit

Permalink
Filter artifacts if they are submodules of the project
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
  • Loading branch information
jmle committed Oct 25, 2023
1 parent 0bc7def commit f6d5975
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion provider/internal/java/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,10 @@ func resolveSourcesJars(ctx context.Context, log logr.Logger, location, mavenSet
if err != nil {
return err
}

// remove unresolved sources if they are an actual module in the project
artifacts = filterExistingSubmodules(artifacts, pom)

m2Repo := getMavenLocalRepoPath(mavenSettings)
if m2Repo == "" {
return nil
Expand Down Expand Up @@ -396,7 +400,7 @@ func resolveSourcesJars(ctx context.Context, log logr.Logger, location, mavenSet
return nil
}

// filterExistingSubmodules takes a list of artifacts and takes out the ones existing in a pom's modules list
// filterExistingSubmodules takes a list of artifacts and removes the ones existing in the given pom's modules list
func filterExistingSubmodules(artifacts []javaArtifact, pom *gopom.Project) []javaArtifact {
if pom.Modules == nil {
return artifacts
Expand Down

0 comments on commit f6d5975

Please sign in to comment.