Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7793073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:22:16+00:00 2026-06-01T22:22:16+00:00

We are using various plugins in our grails application (like logging, spring security core,

  • 0

We are using various plugins in our grails application (like logging, spring security core, ui, acl and many others). Now these plugins come with default gsps (in the views folder of each plugin).

I want to build a WAR without including the views of any plugin. So when the war is built right now it creates the plugins folder which contains views folder which come by default with the plugin, these views are introducing a lot of vulnerabilities and so I want to exclude the plugins views.

I am trying this right now in BuildConfig.groovy like below:

grails.project.dependency.resolution = {
grails.war.resources = { stagingDir ->
   println "Customized delete started..."
   delete{fileset dir: "${stagingDir}/WEB-INF/plugins/logging-0.1/grails-app/views/"}
   delete{fileset dir: "${stagingDir}/WEB-INF/plugins/spring-security-ui-0.1.2/grails-app/views/"}
    }
   }

But the problem is the code tries to delete the views when they are not yet created by the war building process. Hence I get a file not found error for those plugins views.

Where should I write the code to delete the plugins views so that they are already created and available to delete when building the WAR, or how do I not include the plugins views in the WAR?

Thanks in advance..
Priyank

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:22:17+00:00Added an answer on June 1, 2026 at 10:22 pm

    I answered this question on the Grails mailing list.
    http://grails.1312388.n4.nabble.com/deleting-plugins-views-gsp-when-building-the-war-td4560517.html
    (The answer hasn’t yet shown up in nabble)

    You can remove/add files from/to a war file in the eventCreateWarStart
    event specified in scripts/_Events.groovy file.

    This might work:

    filename: scripts/_Events.groovy

    eventCreateWarStart = { warName, stagingDir ->
       Ant.delete(dir: "${stagingDir}/WEB-INF/plugins/logging-0.1/grails-app/views")
       Ant.delete(dir: "${stagingDir}/WEB-INF/classes", includes:"gsp_logging*.*")
       Ant.delete(dir: "${stagingDir}/WEB-INF/plugins/spring-security-ui-0.1.2/grails-app/views")
       Ant.delete(dir: "${stagingDir}/WEB-INF/classes", includes:"gsp_springSecurityUi*.*")
    }
    

    I’m not sure if you could also remove plugin Controller classes without problems. We’ve used Filter classes to “disable” controllers provided by plugins.

    As a side-note you can disable “development-only” plugins in the production environment by using the yet undocumented “grails.plugins.excludes” feature:

    Example:
    in Config.groovy:

    import grails.util.Environment
    
    if(Environment.current == Environment.PRODUCTION) {
        grails.plugin.excludes = ['somePluginName']
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using PDF documents for various purposes using iText library. Its like one
I've written an application using wxPython and various other small modules (xlrd, xlwrt, pyserial,
I started using Hudson a week ago. I was able to add various plugins
I am creating a WordPress site using Artisteer and various plugins to show off
I've been using various javascript frameworks including mootools, jquery, prototype and scriptaculous and have
I've been using various source control systems for a while, but when it comes
I'm using various functions from the earthdistance module in PostgreSQL, one of those being
I am currently using various back-end services and I want to use PHP to
I'm trying to run various commands using psexec.exe from Windows Sysinternals . What I
I have a page where the user can edit various content using buttons and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.