diff --git a/src/main/java/rife/bld/dependencies/VersionNumber.java b/src/main/java/rife/bld/dependencies/VersionNumber.java index f9b3fb5..f52b988 100644 --- a/src/main/java/rife/bld/dependencies/VersionNumber.java +++ b/src/main/java/rife/bld/dependencies/VersionNumber.java @@ -51,6 +51,10 @@ public static Version parse(String version) { var matcher = VERSION_PATTERN.matcher(version); if (!matcher.matches()) { + // bld doesn't support version ranges at this time + if (version.startsWith("[") || version.startsWith("(")) { + return UNKNOWN; + } return new VersionGeneric(version); } diff --git a/src/test/java/rife/bld/dependencies/TestDependencyResolver.java b/src/test/java/rife/bld/dependencies/TestDependencyResolver.java index d4b9a96..9ee0492 100644 --- a/src/test/java/rife/bld/dependencies/TestDependencyResolver.java +++ b/src/test/java/rife/bld/dependencies/TestDependencyResolver.java @@ -157,6 +157,16 @@ void testGetCompileDependenciesJetty() { org.slf4j:slf4j-api:2.0.5""", StringUtils.join(dependencies, "\n")); } + @Test + void testGetCompileDependenciesAssertJ() { + var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.assertj", "assertj-joda-time", new VersionNumber(2, 2, 0))); + var dependencies = resolver.getDirectDependencies(compile); + assertNotNull(dependencies); + assertEquals(1, dependencies.size()); + assertEquals(""" + org.assertj:assertj-core""", StringUtils.join(dependencies, "\n")); + } + @Test void testGetCompileDependenciesJettyOverride1() { var resolver = new DependencyResolver(new VersionResolution(new HierarchicalProperties().put(PROPERTY_OVERRIDE_PREFIX, "org.slf4j:slf4j-api:2.0.13")),