Question

I'm pretty new to the Grails Framework and I'm experiencing some strange behavior. If I use the grails commandline tool this way

grails "-DghprbPullTitle=Title with spaces" clean

grails fails with this error message

| Script 'With' not found, did you mean:
   1) IntegrateWith
   2) Init
   3) CreateUnitTest

Starting grails this way will work

grails "-DghprbPullTitle=Title_without_spaces" clean

Ok one can now say "Then just avoid spaces" The problem is, that this occurs while I'm using Jenkins + Grails Plugin + Pull Request Builder Plugin. The Pull Request Builder Plugin generates some of these parameter with whitespaces.

Any thoughts how I can use grails with such whitespace-containing parameter. Or how I can tell the Pull Request Builder Plugin no to generate such parameter.

Maven on the other hand is able to handle such parameter.

Thanks in advance, Marco

Was it helpful?

Solution

I ended up using shell builder with grailsw call instead of the Grails plugin.

OTHER TIPS

Ok so it was a bug in the grails commandline tool. It will be fixed in grails 2.4-RC1. See Grails Issue Tracker

The problem is that Grails Plugin + Pull Request Builder Plugin makes it pass build parameters from PR Builder plugin to grails commands. Those arguments with spaces are not required for build to happen, it's some kind of default in Grails Plugin to pass those parameters along to grails commands.

If Grails Wrapper on Grails Plugin didn't work for you, using Shell commands instead of Grails Plugin worked for me: it avoids parameters with space and makes GitHub notifications to work. It's worse for grails installations maintenance, but at least it's an alternative.

I submitted a PR https://github.com/jenkinsci/grails-plugin/pull/12 to work around this by suppressing the -D build environment variables.

I am using the Github pull request builder plugin https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin to run test-app and was running into the same issues as others. I am not using any of the variables that the ghprb plugin passes in so I added an option to suppress -D build environment variables. When this option is checked none of the -D variables are passed to grails allowing the build with grails plugin to run the targets as expected.

If you want to test it out to see if it works for you, you can download it from here http://jmoses.co/data/grails.hpi and install it manually How to install a plugin in Jenkins manually?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top