Dependency Inheritance

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Dependency Inheritance

netwiser
Hi,

I am working on a new project which will include a desktop and a mobile UI. I have created a common plugin which put all the common classes, such as Users, Profile, etc, together to be shared by two UI projects. 

I would like to use Spring-Security-Core/OpenID/UI plugins, my User class will extends GrailsUser. In order to reduce the complex and duplication, I installed Spring-Security-xxx plugins to my common plugin project instead of 2 UI projects. In both UI projects BuildConfig.groovy, I have put  grails.plugin.location.'million-common' = "../million-common". Here comes the issue, when I compile any one of the UI projects,  grails complains org.codehaus.groovy.control.MultipleCompilationErrorsException:

lers/LoginController.groovy: 11: unable to resolve class org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
  [groovyc]  @ line 11, column 1.
  [groovyc]    import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
  [groovyc]    ^
................

All the classes from Spring-Security are NOT found. 

I google and found Peter Ledbrook discussing this (http://stackoverflow.com/questions/2450564/custom-grails-plugin-dependency). My problem is the common plugin project is not yet stable and not yet released,  I really don't like to install Spring Security and other plugins everywhere in all my projects. What should I do to resolve this dependency issue?



PS. I have tried in ComomGrailsPlugin.groovy, to set the def dependsOn to include all plugins it useed, such as :

    def dependsOn = [famfamfam: "1.0.1 > *", 
        jquery: "1.4.3.2 > *",
                 jquery-ui: "1.8.6.1 > *",
                 mail: "0.9 > *",
spring-security-core: "1.0.1 > *",
spring-security-openid: "1.0 > *", 
spring-security-ui: "0.1.2 > *",
springcache: "1.2.1 > *"]

but I was experiencing this error:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/home/netwiser/workspaces/1million/million-common/MillionCommonGrailsPlugin.groovy: 9: illegal colon after argument expression;
   solution: a complex label expression before a colon must be parenthesized @ line 9, column 27.
                    jquery-ui: "1.8.6.1 > *",
                             ^

1 error

at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:296)



Regards,

James
Reply | Threaded
Open this post in threaded view
|

Re: Dependency Inheritance

Burt Beckwith-2
You need to install and/or depend on the plugins somehow - grails.plugin.location.<plugin-name> is a configuration override but doesn't pull in the plugin. Your issue is with the dependsOn Map - you can omit quotes from Map keys in Groovy but only if there aren't any spaces, dashes, etc. in the names. So you just need to quote the ones with dashes (or all of them):

   def dependsOn = [
      "spring-security-openid": "1.0 > *", 
      "spring-security-ui": "0.1.2 > *",
      springcache: "1.2.1 > *"]

I omitted the ones that will get pulled in transitively by the others (famfamfam, jquery, jquery-ui, and mail will be pulled by spring-security-core which is pulled by spring-security-openid and spring-security-ui). If those don't resolve (I think there are issues in dependencies of dependencies with inline plugins) then put them back, quoted if necessary.

Burt

On Thu, Dec 23, 2010 at 11:53 PM, James Zhang <[hidden email]> wrote:
Hi,

I am working on a new project which will include a desktop and a mobile UI. I have created a common plugin which put all the common classes, such as Users, Profile, etc, together to be shared by two UI projects. 

I would like to use Spring-Security-Core/OpenID/UI plugins, my User class will extends GrailsUser. In order to reduce the complex and duplication, I installed Spring-Security-xxx plugins to my common plugin project instead of 2 UI projects. In both UI projects BuildConfig.groovy, I have put  grails.plugin.location.'million-common' = "../million-common". Here comes the issue, when I compile any one of the UI projects,  grails complains org.codehaus.groovy.control.MultipleCompilationErrorsException:

lers/LoginController.groovy: 11: unable to resolve class org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
  [groovyc]  @ line 11, column 1.
  [groovyc]    import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
  [groovyc]    ^
................

All the classes from Spring-Security are NOT found. 

