Oddity with package name (using Grails)

I've just tried to create a Grails project from scratch. I wanted to name it something like "thing-01-01-01" and the dialogue accepted that. I then created a new Grails domain class and added a single entry. I noticed that the package inserted at the start of the file actually said "thing.01.01.01" and when I try to compile any code with that package name it has an error "package name 'thing.01.01.01' does not corresponding to file path 'thing.01.01.01'". And the created files do use the "thing-01-01-01" directory name. I'm sure that I can get around that but it does seem to be an error. This is using IDEA 11.1.2/ Grails 2.0.3/ Ubuntu 10.04. I must admit that I haven't used the environment for a year or so but have used project/package name of the same form before although I have used the "create project from existing file" more often than start from fresh.  Thanks  graham

1 comment
Comment actions Permalink

No one ?!

As I thought the solution was simple - but annoying. Having created a single domain class I closed the project and examined the file structure: hardly surprising, IDEA had created a set of subdirectories based on its view of the project name as a structured package name and so my 'thing-01-01-01' had given rise to the directory structure
where 'firstdomain' was the name of my test domain.
I moved the domain file up to
and deleted the 01/01/01 directories. I edited the firstdomain.groovy file to make the package name only 'thing' (which is fine for the purposes, but I didn't try to actually put in the hyphens etc.)
I re-opened the project and IDEA seemed happy with the arrangement and showed 'thing' as the package name. I tried a grails create-controller and it created the controller in the correct place

And it was happy to create a new domain under the 'thing' package

So that seems to achieved what I wanted.

Is this a bug ? I did have a search here for anything related before I made the first post but  couldn't find anything.



Please sign in to leave a comment.