Use Hudson Build Parameter in Grails Build Target
- by Stephen Swensen
I have created two Hudson String Parameters in my parametrized build configuration: svnRoot, and svnBranch.
I can reference these just fine when specifying my Repository 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". build-applet invokes a Gant script in the Grails project at scripts\BuildApplet.groovy. 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(AbstractBuild.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)
What is the best and or easiest way to achieve my goal?