I google and found Peter Ledbrook discussing this (http://stackoverflow.com/questions/2450564/custom-grails-plugin-dependency). My problem is the common plugin project is not yet stable and not yet released,  I really don't like to install Spring Security and other plugins everywhere in all my projects. What should I do to resolve this dependency issue?



PS. I have tried in ComomGrailsPlugin.groovy, to set the def dependsOn to include all plugins it useed, such as :

    def dependsOn = [famfamfam: "1.0.1 > *", 
        jquery: "1.4.3.2 > *",
                 jquery-ui: "1.8.6.1 > *",
                 mail: "0.9 > *",
spring-security-core: "1.0.1 > *",
spring-security-openid: "1.0 > *", 
spring-security-ui: "0.1.2 > *",
springcache: "1.2.1 > *"]

but I was experiencing this error:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/home/netwiser/workspaces/1million/million-common/MillionCommonGrailsPlugin.groovy: 9: illegal colon after argument expression;
   solution: a complex label expression before a colon must be parenthesized @ line 9, column 27.
                    jquery-ui: "1.8.6.1 > *",
                             ^

1 error

at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:296)



Regards,

James

Reply | Threaded
Open this post in threaded view
|

Re: Dependency Inheritance

netwiser
Thanks Burt, I will try it out. 

Merry Christmas,

James

Sent from my iPhone

On 2010-12-24, at 8:23, Burt Beckwith <[hidden email]> wrote:

You need to install and/or depend on the plugins somehow - grails.plugin.location.<plugin-name> is a configuration override but doesn't pull in the plugin. Your issue is with the dependsOn Map - you can omit quotes from Map keys in Groovy but only if there aren't any spaces, dashes, etc. in the names. So you just need to quote the ones with dashes (or all of them):

   def dependsOn = [
      "spring-security-openid": "1.0 > *", 
      "spring-security-ui": "0.1.2 > *",
      springcache: "1.2.1 > *"]

I omitted the ones that will get pulled in transitively by the others (famfamfam, jquery, jquery-ui, and mail will be pulled by spring-security-core which is pulled by spring-security-openid and spring-security-ui). If those don't resolve (I think there are issues in dependencies of dependencies with inline plugins) then put them back, quoted if necessary.

Burt

On Thu, Dec 23, 2010 at 11:53 PM, James Zhang <[hidden email]> wrote:
Hi,

I am working on a new project which will include a desktop and a mobile UI. I have created a common plugin which put all the common classes, such as Users, Profile, etc, together to be shared by two UI projects. 

I would like to use Spring-Security-Core/OpenID/UI plugins, my User class will extends GrailsUser. In order to reduce the complex and duplication, I installed Spring-Security-xxx plugins to my common plugin project instead of 2 UI projects. In both UI projects BuildConfig.groovy, I have put  grails.plugin.location.'million-common' = "../million-common". Here comes the issue, when I compile any one of the UI projects,  grails complains org.codehaus.groovy.control.MultipleCompilationErrorsException:

lers/LoginController.groovy: 11: unable to resolve class org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
  [groovyc]  @ line 11, column 1.
  [groovyc]    import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
  [groovyc]    ^
................

All the classes from Spring-Security are NOT found. 

I google and found Peter Ledbrook discussing this (http://stackoverflow.com/questions/2450564/custom-grails-plugin-dependency). My problem is the common plugin project is not yet stable and not yet released,  I really don't like to install Spring Security and other plugins everywhere in all my projects. What should I do to resolve this dependency issue?



PS. I have tried in ComomGrailsPlugin.groovy, to set the def dependsOn to include all plugins it useed, such as :

    def dependsOn = [famfamfam: "1.0.1 > *", 
        jquery: "1.4.3.2 > *",
                 jquery-ui: "1.8.6.1 > *",
                 mail: "0.9 > *",
spring-security-core: "1.0.1 > *",
spring-security-openid: "1.0 > *", 
spring-security-ui: "0.1.2 > *",
springcache: "1.2.1 > *"]

but I was experiencing this error:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/home/netwiser/workspaces/1million/million-common/MillionCommonGrailsPlugin.groovy: 9: illegal colon after argument expression;
   solution: a complex label expression before a colon must be parenthesized @ line 9, column 27.
                    jquery-ui: "1.8.6.1 > *",
                             ^

1 error

at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:296)



