Skip to content

Commit

Permalink
fix module slim when using starter (#991)
Browse files Browse the repository at this point in the history
* 优化显示

* fix as bizStateRecords

* 更新显示

* fix module slim for snapshot
  • Loading branch information
gaosaroma authored Aug 12, 2024
1 parent 71a1c47 commit 9973c00
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ private Model getBaseDependencyParentOriginalModel() {
private String getArtifactIdentity(Artifact artifact) {
if (artifact.hasClassifier()) {
return artifact.getGroupId() + STRING_COLON + artifact.getArtifactId() + STRING_COLON
+ artifact.getVersion() + ":" + artifact.getClassifier();
+ artifact.getBaseVersion() + STRING_COLON + artifact.getClassifier();
} else {
return artifact.getGroupId() + STRING_COLON + artifact.getArtifactId() + STRING_COLON
+ artifact.getVersion();
+ artifact.getBaseVersion();
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import static com.alipay.sofa.ark.boot.mojo.ReflectionUtils.setField;
import static java.util.Arrays.asList;
Expand Down Expand Up @@ -105,11 +109,13 @@ public void testGetArtifactsToFilterByParentIdentity() throws URISyntaxException
when(sameArtifact.getGroupId()).thenReturn("com.mock");
when(sameArtifact.getArtifactId()).thenReturn("same-dependency-artifact");
when(sameArtifact.getVersion()).thenReturn("1.0");
when(sameArtifact.getBaseVersion()).thenReturn("1.0-SNAPSHOT");

Artifact differenceArtifact = mock(Artifact.class);
when(differenceArtifact.getGroupId()).thenReturn("com.mock");
when(differenceArtifact.getArtifactId()).thenReturn("difference-dependency-artifact");
when(differenceArtifact.getVersion()).thenReturn("2.0");
when(differenceArtifact.getBaseVersion()).thenReturn("2.0-SNAPSHOT");

Set<Artifact> res = strategy.getArtifactsToFilterByParentIdentity(Sets.newHashSet(
sameArtifact, differenceArtifact));
Expand Down Expand Up @@ -259,19 +265,20 @@ private MavenProject getRootProject() {
when(artifact.getArtifactId()).thenReturn("base-dependencies-starter");
when(artifact.getGroupId()).thenReturn("com.mock");
when(artifact.getVersion()).thenReturn("1.0");
when(artifact.getBaseVersion()).thenReturn("1.0");

project.setArtifact(artifact);
project.setParent(null);

Dependency sameDependency = new Dependency();
sameDependency.setArtifactId("same-dependency-artifact");
sameDependency.setGroupId("com.mock");
sameDependency.setVersion("1.0");
sameDependency.setVersion("1.0-SNAPSHOT");

Dependency differenceDependency = new Dependency();
differenceDependency.setArtifactId("difference-dependency-artifact");
differenceDependency.setGroupId("com.mock");
differenceDependency.setVersion("1.0");
differenceDependency.setVersion("1.0-SNAPSHOT");

DependencyManagement dm = new DependencyManagement();
dm.setDependencies(Lists.newArrayList(sameDependency, differenceDependency));
Expand Down

0 comments on commit 9973c00

Please sign in to comment.