提交 c93a68c7 编写于 作者: J jurgen

Deps resolve (order & optional)

Former-commit-id: 7efe9eeb
上级 3fc5530e
......@@ -365,7 +365,7 @@ public class MavenArtifactVersion {
continue;
}
MavenArtifactDependency dmInfo = findDependencyManagement(groupId, artifactId);
MavenArtifactDependency dmInfo = depManagement ? null : findDependencyManagement(groupId, artifactId);
// Resolve scope
MavenArtifactDependency.Scope scope = null;
......@@ -426,16 +426,22 @@ public class MavenArtifactVersion {
);
result.add(dependency);
if (!depManagement) {
// Exclusions
Element exclusionsElement = XMLUtils.getChildElement(dep, "exclusions");
if (exclusionsElement != null) {
for (Element exclusion : XMLUtils.getChildElementList(exclusionsElement, "exclusion")) {
dependency.addExclusion(
new MavenArtifactReference(
CommonUtils.notEmpty(XMLUtils.getChildElementBody(exclusion, "groupId")),
CommonUtils.notEmpty(XMLUtils.getChildElementBody(exclusion, "artifactId")),
""));
// Exclusions
Element exclusionsElement = XMLUtils.getChildElement(dep, "exclusions");
if (exclusionsElement != null) {
for (Element exclusion : XMLUtils.getChildElementList(exclusionsElement, "exclusion")) {
dependency.addExclusion(
new MavenArtifactReference(
CommonUtils.notEmpty(XMLUtils.getChildElementBody(exclusion, "groupId")),
CommonUtils.notEmpty(XMLUtils.getChildElementBody(exclusion, "artifactId")),
""));
}
}
if (dmInfo != null) {
List<MavenArtifactReference> dmExclusions = dmInfo.getExclusions();
if (dmExclusions != null) {
for (MavenArtifactReference dmEx : dmExclusions) {
dependency.addExclusion(dmEx);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册