Create Grails 3 WAR without version number

僤鯓⒐⒋嵵緔 提交于 2019-12-23 08:45:48

问题


In Grails 2 we could define WAR filename like this:

grails.project.war.file = "target/${appName}.war"

How can I override the war filename in Grails 3?

Thanks Jeff.

I have added line like thisin build.gradle:

war {
    archiveName "${war.baseName}.war"
    }

回答1:


In build.gradle you can do something like war.archiveName='jeff.war'. See https://docs.gradle.org/current/dsl/org.gradle.api.tasks.bundling.War.html#org.gradle.api.tasks.bundling.War%3aarchiveName.




回答2:


A more detailed answer: Add this to wrapper task in build.gradle so it creates different war file name based on each environment.

war.archiveName="${war.baseName}_${grails.util.Environment.current.name}.war"

Then create war file like this.

grails -Dgrails.env=staging war


来源:https://stackoverflow.com/questions/33621966/create-grails-3-war-without-version-number

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!