Grails 3.2.9 custom plugin dependencies

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Grails 3.2.9 custom plugin dependencies

gabalmat
Is it possible to make one custom plugin in Grails 3 dependent on another custom plugin? Here's my project structure:

 - grails3-home
    * myApp
    - customPlugin1
        * build.gradle
        * settings.gradle
    - customPlugin2 ...

I would like to make customPlugin1 dependent on customPlugin2. Everything I've read says this possible with multi-project builds between apps and plugins in Grails 3. And I'm able to declare both plugins as dependencies in myApp with no issues. However, I have not been successful in getting this to work between the two plugins.  

I have added the following line to customPlugin1 > settings.gradle

   
include "customPlugin2"


And to customPlugin1 > build.gradle

   
grails {
    plugins
{
        compile project
(':customPlugin2')
   
}
}



However when I try to build customPlugin1, I get the following error:

FAILURE: Build failed with an exception.
  • What went wrong:
A problem occurred configuring root project 'customPlugin1'.
Could not resolve all dependencies for configuration ':runtime'.
Project : declares a dependency from configuration 'compile' to configuration 'default' which is not declared in the descriptor for project :customPlugin2.

Is anyone aware if what I'm trying to do is possible, and if so, what I might be missing?

**Update:**
If I change my configuration to 
   
include "../customPlugin2"

and

grails {
    plugins
{
        compile project
(':../customPlugin2')
   
}
}

the plugin builds successfully, but I am no longer able to import domains classes from customPlugin2 into customPlugin1 domains classes

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/6c60c2b8-21dd-42f7-a12b-da87a1706409%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Grails 3.2.9 custom plugin dependencies

Sergio del Amo Caballero
You will probably want to move your settings.gradle in your root project instead of customPlugin1. You should have just one settings.gradle file. 

Include every project inside settings.gradle 

include 'myapp'
include 'customPlugin1
include 'customPlugin2'

to add customPlugin2 as a depdency of customPlugin1

add in customPlugin1 build.gradle

grails {
    plugins {
        compile project(':customPlugin2')
    }
}

We published a Grails Multi-Project Build which may be helpful: 

http://guides.grails.org/grails-multi-project-build/guide/index.html

regards,
Sergio del Amo



On Wednesday, 31 May 2017 02:19:00 UTC+2, [hidden email] wrote:
Is it possible to make one custom plugin in Grails 3 dependent on another custom plugin? Here's my project structure:

 - grails3-home
    * myApp
    - customPlugin1
        * build.gradle
        * settings.gradle
    - customPlugin2 ...

I would like to make customPlugin1 dependent on customPlugin2. Everything I've read says this possible with multi-project builds between apps and plugins in Grails 3. And I'm able to declare both plugins as dependencies in myApp with no issues. However, I have not been successful in getting this to work between the two plugins.  

I have added the following line to customPlugin1 > settings.gradle

   
include "customPlugin2"


And to customPlugin1 > build.gradle

   
grails {
    plugins
{
        compile project
(':customPlugin2')
   
}
}



However when I try to build customPlugin1, I get the following error:

FAILURE: Build failed with an exception.
  • What went wrong:
A problem occurred configuring root project 'customPlugin1'.
Could not resolve all dependencies for configuration ':runtime'.
Project : declares a dependency from configuration 'compile' to configuration 'default' which is not declared in the descriptor for project :customPlugin2.

Is anyone aware if what I'm trying to do is possible, and if so, what I might be missing?

**Update:**
If I change my configuration to 
   
include "../customPlugin2"

and

grails {
    plugins
{
        compile project
(':../customPlugin2')
   
}
}

the plugin builds successfully, but I am no longer able to import domains classes from customPlugin2 into customPlugin1 domains classes

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/6822051a-08a6-4ea0-9063-63492069afa5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.