在使用grails3时 运行 run-app报错,错误如下:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bootRun'.
> A problem occurred starting process 'command 'C:\Program Files\Java\jdk1.8.0_101\bin\java.exe''
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
| Error Failed to start server (Use --stacktrace to see the full trace)
这个问题的原因是Boot/Gradle造成的,这个问题是可以通过编译的,但是在运行时,有一个路径导致进程失败,因为过程中的命令的组合长度大于windows允许的最大长度。
这个问题在Linux和osx中是不存在的。
这个问题的解决方案
在项目build.gradle的配置文件ext中加入
grails {
pathingJar = true
}
这样这个问题就解决了。
引用http://stackoverflow.com/questions/37472843/elasticsearch-plugin-causing-server-to-stop-in-grails-3-1-6/37491549#37491549