有没有办法在命令行上用-Dpropname = value覆盖properties-maven-plugin的set-system-properties?换句话说:只有在尚未设置系统属性时才设置系统属性?
答案 0 :(得分:2)
通过常规财产:
<properties>
<propname>Default Value</propname>
</properties>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>set-system-properties</goal>
</goals>
<configuration>
<properties>
<property>
<name>system.property.name</name>
<value>${propname}</value>
</property>
</properties>
</configuration>
</execution>
</executions>
</plugin>
然后使用-Dpropname="Specified Value"
运行。