Skip to content

Commit

Permalink
Fix Arc dependency exclusion configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
manovotn committed Sep 5, 2024
1 parent bd33359 commit 807148f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ private boolean isApplicationArchiveExcluded(ArcConfig config, List<ExcludeDepen
public static boolean archiveMatches(ArtifactKey key, String groupId, Optional<String> artifactId,
Optional<String> classifier) {
if (Objects.equals(key.getGroupId(), groupId)
&& artifactId.isEmpty() || Objects.equals(key.getArtifactId(), artifactId.get())) {
&& (artifactId.isEmpty() || Objects.equals(key.getArtifactId(), artifactId.get()))) {
if (classifier.isPresent() && Objects.equals(key.getClassifier(), classifier.get())) {
return true;
} else if (!classifier.isPresent() && ArtifactCoords.DEFAULT_CLASSIFIER.equals(key.getClassifier())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public void testMatch() {
ArtifactKey key = GACT.fromString(GROUP_ID + ":" + ARTIFACT_ID);
ArtifactKey keyWithClassifier = GACT.fromString(GROUP_ID + ":" + ARTIFACT_ID + ":" + CLASSIFIER);

assertFalse(archiveMatches(key, GROUP_ID + ".different", Optional.empty(), Optional.empty()));
assertTrue(archiveMatches(key, GROUP_ID, Optional.empty(), Optional.empty()));
assertTrue(archiveMatches(key, GROUP_ID, Optional.of(ARTIFACT_ID), Optional.empty()));
assertFalse(archiveMatches(key, GROUP_ID, Optional.of(ARTIFACT_ID), Optional.of(CLASSIFIER)));
assertFalse(archiveMatches(key, GROUP_ID, Optional.of("test1"), Optional.empty()));
Expand Down

0 comments on commit 807148f

Please sign in to comment.