Question

My requirement is as below:

I will be having three projects.

  1. Main project (Grails project)
  2. Main project adaptor (Grails project)
  3. Domains plugin project (Grails project)

Domains plugin project will be having all of the domain classes and its test cases in it. So, I want to use those domain classes in other two projects. Here, I want to build Domains plugin project first, and the output of this build project should be the dependency of other two projects. I should be able configure this in BuildConfig.groovy.

Presently, I have done in the following way:

Created a plugin project using create-plugin and followed by package plugin command. Now, I kept that ZIP file in my lib folder and configured in Build-config.groovy. This works as expected. But, when ever I change domain classes, I need to do lot stuff. Like coping it to lib.

Is there any possibility to do in the first way I explained..!! Please help me out in this..!!

Thanks in advance

Was it helpful?

Solution

You can use inline plugins - put all of your three projects at the same level (in the same directory) and then configure adaptor and domain plugin as inline plugins in Main project. That way you dont have to build each project separately, you can do changes in your domain plugin or adapter and they will get picked in main project automatically.

Inside your main project's BuildConfig.groovy

grails.plugin.location.'adapter' = "../path-to-adapter-plugin"
grails.plugin.location.'domain' = "../path-to-domain-plugin"

Note - putting all three projects at same level isn't required, but doing that will let you use relative paths - but if you want you can use absolute paths as well

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top