Results 1 to 3 of 3

Thread: Grails domain classes in STS

  1. #1
    Join Date
    Sep 2010
    Posts
    8

    Default Grails domain classes in STS

    I have STS 2.5.0.M3
    When I run Grails Tools->Generate Domain Class from the context menu, it puts the class in a folder called domain. The grails generate-xxx scripts seem to require that it be in grails-app in order to be recognized. Is this a bug in STS Grails support, or is there a way to reference domain classes from were STS puts them?

    Also, I've had problems getting mockDomain to work.. I suspect this is related.

  2. #2
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    747

    Default

    Are you saying that when you run the Generate Domain Class wizard, the resulting domain class is not put in the Project/grails-app/domain folder? This is the default behavior of Grails.

    STS should be putting your domain classes in Project/grails-app/domain and the generate-xxx should be looking for your domain classes in that folder.

    If this is not the behavior you are seeing, then this is a bug. Please note, though, that in the Grails Project Explorer view, the domain folder is a virtual folder that points to grails-app/domain.

    Please let me know where your domain classes are being created.
    Andrew Eisenberg, Ph.D.
    SpringSource, a division of VMware
    SpringSource Tools Team
    More about AJDT, Groovy-Eclipse, and Grails tooling

  3. #3
    Join Date
    Sep 2010
    Posts
    8

    Default Follow up - steps to recreate / solve

    Create new grails app - Fubar using button on the dashbar
    Highlight Fubar.. rightclick and select Grails Tools - Create Domain Class named Foo.. it was created in the wrong place.

    However.. if I open "Grails perspective" BEFORE doing the above.. it works fine.

    Thanks for pointing me in the right direction!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •