I believe your cases do not work with version ranges. Version ranges depend on the order of the versions, and thus you cannot filter "-guava".
The ordering of version is defined in org.eclipse.aether.util.version.GenericVersion in maven-resolver-util. Example code to check: // GenericVersionScheme is in org.apache.maven.resolver:maven-resolver-util:1.3.3 GenericVersionScheme scheme = new GenericVersionScheme(); List<Version> list = new ArrayList<>(); list.add(scheme.parseVersion("4.7.0")); list.add(scheme.parseVersion("4.99999.0")); list.add(scheme.parseVersion("5")); list.add(scheme.parseVersion("5.0.0")); list.add(scheme.parseVersion("5.0.0-RC1")); list.add(scheme.parseVersion("5.0.0-SNAPSHOT")); Collections.sort(list); System.out.println(list); // [4.7.0, 4.99999.0, 5.0.0-RC1, 5.0.0-SNAPSHOT, 5, 5.0.0] So version "5.0.0-RC1" is smaller than version "5"; you can use [4.7.0, 4.9999999]". Regards, Tomo On Sun, Nov 24, 2019 at 2:46 PM John Patrick <nhoj.patr...@gmail.com> wrote: > i'm trying to start using maven version range more but having issues > with things like guava and also it not excluding version i believe > should be excluded. > > 1) i don't think this is possible but it might be, take a look a > google guava, it has a jre and a android version. using maven version > range how can i say any newer jre version, or any newer android > version? > > https://search.maven.org/artifact/com.google.guava/guava > > something like [25,) but only the jre maybe [25*-jre,) > > 2) i'm trying to use the version range "[4.7.0,5) "for > io.cucumber:cucumber-core. So i'm expecting it to use 4.8.0, not > 5.0.0-RC1 which is being picked up, i.e. mvn dependency:tree -Dverbose > -Dincludes=io.cucumber > > https://search.maven.org/artifact/io.cucumber/cucumber-core > > what do i need to change "[4.7.0,5)" to do it excludes anything starting 5? > > or are other people having similar issue so gave using trying to use > maven version ranges when declaring dependencies? > > John > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > -- Regards, Tomo