user
08/04/2025, 4:44 PMgrails dev war) without any front-end files that I don’t need.
• First, I tried excluding them in Config.groovy using:
grails.assets.excludes = [
"**/*.gsp",
"**/*.js",
"**/*.css",
"**/*.ts",
"**/*.png",
"**/*.jpg",
"**/*.jpeg",
"**/*.gif",
"**/*.svg",
]
However, the .gsp files were still included in the WAR.
• Next, I tried excluding them in BuildConfig.groovy:
grails.project.war.excludes = [
'**/*.gsp',
'WEB-INF/grails-app/views/**/*'
]
grails.war.resources = { stagingDir ->
delete(includeEmptyDirs: true) {
fileset(dir: "${stagingDir}/WEB-INF/grails-app/views") {
include(name: '**/*.gsp')
}
}
def pluginsDir = new File("${stagingDir}/WEB-INF/plugins")
if (pluginsDir.exists()) {
delete(includeEmptyDirs: true) {
fileset(dir: pluginsDir.absolutePath) {
include(name: '**/*.gsp')
}
}
}
delete(includeEmptyDirs: true) {
fileset(dir: "${stagingDir}/WEB-INF/classes") {
include(name: '**/*_gsp.class')
}
}
}
But the .gsp files are still being packaged.
Question:
How can I reliably remove all .gsp files from the WAR file in Grails 2.5.6?