From 87cb1036f2af6b35b741bbc30fd79e75240ce07d Mon Sep 17 00:00:00 2001 From: Dirk Mahler Date: Thu, 13 Jun 2024 18:40:33 +0200 Subject: [PATCH] #86 updated release-notes.adoc --- plugin/maven/src/main/asciidoc/release-notes.adoc | 1 + .../maven3/api/artifact/MavenArtifactCoordinates.java | 7 ++++--- .../maven3/impl/scanner/MavenProjectScannerPluginTest.java | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugin/maven/src/main/asciidoc/release-notes.adoc b/plugin/maven/src/main/asciidoc/release-notes.adoc index 3edd8c28d2..cf24a17291 100644 --- a/plugin/maven/src/main/asciidoc/release-notes.adoc +++ b/plugin/maven/src/main/asciidoc/release-notes.adoc @@ -3,6 +3,7 @@ == 2.3.0 +* Added missing classifier `tests` to test artifacts created by the Maven project scanner * Ensure that the property `fileName` is set for `:Maven:Project` nodes that represent local (i.e. scanned) Maven projects == 1.12.0 diff --git a/plugin/maven/src/main/java/com/buschmais/jqassistant/plugin/maven3/api/artifact/MavenArtifactCoordinates.java b/plugin/maven/src/main/java/com/buschmais/jqassistant/plugin/maven3/api/artifact/MavenArtifactCoordinates.java index 2be8080f54..222cae9a18 100644 --- a/plugin/maven/src/main/java/com/buschmais/jqassistant/plugin/maven3/api/artifact/MavenArtifactCoordinates.java +++ b/plugin/maven/src/main/java/com/buschmais/jqassistant/plugin/maven3/api/artifact/MavenArtifactCoordinates.java @@ -7,7 +7,8 @@ public class MavenArtifactCoordinates implements Coordinates { /** * The artifact type for test jars. */ - public static final String ARTIFACTTYPE_TEST_JAR = "test-jar"; + public static final String TYPE_TEST_JAR = "test-jar"; + public static final String CLASSIFIER_TESTS = "tests"; private Artifact artifact; private boolean testJar; @@ -29,12 +30,12 @@ public String getName() { @Override public String getClassifier() { - return artifact.getClassifier(); + return testJar ? CLASSIFIER_TESTS : artifact.getClassifier(); } @Override public String getType() { - return testJar ? ARTIFACTTYPE_TEST_JAR : artifact.getType(); + return testJar ? TYPE_TEST_JAR : artifact.getType(); } @Override diff --git a/plugin/maven/src/test/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPluginTest.java b/plugin/maven/src/test/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPluginTest.java index a11c8f0782..6ecb6a5e06 100644 --- a/plugin/maven/src/test/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPluginTest.java +++ b/plugin/maven/src/test/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPluginTest.java @@ -267,7 +267,7 @@ private void scanAndVerify(Map properties, boolean expectedDepen verify(projectDescriptor).setEffectiveModel(effectiveModelDescriptor); verify(artifactCache).get(argThat(fqn -> fqn.contains(":jar:")), any()); verify(store).addDescriptorType(mainArtifactDescriptor, JavaClassesDirectoryDescriptor.class); - verify(artifactCache).get(argThat(fqn -> fqn.contains(":test-jar:")), any()); + verify(artifactCache).get(argThat(fqn -> fqn.contains(":test-jar:tests:")), any()); verify(store).addDescriptorType(testArtifactDescriptor, JavaClassesDirectoryDescriptor.class); verify(dependencyGraphBuilder).buildDependencyGraph(any(ProjectBuildingRequest.class), eq(null));