简体   繁体   中英

Deploying grails application alongside non-grails liferay?

I need to figure out a way to share domain objects between a grails installation and non-grails installation.

Essentially, I have a liferay deployment, and I have a series of REST services deployed as a war. The liferay deployment manages the front-end and portlet deployment, but it very much needs access to domain objects and services in the REST war. If I just include the rest war as a dependency, I don't get live grails objects with .save() , .list() , etc.

What's the best way to structure my project such that I can share common dependencies? Ideally I could just run my liferay deployment through grails, but I'm not sure how the URL mappings work out.

What's the best practice here?

That will be a hard one. Domain methods like save() or list() are added to the domain classes by the Grails Hibernate plugin by utilizing groovy metaprogramming during starting up the application. So if you just pull out domain class code, this step will not be executed.

Just as an idea: you might encapsulate the required functionality of these methods into AST transformations. When doing so, they are added at compile time and not at runtime.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM