Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6933699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:51:56+00:00 2026-05-27T11:51:56+00:00

I have a Grails Application AppA. And I am planning to create a new

  • 0

I have a Grails Application AppA. And I am planning to create a new Grails Application AppB, wherein AppB practically uses the same services and models of AppA.

How should I approach that?

  1. Extract a Grails Application AppC which would have the common services and expose that service as a remote/web/rest service?
  2. Extract a Groovy project ModC that will be a jar containing the common services and models and have AppA & AppB depend on ModC?
  3. Just git clone and cherry-pick every now & then?
  4. Other suggestions?

Note that AppA have some lazy-loaded relationship invocations (i.e. entity1.entity2.entity3.propName) & GORM invocations (i.e. Entity1.get(1L)) from the presentation layer (controllers & views) as well. Although I can probably push some of them back to the services, I’m concerned about the refactoring effort to have the relationship invocations from the view remain intact (i.e. I would need to eager loaded some associations, or create Data Transfer Objects)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:51:57+00:00Added an answer on May 27, 2026 at 11:51 am

    The Grails way to share common functionalities, utilities and whatnot is to make a plugin that encapsulates those and install it to both projects.

    A plugin can contain anything you can put in a regular Grails app — i.e. Models, Service, Views, Controllers, config files, resources under web-app etc.

    You can then either release it to an internal svn repository or just use it with package-plugin

    Edit:

    One way to do it while you are constantly updating the code is to have it as an inline plugin. So remove the plugin from your application.properties and add:

    grails.plugin.location."name-of-plugin" = "/path/to/plugin/dir" // or "../plugin/"
    

    This removes the necessity of reinstalling the plugin all the time. But this is for development time only.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a grails application and i'm following the tutorial here: http://www.grails.org/Services i have
I have an existing grails application that uses spring-security plugin for authentication. I would
I have a Grails application that uses ThreadLocal. Currently ThreadLocal populating and clearing is
I have a grails application that uses spring-security-core and spring-security-ldap, with authentication against Active
I have one grails application.In that I have one model class named Book. From
I have a groovy/grails application that needs to serve images It works fine on
Let's say we have a grails web application exposing several resources. tags urls users
I have some text area field in my grails application. I got the following
I have grails application on heroku. I use MongoSessionManager which allows, to share session
I have created grails application and uploaded it in heroku. If I use 'heroku

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.