Skip to content

Commit

Permalink
Still handle version ranges as an unknown version
Browse files Browse the repository at this point in the history
  • Loading branch information
gbevin committed Jul 20, 2024
1 parent 3ee8f81 commit 4913519
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/rife/bld/dependencies/VersionNumber.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
10 changes: 10 additions & 0 deletions src/test/java/rife/bld/dependencies/TestDependencyResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
Expand Down

0 comments on commit 4913519

Please sign in to comment.