在Maven发布准备期间更新版本属性

时间:2013-03-04 12:45:45

标签: maven maven-release-plugin

如何在mvn release:prepare

期间更新属性

我的pom.xml看起来像这样:

<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>

1 个答案:

答案 0 :(得分:1)

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