问题
Grails allows us to package up a war very easily with
grails war
I would likemore meta - info somewhere in the war. What time it was built at etc. Is there a switch that will create such a file and fill it with meta info.
回答1:
AFAIK there is no switch to add metadata about the war creation but you can add/delete contents to war during war generation by using this entry in BuildConfig.
grails.war.resources = { stagingDir ->
copy(todir: "${stagingDir}") {
fileset(dir:"${basedir}/path/to/your/meta-info/files") {
//Exclude unwanted files
exclude(name:"**/excluded-file")
}
}
//In case you want to remove something from the staging dir
delete(file:"${stagingDir}/WEB-INF/lib/<deleteSome.jar>")
}
来源:https://stackoverflow.com/questions/18316132/putting-more-info-in-a-grails-wars