Quantcast

Remove some plugins' jar

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Remove some plugins' jar

matafe
How can I remove some plugins' jar of my war file?
For example, I use de acegi plugin but I dont want to use open id, facebook... so a remove all reference in my controllers... and now I want to remove the jar... (spring-security-openid*.jar,....)

This work for remove some jar (hsqldb.jar) of the grails app:
//BuildConfig.groovy
inherits( "global" ) { excludes 'hsqldb' }

But and the jar of the plugin?

Regards
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re[grails-user] move some plugins' jar

burtbeckwith
You can use the 'grails.war.resources' callback in BuildConfig.groovy - here's a modified version of one I've used:

grails.war.resources = { stagingDir ->

   File libDir = new File(stagingDir, 'WEB-INF/lib')

   def deleteJars = { jarNameStart ->
      libDir.eachFile { file ->
         if (file.name.startsWith(jarNameStart)) {
            file.delete()
            println "deleted jar $file"
         }
      }
   }

   deleteJars 'hsqldb' // unit test only
   deleteJars 'junit' // unit test only
   deleteJars 'oscache' // not used
   deleteJars 'openid' // not used
   deleteJars 'spring-security-openid' // not used
   deleteJars 'spring-test' // unit test only
}

Burt

>
> How can I remove some plugins' jar of my war file?
> For example, I use de acegi plugin but I dont want to use open id,
> facebook... so a remove all reference in my controllers... and now I want to
> remove the jar... (spring-security-openid*.jar,....)
>
> This work for remove some jar (hsqldb.jar) of the grails app:
> //BuildConfig.groovy
> inherits( "global" ) { excludes 'hsqldb' }
>
> But and the jar of the plugin?
>
> Regards
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re[grails-user] move some plugins' jar

matafe
Greate Buck...worked... but is there no way todo it with Dependency Resolution?

Thanks



Burt Beckwith wrote
You can use the 'grails.war.resources' callback in BuildConfig.groovy - here's a modified version of one I've used:

grails.war.resources = { stagingDir ->

   File libDir = new File(stagingDir, 'WEB-INF/lib')

   def deleteJars = { jarNameStart ->
      libDir.eachFile { file ->
         if (file.name.startsWith(jarNameStart)) {
            file.delete()
            println "deleted jar $file"
         }
      }
   }

   deleteJars 'hsqldb' // unit test only
   deleteJars 'junit' // unit test only
   deleteJars 'oscache' // not used
   deleteJars 'openid' // not used
   deleteJars 'spring-security-openid' // not used
   deleteJars 'spring-test' // unit test only
}

Burt

>
> How can I remove some plugins' jar of my war file?
> For example, I use de acegi plugin but I dont want to use open id,
> facebook... so a remove all reference in my controllers... and now I want to
> remove the jar... (spring-security-openid*.jar,....)
>
> This work for remove some jar (hsqldb.jar) of the grails app:
> //BuildConfig.groovy
> inherits( "global" ) { excludes 'hsqldb' }
>
> But and the jar of the plugin?
>
> Regards
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Loading...