Skip to content

Commit 791e3d4

Browse files
authored
fix: only_warning_when_building ark biz and excludding some jar not i… (#1070)
* fix: only_warning_when_building ark biz and excludding some jar not in base * fix sofa-ark-maven-plugin npe
1 parent 892c781 commit 791e3d4

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

sofa-ark-parent/support/ark-maven-plugin/src/main/java/com/alipay/sofa/ark/boot/mojo/ModuleSlimStrategy.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ protected void checkExcludeByParentIdentity(Set<Artifact> toFilterByExclude, Set
139139
getArtifactIdentity(artifact)));
140140
});
141141

142-
if(!excludedButNoDependencyInBase.isEmpty()){
143-
throw new MojoExecutionException(String.format("check excludeWithBaseDependencyParentIdentity failed with base: %s",config.getBaseDependencyParentIdentity()));
144-
}
145-
146142
// The base contains this dependency, but the version and module are inconsistent; Please use the same dependency version as the base in the module.
147143
List<Dependency> baseDependencies = getAllBaseDependencies();
148144
Map<String,Dependency> baseDependencyIdentityWithoutVersion = baseDependencies.stream().collect(Collectors.toMap(MavenUtils::getDependencyIdentityWithoutVersion, it -> it));
@@ -358,8 +354,11 @@ private Set<Artifact> getAllDependencies(DependencyNode node, Map<String, Artifa
358354

359355
Set<Artifact> result = new HashSet<>();
360356
for (DependencyNode child : node.getChildren()) {
361-
result.add(artifacts.get(getArtifactIdentity(child.getArtifact())));
362-
result.addAll(getAllDependencies(child, artifacts));
357+
String artifactId = getArtifactIdentity(child.getArtifact());
358+
if (artifacts.containsKey(artifactId)) {
359+
result.add(artifacts.get(artifactId));
360+
result.addAll(getAllDependencies(child, artifacts));
361+
}
363362
}
364363
return result;
365364
}

0 commit comments

Comments
 (0)