简体   繁体   中英

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>

我通过maven版本找到了一个解决方案:update_properties插件

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM