|
19 | 19 | import static org.junit.Assert.assertNull; |
20 | 20 | import static org.junit.Assert.assertTrue; |
21 | 21 |
|
| 22 | +import java.net.URI; |
22 | 23 | import java.util.Arrays; |
23 | 24 | import java.util.List; |
24 | 25 | import java.util.Optional; |
@@ -71,6 +72,36 @@ public void testBadSymbolicName() throws Exception { |
71 | 72 | assertStatusOk(getTargetStatus(target)); |
72 | 73 | } |
73 | 74 |
|
| 75 | + @Test |
| 76 | + public void testWithClassifierFailsToCollect() throws Exception { |
| 77 | + String targetXML = """ |
| 78 | + <location includeDependencyDepth="%depth%" includeDependencyScopes="compile,provided,runtime,system" includeSource="false" missingManifest="generate" type="Maven"> |
| 79 | + <dependencies> |
| 80 | + <dependency> |
| 81 | + <groupId>org.ehcache</groupId> |
| 82 | + <artifactId>ehcache</artifactId> |
| 83 | + <version>3.10.0</version> |
| 84 | + <type>jar</type> |
| 85 | + <classifier>jakarta</classifier> |
| 86 | + </dependency> |
| 87 | + </dependencies> |
| 88 | + </location> |
| 89 | + """; |
| 90 | + for (String deepth : new String[] { "none", "direct", "infinite" }) { |
| 91 | + ITargetLocation target = resolveMavenTarget(targetXML.replace("%depth%", deepth)); |
| 92 | + assertStatusOk(getTargetStatus(target)); |
| 93 | + TargetBundle[] bundles = target.getBundles(); |
| 94 | + // TODO check bundle and possible transtive dependencies! |
| 95 | + for (TargetBundle targetBundle : bundles) { |
| 96 | + URI location = targetBundle.getBundleInfo().getLocation(); |
| 97 | + assertTrue( |
| 98 | + "bundle with classifier was not correctly fetched width deepth = " + deepth + " location = " |
| 99 | + + location, |
| 100 | + location.toString().endsWith("org/ehcache/ehcache/3.10.0/ehcache-3.10.0-jakarta.jar")); |
| 101 | + } |
| 102 | + } |
| 103 | + } |
| 104 | + |
74 | 105 | @Test |
75 | 106 | public void testSourceWithSignature() throws Exception { |
76 | 107 | ITargetLocation target = resolveMavenTarget( |
|
0 commit comments