Regards,

James

Reply | Threaded
Open this post in threaded view
|

RE: Dependency Inheritance

netwiser
Hi,

I have solved the compile error by adding quote to the plugin names. 

But my major issue is not solved yet. For instance, I want to use the comment-able and rate-able plugin, but I need to do some customization to make them suit my own layout. I don't want to install the plugin in every project and maintain the customization here and there. If it can be inherited from a common plugin dependents on these plugins and the other projects use the common plugin can reuse the same customized plugins, that will be great. 

Regards,

James 


From: [hidden email]
Date: Fri, 24 Dec 2010 09:42:29 -0500
To: [hidden email]
Subject: Re: [grails-user] Dependency Inheritance

Thanks Burt, I will try it out. 

Merry Christmas,

James

Sent from my iPhone

On 2010-12-24, at 8:23, Burt Beckwith <[hidden email]> wrote:

You need to install and/or depend on the plugins somehow - grails.plugin.location.<plugin-name> is a configuration override but doesn't pull in the plugin. Your issue is with the dependsOn Map - you can omit quotes from Map keys in Groovy but only if there aren't any spaces, dashes, etc. in the names. So you just need to quote the ones with dashes (or all of them):

   def dependsOn = [
      "spring-security-openid": "1.0 > *", 
      "spring-security-ui": "0.1.2 > *",
      springcache: "1.2.1 > *"]

I omitted the ones that will get pulled in transitively by the others (famfamfam, jquery, jquery-ui, and mail will be pulled by spring-security-core which is pulled by spring-security-openid and spring-security-ui). If those don't resolve (I think there are issues in dependencies of dependencies with inline plugins) then put them back, quoted if necessary.

Burt

On Thu, Dec 23, 2010 at 11:53 PM, James Zhang <[hidden email][hidden email]> wrote:
Hi,

I am working on a new project which will include a desktop and a mobile UI. I have created a common plugin which put all the common classes, such as Users, Profile, etc, together to be shared by two UI projects. 

I would like to use Spring-Security-Core/OpenID/UI plugins, my User class will extends GrailsUser. In order to reduce the complex and duplication, I installed Spring-Security-xxx plugins to my common plugin project instead of 2 UI projects. In both UI projects BuildConfig.groovy, I have put  grails.plugin.location.'million-common' = "../million-common". Here comes the issue, when I compile any one of the UI projects,  grails complains org.codehaus.groovy.control.MultipleCompilationErrorsException:

lers/LoginController.groovy: 11: unable to resolve class org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
  [groovyc]  @ line 11, column 1.
  [groovyc]    import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
  [groovyc]    ^
................

All the classes from Spring-Security are NOT found. 

I google and found Peter Ledbrook discussing this (http://stackoverflow.com/questions/2450564/custom-grails-plugin-dependency). My problem is the common plugin project is not yet stable and not yet released,  I really don't like to install Spring Security and other plugins everywhere in all my projects. What should I do to resolve this dependency issue?



PS. I have tried in ComomGrailsPlugin.groovy, to set the def dependsOn to include all plugins it useed, such as :

    def dependsOn = [famfamfam: "1.0.1 > *", 
        jquery: "1.4.3.2 > *",
                 jquery-ui: "1.8.6.1 > *",
                 mail: "0.9 > *",
spring-security-core: "1.0.1 > *",
spring-security-openid: "1.0 > *", 
spring-security-ui: "0.1.2 > *",
springcache: "1.2.1 > *"]

but I was experiencing this error:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/home/netwiser/workspaces/1million/million-common/MillionCommonGrailsPlugin.groovy: 9: illegal colon after argument expression;
   solution: a complex label expression before a colon must be parenthesized @ line 9, column 27.
                    jquery-ui: "1.8.6.1 > *",
                             ^

1 error

at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:296)



Regards,

James