Search code examples
mavenpluginsversionversions-maven-plugin

Strange maven version ranges in versions-maven-plugin


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?


Solution

  • 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