5

For example, I have this maven dependency

<dependency>
    <groupId>foo</groupId>
    <artefactId>bar</artifactId>
    <version>[1.0.0, 1.1.0)</version>
</dependency>

The goal I'm trying to achieve is to include all patch (1.0.x) releases, including SNAPSHOT releases (to facilitate testing and integration), like 1.0.1-SNAPSHOT, 1.0.2 etc.

However, setting a version range like this [1.0.0, 1.1.0) will include versions like 1.1.0-alpha, 1.1.0-beta and 1.1.0-SNAPSHOT as well, which is something I don't want.

Is there a better way, short of specifying the version as [1.0.0, 1.1.0-alpha), which really just pollutes the POM with ugly versions numbers.

(It is not about trying to use the latest version, but about how to gracefully exclude alpha, beta and snapshot builds in an exclusive version range)

Isen Ng
  • 1,307
  • 1
  • 11
  • 23
  • Possible duplicate is here: http://stackoverflow.com/questions/14432039/how-to-make-maven-use-the-latest-release-version-within-version-range – gtonic Sep 15 '16 at 18:19
  • It's not a duplicate. That question is about using the latest version available. My question is about exclusive version range should not include `alpha`, 'beta` and `snapshot` builds – Isen Ng Sep 16 '16 at 03:49

0 Answers0