![](/img/trans.png)
[英]Maven build-helper-maven-plugin regex unable to use property as dependency.version
[英]build-helper-maven-plugin goal:regex-property how to access generated property
我嘗試將項目版本解析為名為build-number的新變量,我使用以下插件
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>rename-property</id>
<goals>
<goal>regex-property</goal>
</goals>
<phase>package</phase>
<configuration>
<name>build-number</name>
<value>${project.version}</value>
<regex>\.</regex>
<replacement>_</replacement>
<failIfNoMatch>false</failIfNoMatch>
</configuration>
</execution>
</executions>
</plugin>
我在pom.xml中的屬性部分如下所示
<modelVersion>4.0.0</modelVersion>
<groupId>xxx.xxx.xxx</groupId>
<artifactId>xxx</artifactId>
<version>1.1.2</version>
<packaging>rar</packaging>
<properties>
<build-number></build-number>
</properties>
我的問題是在啟動mvn build后我如何看到該變量
[INFO] --- build-helper-maven-plugin:1.7:regex-property(rename-property)@ xxx --- [INFO]將屬性“ build-number”設置為“ 1_1_2”。
我發現,當我們設置階段進行validate
一切都很好。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.