6

I am a JS dev. With NPM you can use wildcard or keyword to tell npm to get the latest minor, major...etc 1.2.x . Is there a way to do this with maven 3 ?

 <properties>
        <artifact.version>1.2.0-RC1</artifact.version>
        <my-dep.version>1.5.0-RC*</my-dep.version>
    </properties>

On build, I would get the latest RC (RC1, RC2...etc) each time I build.

I've found this answer but for Maven 2 : How do I tell Maven to use the latest version of a dependency?

Thanks

Stéphane.

6
  • Your linked answer for Maven 2 should also apply for Maven 3, except that RELEASE and LATEST have been removed. What about an open ended version range like [1.5.0.RC,).
    – Glains
    Commented Jun 11, 2018 at 11:09
  • I am not very familiar with maven. I ll try this arvo
    – Stefdelec
    Commented Jun 11, 2018 at 11:13
  • Should it be <version>[1.5.0.RC,1.6.0)</version>, to get only 1.5.0 rc but not upperversion (1.6.0 and 1.6.0rc...etc)?
    – Stefdelec
    Commented Jun 11, 2018 at 11:52
  • or [1.5.0.RC,1.6.0-SNAPSHOT)?
    – Stefdelec
    Commented Jun 11, 2018 at 12:08
  • Yeah, i havent noticed that you only want a particular release candidate up to a specific version. Then it should be [1.5.0-RC1,1.6.0)
    – Glains
    Commented Jun 11, 2018 at 12:21

1 Answer 1

6

As Glains said in comment, this link is fine for MAVEN 3 How do I tell Maven to use the latest version of a dependency?

Even the RELEASE keyword.

[1.5.0-RC1,1.6.0)

1
  • 1
    Note: This only applies to <dependencies>. Support for using this kind of wildcard ranges in <plugins> has been removed in 3.x
    – Philzen
    Commented Jan 18, 2022 at 12:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.