How to access java-classes in the default-package?

前端 未结 5 1668
有刺的猬
有刺的猬 2020-11-21 13:18

I\'m working now together with others in a grails project. I have to write some Java-classes. But I need access to an searchable object created with groovy. It seems, that t

5条回答
  •  梦毁少年i
    2020-11-21 14:24

    You can use packages in the Groovy code, and things will work just fine.

    It may mean a minor reorganization of code under grails-app and a little bit of a pain at first, but on a large grails project, it just make sense to organize things in packages. We use the Java standard package naming convention com.foo...

    Having everything in the default package becomes a hindrance to integration, as you're finding.

    Controllers seem to be the one Grails artifact (or artefact) that resists being put in a Java package. Probably I just haven't figured out the Convention for that yet. ;-)

提交回复
热议问题