Skip to content

Commit 9668c83

Browse files
author
luotianqi
committed
fix exclusion bug
1 parent 24f5242 commit 9668c83

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/analyzer/java/analyzer.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,13 @@ func (a Analyzer) ParseFile(dirRoot *srt.DirTree, depRoot *srt.DepTree, file *sr
138138
// if dep.Scope != "provied" {
139139
sub.Version = srt.NewVersion(dep.Version)
140140
// }
141+
// 添加exclusion
142+
for _, exc := range dep.Exclusions {
143+
key := strings.ToLower(fmt.Sprintf("%s+%s", exc.GroupId, exc.ArtifactId))
144+
sub.Exclusions[key] = struct{}{}
145+
}
141146
deps = append(deps, sub)
142147
}
143-
// 添加exclusion
144-
for _, exc := range pomXml.Exclusions {
145-
key := strings.ToLower(fmt.Sprintf("%s+%s", exc.GroupId, exc.ArtifactId))
146-
pomRoot.Exclusions[key] = struct{}{}
147-
}
148148
} else if filter.JavaPomProperties(file.Name) {
149149
a.parsePomProperties(dirRoot.Path, file.Data)
150150
}

0 commit comments

Comments
 (0)