如果我的 pom 文件中有以下内容:
<properties>
<mySystemProperty>${mySystemProperty}</mySystemProperty>
</properties>
当我使用“mvn clean install -DmySystemProperty=someData”构建时,它构建成功。如果我使用“mvn clean install”构建它,我不需要指定系统属性,Maven 会给我这个错误:
Resolving expression: '${mySystemProperty}': Detected the following recursive expression cycle in 'mySystemProperty'
有没有办法让 Maven 忽略丢失的系统属性?如果没有,有没有默认的方法?
请您参考如下方法:
解决了。系统变量和 Maven 变量使用相同的名称导致了问题。重命名系统变量修复了错误。
<properties>
<mySystemProperty>${sysProperty}</mySystemProperty>
</properties>




