Quantcast

How to exclude plugin from war

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

How to exclude plugin from war

jphiloon
I am trying to exclude the console plugin from the production war file.   Setting

environments {
    production {
        grails.plugin.excludes='console'
    }
}
in Config.groovy does nothing.   In BuildConfig.groovy I have this:

grails.war.resources = { stagingDir ->
        if (System.getProperty('grails.env') == 'production') {
                delete (includeEmptyDirs: true) {
                        fileset(dir: "${stagingDir}/WEB-INF/classes/", includes : 'ConsoleGrailsPlugin.*,gsp_console*.*' )
                        fileset(dir: "${stagingDir}/WEB-INF/plugins/console-1.1/" )
                }
        }
}

The problem is the second exclusion line - the plugins directory is not in the staging dir at the time this closure is called, even though the war file ends up with "WEB-INF/plugins/console-1.1" in it.

I found I could "fix" the problem if in _GrailsWar.groovy I moved these lines:
       
        warPluginsInternal(compileScopePluginInfos)
        createDescriptorInternal(compileScopePluginInfos, resourceList)

to be BEFORE the call to the buildConfig.grails.war.resources closure.

Is that a good thing?   Whether it is or not, there must be some far better way to exclude the console plugin - via dependencies or something?

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

Re: How to exclude plugin from war

Silvère Lestang
We encountered the same issue recently and we fixed it by replacing runtime by provided before the plugin name in BuildConfig.groovy :
    plugins {

        test ":spock:0.6"

        runtime ":mongodb:1.0.0.RC4"
        runtime ":fixtures:1.1"
        runtime ":hibernate:$grailsVersion"
        build ":tomcat:$grailsVersion"
        provided ":console:1.1"
        runtime ":jquery:1.7.1"
        compile ":resources:1.1.6"
    }

Read maven documentation (http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html) for better understanding of the different dependency scope.

On 27 April 2012 16:05, jphiloon <[hidden email]> wrote:
I am trying to exclude the console plugin from the production war file.
Setting

environments {
   production {
       grails.plugin.excludes='console'
   }
}
in Config.groovy does nothing.   In BuildConfig.groovy I have this:

grails.war.resources = { stagingDir ->
       if (System.getProperty('grails.env') == 'production') {
               delete (includeEmptyDirs: true) {
                       fileset(dir: "${stagingDir}/WEB-INF/classes/", includes :
'ConsoleGrailsPlugin.*,gsp_console*.*' )
                       fileset(dir: "${stagingDir}/WEB-INF/plugins/console-1.1/" )
               }
       }
}

The problem is the second exclusion line - the plugins directory is not in
the staging dir at the time this closure is called, even though the war file
ends up with "WEB-INF/plugins/console-1.1" in it.

I found I could "fix" the problem if in _GrailsWar.groovy I moved these
lines:

       warPluginsInternal(compileScopePluginInfos)
       createDescriptorInternal(compileScopePluginInfos, resourceList)

to be BEFORE the call to the buildConfig.grails.war.resources closure.

Is that a good thing?   Whether it is or not, there must be some far better
way to exclude the console plugin - via dependencies or something?



--
View this message in context: http://grails.1312388.n4.nabble.com/How-to-exclude-plugin-from-war-tp4592777p4592777.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
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

The type org.springframework.security.core.GrantedAuthority cannot be resolved. It is indirectly referenced from required .class files

mlotfi
Hi,

I created a controller :

grails create-controller org.grails.twitter.Status

1 package org.grails.twitter
2
3 class StatusController {
4
5   def index() { }
6 }

In line 1 there is an error :

The type org.springframework.security.core.GrantedAuthority cannot be resolved. It is indirectly referenced from required .class files


Please your help is appreciated.
thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: The type org.springframework.security.core.GrantedAuthority cannot be resolved. It is indirectly referenced from required .class files

ideasculptor
On Fri, Apr 27, 2012 at 8:17 PM, A. Lotfi <[hidden email]> wrote:
Hi,

I created a controller :

grails create-controller org.grails.twitter.Status

1 package org.grails.twitter
2
3 class StatusController {
4
5   def index() { }
6 }

In line 1 there is an error :

The type org.springframework.security.core.GrantedAuthority cannot be resolved. It is indirectly referenced from required .class files


does 'grails refresh-dependencies' fix it?  I assume that you have the spring-security-core plugin installed in your project?

--sam

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

Re: The type org.springframework.security.core.GrantedAuthority cannot be resolved. It is indirectly referenced from required .class files

mlotfi
Thank you, I did  refresh-dependencies, it's working now.


From: Samuel Gendler <[hidden email]>
To: [hidden email]
Sent: Saturday, April 28, 2012 2:20 AM
Subject: Re: [grails-user] The type org.springframework.security.core.GrantedAuthority cannot be resolved. It is indirectly referenced from required .class files

On Fri, Apr 27, 2012 at 8:17 PM, A. Lotfi <[hidden email]> wrote:
Hi,

I created a controller :

grails create-controller org.grails.twitter.Status

1 package org.grails.twitter
2
3 class StatusController {
4
5   def index() { }
6 }

In line 1 there is an error :

The type org.springframework.security.core.GrantedAuthority cannot be resolved. It is indirectly referenced from required .class files


does 'grails refresh-dependencies' fix it?  I assume that you have the spring-security-core plugin installed in your project?

--sam



Loading...