Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom location for domain classes within a maven/grails app

I have a groovy/maven/grails app.

It consists of a standalone groovy application (backtick-core) which contains, amongst other things, all of my domain classes.

There is another module which is a grails web-app (backtick-grails).

Structure like this:

backtick
    backtick-core
        src/main/groovy/com/backtick/domain
    backtick-grails
        grails-app
        ...

I would like to be able to use the domain classes from backtick-core within my grails application (backtick-grails). Currently the grails app can see the classes, but they are not being "decorated" with all of the GORM features that domain objects usually get decorated with.

Is there some way of getting grails to scan other locations for domain classes?

like image 239
Ben Avatar asked Nov 12 '22 18:11

Ben


1 Answers

I don't know if you can change the location for domain classes, as it is not the original idea.

However, you could modularize your application by extracting your domain into a plugin, as explained here.

This way, your application can use domain classes that are not part of it.

like image 129
mathifonseca Avatar answered Nov 15 '22 05:11

mathifonseca