1

I have see ranges from [1.1,2.0) or [1.1,) but what does this mean:

  <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <configuration>
                        <properties>
                            <property>
                                <name>security-api</name>
                                <version>[1.4,1.4.1-!)</version>
                            </property>

Is this -! within [1.4,1.4.1-!) specific for version-maven-plugin and what is its purpose?

JimHawkins
  • 4,843
  • 8
  • 35
  • 55
Xelian
  • 16,680
  • 25
  • 99
  • 152

1 Answers1

1

The exclamation mark in [1.4,1.4.1-!) is there to prevent 1.4.1-SNAPSHOT version (and other similar, like -alpha) to be used, as [1.4,1.4.1) would allow 1.4.1-SNAPSHOT to be used.

But, using Maven 3.5.0 at least, that [1.4,1.4.1-!) range will also allow 1.4.1 to be used.

It is working like this for, in ASCII, ! is anyway lower than A

Tome
  • 3,234
  • 3
  • 33
  • 36
  • But what about 1.4.2 is it part of the range? or 1.4.1.1 – Xelian Jul 03 '17 at 08:22
  • Both won't resolve, but 1.4.1 will (edited answer to show that). – Tome Jul 03 '17 at 08:35
  • OK But how to trigger this property to be get? – Xelian Jul 03 '17 at 08:56
  • This seems to be a configuration item for the `versions-maven-plugin`. I don't think you will be able to use it outside of that plugin. – Tome Jul 03 '17 at 09:29
  • Yes ,yes but if I execute mvn clean install does the right version will be get? – Xelian Jul 03 '17 at 10:57
  • It will update the `security-api` property with a version fulfilling your range restrictions. But the exact value will depend on the rest of the configuration for this property. – Tome Jul 03 '17 at 11:17