简体   繁体   English

在Grails构建目标中使用Hudson构建参数

[英]Use Hudson Build Parameter in Grails Build Target

I have created two Hudson String Parameters in my parametrized build configuration: svnRoot , and svnBranch . 我在参数化的构建配置中创建了两个Hudson String Parameters: svnRootsvnBranch

I can reference these just fine when specifying my Repository URL: ${svnRoot}/${svnBranch}/subProject . 在指定我的存储库URL时,我可以很好地引用它们: ${svnRoot}/${svnBranch}/subProject

But I have not been able to reference them as part of my Grails Build Target: "build-applet ${svnRoot}/${svnBranch}/appletProject username password" "war --non-interactive" . 但是我无法将它们作为Grails构建目标的一部分进行引用: "build-applet ${svnRoot}/${svnBranch}/appletProject username password" "war --non-interactive" build-applet invokes a Gant script in the Grails project at scripts\\BuildApplet.groovy . build-applet在Grails项目中的scripts\\BuildApplet.groovy处调用Gant脚本。 This attempt yields the following error: 尝试产生以下错误:

groovy.lang.MissingPropertyException: No such property: svnRoot for class: Script1 at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:49) at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:240) at Script1.run(Script1.groovy:1) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:561) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:536) at com.g2one.hudson.grails.GrailsBuilder.evalTarget(GrailsBuilder.java:212) at com.g2one.hudson.grails.GrailsBuilder.perform(GrailsBuilder.java:168) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:603) at hudson.model.Build$RunnerImpl.build(Build.java:172) at hudson.model.Build$RunnerImpl.doRun(Build.java:137) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBu groovy.lang.MissingPropertyException:无此类属性:svnRoot用于类:org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:49)上的Script1 org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(Pogo .java:49)位于org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:240)位于groovy.lang.GroovyShell.evaluate(GroovyShell.java:Script1.run(Script1.groovy:1) 561)在groovy.lang.GroovyShell.evaluate(GroovyShell.java:536)在com.g2one.hudson.grails.GrailsBuilder.evalTarget(GrailsBuilder.java:212)在com.g2one.hudson.grails.GrailsBuilder.perform(GrailsBuilder .java:168)在hudson.tasks.BuildStepMonitor $ 1.perform(BuildStepMonitor.java:19)在hudson.model.AbstractBuild $ AbstractRunner.perform(AbstractBuild.java:603)在hudson.model.Build $ RunnerImpl.build(Build .java:172)在hudson.model.Build $ RunnerImpl.doRun(Build.java:137)在hudson.model.AbstractBuild $ AbstractRunner.run(AbstractBu ild.java:417) at hudson.model.Run.run(Run.java:1337) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:140) ild.java:417)位于hudson.model.Run.run(Run.java:1337)位于hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)位于hudson.model.ResourceController.execute(ResourceController.java:88) )在hudson.model.Executor.run(Executor.java:140)

What is the best and or easiest way to achieve my goal? 实现我的目标的最佳或最简单的方法是什么?

From looking at the wiki page on the Grails plugin (http://wiki.hudson-ci.org/display/HUDSON/Grails+Plugin), this should work 通过查看Grails插件(http://wiki.hudson-ci.org/display/HUDSON/Grails+Plugin)上的Wiki页面,应该可以使用

grails build-applet ${env.svnRoot}/${env.svnBranch}/appletProject username password

If not, I'd try a command line build step. 如果没有,我会尝试命令行构建步骤。 Make sure you set GRAILS_HOME as the first line in the script then call grails. 确保将GRAILS_HOME设置为脚本的第一行,然后调用grails。

cheers 干杯

Lee 背风处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM