Search code examples
mavenmaven-release-plugin

Update version properties during Maven release prepare


How do I update properties during a mvn release:prepare

My pom.xml looks like this:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.mycompany.proj</groupId>
  <artifactId>mavenproject1</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

  <properties>
    <proj-dependency-version>1.0.0-SNAPSHOT</proj-dependency-version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>my.proj.dependency</groupId>
      <artifactId>proj-dependency</artifactId>
      <version>${proj-dependency-version}</version>
    </dependency>
  </dependencies>
</project>

Solution

  • I found a solution via the maven version:update_properties plugin