grails - Jenkins的Grails 3.1.2项目:未知的命令行选项 '-n'

标签 grails jenkins gradle grails-3.1

我复制粘贴了 Jenkins 作业(在Grails 2.4.5中工作),但是在新的Grails 3.1.2项目中失败:

Started by user Michal Szulc
Building in workspace <http://jenkins.example.com/job/project-server/ws/>
 > /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > /usr/bin/git config remote.project-server_repository.url http://git.example.pl/scm/es/project-server.git # timeout=10
Fetching upstream changes from http://git.example.pl/scm/es/project-server.git
 > /usr/bin/git --version # timeout=10
using .gitcredentials to set credentials
 > /usr/bin/git config --local credential.helper store --file=/tmp/git6110612657385406031.credentials # timeout=10
 > /usr/bin/git -c core.askpass=true fetch --tags --progress http://git.example.pl/scm/es/project-server.git +refs/heads/*:refs/remotes/project-server_repository/*
 > /usr/bin/git config --local --remove-section credential # timeout=10
 > /usr/bin/git rev-parse refs/remotes/project-server_repository/master^{commit} # timeout=10
 > /usr/bin/git rev-parse refs/remotes/project-server_repository/project-server_repository/master^{commit} # timeout=10
Checking out Revision eb5ef3113a02e6dc325d91ba5cc4b9ee7b935c90 (refs/remotes/project-server_repository/master)
 > /usr/bin/git config core.sparsecheckout # timeout=10
 > /usr/bin/git checkout -f eb5ef3113a02e6dc325d91ba5cc4b9ee7b935c90
 > /usr/bin/git rev-list eb5ef3113a02e6dc325d91ba5cc4b9ee7b935c90 # timeout=10
[project-server] $ /var/lib/jenkins/tools/com.g2one.hudson.grails.GrailsInstallation/3.1.2/bin/grails -Dgrails.work.dir=<http://jenkins.example.com/job/project-server/ws//target> -Dserver.port=40855 clean --non-interactive --plain-output
Error |
Command [clean] error: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.11-bin.zip'.
Problem with provided build arguments: [-non-interactive, --console, plain]. 
Unknown command-line option '-n'.
Either it is not a valid build option or it is not supported in the target Gradle version.
Not all of the Gradle command line options are supported build arguments.
Examples of supported build arguments: '--info', '-u', '-p'.
Examples of unsupported build options: '--daemon', '-?', '-v'.
Please find more information in the javadoc for the BuildLauncher class. (Use --stacktrace to see the full trace)
Build step 'Build With Grails' marked build as failure

如果我在本地环境中运行./gradlew clean./gradlew war,则效果很好。 jenkins如何运行它?

最佳答案

我仍然不确定为什么会发生这种情况,但是我通过更改构建-> 使用Grails构建-> 作为目标来解决了一个问题:

clean "war api.project-server.pl.war"

至:
"war api.project-server.pl.war"

关于grails - Jenkins的Grails 3.1.2项目:未知的命令行选项 '-n',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36008968/

相关文章:

ruby-on-rails - Grails 还是 Rails?

hudson - Jenkins CI (Hudson) - 如何启动交互式下游作业?

android - 我安装了Android Studio 3.1.2。我注意到以下错误

jenkins - 在 Jenkins 代码中捕获下游作业的构建号作为管道

jenkins - 复制工件插件 - 从工作空间复制,无需从工件复制路径

android - 启动应用程序后在 Android Studio 中 Hook

android - 更改build.gradle以同步gradle

grails - Grails 2.0 中带有新 where 查询的参数

grails - Grails操作适用于GET请求,针对POST请求返回404

caching - 在 Grails 中缓存昂贵的 Web 服务调用的最佳策略