Announcement Announcement Module
Collapse
No announcement yet.
Can Grails apps be configured to depend on other Grails apps, like Java apps can? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can Grails apps be configured to depend on other Grails apps, like Java apps can?

    I'm trying to develop a reusable Grails "utility" server-side application that can be used by developers of multiple other Grails applications in a manner like how Java apps can depend on other Java apps. However, I haven't yet found the correct SpringSource Tool Suite project properties settings that will allow this to work.

    Ideally, I'd like to keep the reusable "utility" server's code base separate from the application code that depends on it, while still allowing developers to access and extend this "utility" server's code (controllers, domain objects, services, and plug-ins, etc.) from and within their own Grails applications.

    My current environment is:
    • SpringSource Tool Suite 2.9.0.M1
    • VMware vFabric tc Server Developer Edition v2.6
    • Grails 2.0.0

    I've tried adding the "utility" Grails application as "Required on the java build path" of another Grails application by selecting it in the [dependent project] properties > Java build path > Projects tab. This resulted in both projects being deployed and run side-by-side in the tc server, but the dependent application was seemingly unaware of the controllers provided by the "utility" application.

    Next, I tried adding the grails-app/controllers/utility directory of the "utility" application as a "Linked source folder" on the Java build path. But again, when the dependent application was run in the tc server the result was the same.

    What I'd like to be able to do is:
    1. keep the "utility" server's code base separate from the application code that depends on it
    2. allow developers to access and extend the "utility" code from and within their own Grails app
    3. build both Grails apps into a single war file, or, if two war files are necessary, ...
    4. provide compile and run-time linkage/integration of the "utility" and dependent applications

    Is this, or something like it, possible to set up in STS for Grails projects? Is this possible with Grails at all?

    Is there documentation, examples, or tutorials showing how to do this with STS and Grails?

    Is there STS project properties documentation that's Grails project specific?

  • #2
    I think you are trying to create a grails plugin project. See here for information on grails in place plugins:
    http://blog.springsource.com/2010/06...-architecture/

    In STS, you can create a plugin project (or just import it using file->import... after creating it on the command line) and then reference it from your regular grails project.

    You can open up the grails plugin manager (Alt+G M). And choose the in place plugin that you just created. This should do all of the things that you require.

    Comment


    • #3
      In-Place Plugins

      Andrew, thanks for your reply. I was just starting to look into turning our utility app into a plugin, but wasn't sure yet whether it was the right way to go. So far, I hadn't read anything about the "in-place" plugin capability you referred to. After a quick look at the article you suggested, and at Modularizing your Grails Application Domain Classes (which was referenced by the first article), it looks like it'll do the trick.

      Again, thanks for your reply.

      Michael

      Comment


      • #4
        Great. Just let us know if this all solves your problem.

        Comment

        Working...
        X