A Maven plugin for resolving a version range of an artifact to the highest matching version.
For the version range format, see GenericVersionScheme from the Aether project.
When using -Dresolve.print -q
, the only output to the console will be the matching version number. This can be used for scripting.
mvn com.subshell.maven:resolver-maven-plugin:resolve-range \
-Dresolve.groupId=org.apache.maven -Dresolve.artifactId=maven-model \
"-Dresolve.versionRange=[3.1.0, 3.3.max]" \
-Dresolve.print -q
This example writes the matching version number into the property latestMavenModelVersion
.
<plugin>
<groupId>com.subshell.maven</groupId>
<artifactId>resolver-maven-plugin</artifactId>
<configuration>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>[3.1.0, 3.3.max]</version>
<property>latestMavenModelVersion</property>
</configuration>
<executions>
<execution>
<goals>
<goal>resolve-range</goal>
</goals>
</execution>
</executions>
</plugin>
- Maven 3.2.5
- Java 7
Take a look at this project from the subshell team. We make Sophora: a content management software for content creation, curation, and distribution. Join our team! | Imprint