mvn版本:带有2.2.1 maven版本的update-property命令

时间:2018-07-05 15:46:26

标签: maven-2

我正在尝试更新pom属性标签的值。我正在使用mvn 2.2.1。我的POM文件是

<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>test</groupId>
  <artifactId>test</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <properties>
      <abc.version>12</abc.version>
  </properties>
</project>

我正在使用此命令来更新pom属性的abc.version标签值。

 mvn -X versions:update-property -Dproperty=abc.version -DnewVersion=18

以上命令已成功运行,但未更新abc.version的值

 [INFO] [versions:update-property {execution: default-cli}]
[DEBUG] Searching for properties associated with builders
[DEBUG] Property ${abc.version}
[DEBUG] Property ${abc.version}: Looks like this property is not associated with any dependency...
[DEBUG] Property ${abc.version}: Set of valid available versions is []
[DEBUG] Property ${abc.version}: Restricting results to 18
[DEBUG] Property ${abc.version}: Current winner is: null
[DEBUG] Property ${abc.version}: Searching reactor for a valid version...
[DEBUG] Property ${abc.version}: Set of valid available versions from the reactor is []
[INFO] Property ${abc.version}: Leaving unchanged as 12

为什么值保持不变,命令??中是否还需要其他参数?

0 个答案:

没有答案