Short Story: Provide fully qualified domain class name(class name with the package) to the generate-all command
Long Story:
If you have recently moved from pre-1.3 to latest grails version(1.3.2 as of today) and suddenly you have started getting this error
No domain class found for name Book. Please try again and enter a valid domain class name
on generate-all command
[sourcecode language=”groovy”]
grails generate-all Book
[/sourcecode]
then don’t panic. As of grails-1.3.2, when you create a new domain class, it is generated in a package. For example, in my case my Book.groovy is generated under mylib package(mylib is the name of my application)
generate-all command requires you provide fully qualified class names. This is true for even older versions like 1.1.1.
Issue this command instead
[sourcecode language=”groovy”]
grails generate-all mylib.Book
[/sourcecode]
I wish they made this point clear in their documentation at http://grails.org/doc/latest/ref/Command%20Line/generate-all.html
Thanks… I’m a newbie and went through the docs and a grail book, but your answer solved my full day problem