Issues with plugins in 3.0

17 views
Skip to first unread message

Claude Daoust

unread,
Aug 25, 2016, 12:26:49 PM8/25/16
to Grails Dev Discuss
Hoping someone could help me out a little here.  Having a few issues with plugins in 3.0.  I'm using latest 3.1.10 and when all is inline (Gradle multi project) things work fairly well except for exception of DoWithSpring closure - didn't work when in plugin - had to put bean config in spring->Resources.groovy in main app.

Now when packaging plugins things got a little worse.  None of the plugin's dependencies were resolved - had to add them to main app. For example I have a plugin that uses rest client and another that uses spring security core and cas plugins. I had to ad all of these to the build.gradle deps of the main app.   Also, referencing  a service as a class (have some static methods) didn't work but not a big deal.   

So as example:

when inline I had the following gradle setup:
  build.gradle 
  dependencies {
    compile project(":security")

  settings.gradle 
    include 'security'
project(':security').projectDir = new File('../security')

When packaged: 
  build.gradle (in dependencies block)
  dependencies {
    compile 'ats.harvard.edu:security:3.0.0'

Perhaps there is a gradle setting for allowing the export of plugin deps?  


Also, my DoWithSpring closure still didn't work with the packaged plugin. This was setting up
 the custom user details bean for the spring security service.

It looks like this:
userDetailsService(SisUserDetailsService) {
realmId = application.config.app.realm
authClientService = ref('authClientService')
sisClientService = ref('sisClientService')
authenticateRoles = application.config.student.authenticate.roles
} 

Any help appreciated.
thanks, Claude

Jeff Brown

unread,
Aug 25, 2016, 12:58:52 PM8/25/16
to grails-de...@googlegroups.com
On August 25, 2016 at 9:27:11 AM, Claude Daoust (dao...@gmail.com) wrote:
> Hoping someone could help me out a little here. Having a few issues with
> plugins in 3.0. I'm using latest 3.1.10 and when all is inline (Gradle
> multi project) things work fairly well except for exception of DoWithSpring
> closure - didn't work when in plugin - had to put bean config in
> spring->Resources.groovy in main app.
>

Please file an issue at https://github.com/grails/grails-core/issues
and link to a sample application which demonstrates the problematic
behavior.

Thanks for the feedback.



JSB

--
Jeff Scott Brown
OCI Grails Practice Lead
Principal Software Engineer

Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/

Jeff Brown

unread,
Aug 25, 2016, 1:01:18 PM8/25/16
to grails-de...@googlegroups.com
On August 25, 2016 at 9:27:11 AM, Claude Daoust (dao...@gmail.com) wrote:
> Hoping someone could help me out a little here. Having a few issues with
> plugins in 3.0. I'm using latest 3.1.10 and when all is inline (Gradle
> multi project) things work fairly well except for exception of DoWithSpring
> closure - didn't work when in plugin - had to put bean config in
> spring->Resources.groovy in main app.
>

I assume that is a typo and you meant doWithSpring, not DoWithSpring.
If you named it DoWithSpring, that would explain the problem.  In your
plugin descriptor you should have something like this:

    Closure doWithSpring() { {->
            // Implement runtime spring config here...

Claude Daoust

unread,
Aug 25, 2016, 2:34:49 PM8/25/16
to Grails Dev Discuss
OK will do (when I have time to package up the sample)  - and yes that was just a typo - I placed the bean config within the already existing doWithSpring closure block.

thanks  
Reply all
Reply to author
Forward
0 new messages