Dark theme | Light theme

March 12, 2010

Grails Goodness: No More Questions

Sometimes when we run Grails commands we get asked questions via user prompts. For example if we invoke $ grails create-domain-class Simple we get a message that it is good practice to use package names and the question "Do you want to continue? (y,n)". We need to answer this question to continue, but what if we are not able to answer the question, for example if the script is run on a continuous integration server? We pass the argument --non-interactive to the grails command and now we don't get a question and the script continues by using the default value for the answer. So in our example we can run $ grails create-domain-class Simple --non-interactive.