【发布时间】:2016-06-22 19:16:42
【问题描述】:
我有一个 grails 3 应用程序,当我通过 gradle bootRun 任务运行它时,我试图将命令行参数传递给我的应用程序。
我想读取配置文件中的参数以进行运行时操作。根据 yml 配置here 的 grails 文档,我尝试将以下内容添加到我的 build.gradle 文件中
run {
systemProperties = System.properties
}
当我添加该配置并运行我的任务时,我收到以下错误:
3:11:20 PM: Executing external task 'bootRun -Dcolor=red -Dfruit=apple'...
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\docs\projects\jet\build.gradle' line: 85
* What went wrong:
A problem occurred evaluating root project 'jet'.
> Could not find method run() for arguments [build_6lnm3xriwcnri1zrvfit1niuu$_run_closure8@4446881a] on root project 'jet'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 8.892 secs
Could not find method run() for arguments [build_6lnm3xriwcnri1zrvfit1niuu$_run_closure8@4446881a] on root project 'jet'.
3:11:32 PM: External task execution finished 'bootRun -Dcolor=red -Dfruit=apple'.
如果我在这里遗漏了什么或者是否有更好的方法,请告诉我。
【问题讨论】:
标签: grails gradle grails-3.0