Jenkins的Grails3.1.2项目:未知的命令行选项'-n';

Jenkins的Grails3.1.2项目:未知的命令行选项'-n';,grails,jenkins,gradle,grails-3.1,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 fr

我复制了粘贴的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
由用户Michal Szulc启动
在工作空间中构建
>/usr/bin/git rev parse——在工作树中#timeout=10
从远程Git存储库获取更改
>/usr/bin/git config remote.project-server_repository.urlhttp://git.example.pl/scm/es/project-server.git #超时=10
从中获取上游更改http://git.example.pl/scm/es/project-server.git
>/usr/bin/git--version#timeout=10
使用.gitcredentials设置凭据
>/usr/bin/git config--local credential.helper store--file=/tmp/git6110612657385406031.credentials#timeout=10
>/usr/bin/git-c core.askpass=true fetch--tags--progresshttp://git.example.pl/scm/es/project-server.git +refs/heads/*:refs/remotes/project-server\u存储库/*
>/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
签出版本eb5ef3113a02e6dc325d91ba5cc4b9ee7b935c90(参考/远程/project-server_repository/master)
>/usr/bin/git config core.sparsecheckout#timeout=10
>/usr/bin/git checkout-f eb5ef3113a02e6dc325d91ba5cc4b9ee7b935c90
>/usr/bin/git版本列表eb5ef3113a02e6dc325d91ba5cc4b9ee7b935c90#超时=10
[project server]$/var/lib/jenkins/tools/com.g2one.hudson.grails.grailInstallation/3.1.2/bin/grails-Dgrails.work.dir=-Dserver.port=40855干净--非交互式--普通输出
错误|
命令[clean]错误:无法使用Gradle发行版'https://services.gradle.org/distributions/gradle-2.11-bin.zip'.
提供的生成参数有问题:[-非交互式,--控制台,普通]。
未知的命令行选项'-n'。
它不是有效的生成选项,或者在目标Gradle版本中不受支持。
并非所有Gradle命令行选项都支持生成参数。
支持的生成参数示例:'--info'、'-u'、'-p'。
不受支持的生成选项示例:'--daemon','-?','-v'。
请在javadoc中找到BuildLauncher类的更多信息。(使用--stacktrace查看完整跟踪)
构建步骤“使用Grails构建”将构建标记为失败

如果我在本地环境中运行
/gradlew clean
/gradlew war
,它将非常有效。jenkins如何运行它?

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

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

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