【发布时间】:2017-09-25 20:57:03
【问题描述】:
我在 src/main/java/configs/config.properties 下有一个 config.properties 文件,其中包含以下配置文件:
<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<no_of_files>${no_of_files}</no_of_files>
<no_of_rows>${no_of_rows}</no_of_rows>
</properties>
</profile>
</profiles>
我的 config.properties 文件包含
no_of_rows = ${no_of_rows}
no_of_files = ${no_of_files}
我正在使用以下 maven 命令通过命令行传递这些属性
mvn exec:java -Dexec.mainClass="com.mycompany.project.App" -Dno_of_rows=4 -Dno_of_files=3
但结果是
[ERROR] Resolving expression: '${no_of_files}': Detected the following recursive expression cycle in 'no_of_files': [no_of_files] @
我在 stackoverflow 上查看了其他类似的答案,但我认为我仍然没有找到正确的方法。
我需要这个来使用竹子作业来运行项目。
【问题讨论】:
标签: java maven command-line bamboo properties-file