Skip to content

Latest commit

 

History

History
78 lines (55 loc) · 2.16 KB

versions.adoc

File metadata and controls

78 lines (55 loc) · 2.16 KB

Maven versions auto-update

Updating dependencies versions

Update parent

./mvnw versions:update-parent

Problem: provides updates to alpha, beta, milestone, …​ and other non final versions. To avoid it, add following configuration:

pom.xml
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>versions-maven-plugin</artifactId>
        <configuration>
          <rulesUri>file:///${project.basedir}/maven-version-rules.xml</rulesUri>
        </configuration>
      </plugin>
maven-version-rules.xml
<ruleset comparisonMethod="maven"
  xmlns="https://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0"
  xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="https://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0 https://mojo.codehaus.org/versions-maven-plugin/xsd/rule-2.0.0.xsd">
  <ignoreVersions>
    <ignoreVersion type="regex">.*[-_\.](alpha|Alpha|ALPHA|b|beta|Beta|BETA|rc|RC|M|EA)[-_\.]?[0-9]*</ignoreVersion>
  </ignoreVersions>
</ruleset>

Update dependencies

Two options depending on how you define versions:

Don’t mix them and use the version:use-* plugins, it will replace any properties used in versions by the versions itself.

We are going to cover the properties based version update.

./mvnw versions:update-properties

All at once

./mvnw versions:update-parent versions:update-properties

Excludes

In case there is a problem or you don’t want to migrate some dependencies:

pom.xml
          <excludes>
            <exclude>org.webjars:*</exclude>
          </excludes>