Jan*_*all 2 intellij-idea maven intellij-14
我正在尝试执行以下操作,但是在具有TestNG运行配置的IntelliJ中:
mvn clean install -Dfoo=bar
因此,foo系统属性的值应为bar:
System.out.println(System.getProperty("foo"));
======
bar
Run Code Online (Sandbox Code Playgroud)
我搜索过的所有可能答案都告诉我将变量硬编码到pom.xml中(我不能这样做),或者说“ 仅在Edit Configurations ...中进行设置 ”,而不显示正确设置的变量。我也浏览了IntelliJ手册。
我在“运行/调试配置/参数”选项卡和“运行/调试配置/环境变量”中都尝试了“ foo”的所有逻辑名称,例如Dfoo和-Dfoo。

| 归档时间: |
|
| 查看次数: |
3486 次 |
| 最近记录: |