开发者

How to set version for grails application when deployed

insted of using

 grails> set-version

command, is there any possible ways to generate application version when deployed 开发者_运维问答itself.


You can set it by changing app.version in application.properties (at the project base directory).

I'm not completely clear what you mean by "when deployed", but you could change the version programmatically during your build (by editing the file), if that's what you're asking.

Once the application is packaged up into a war and deployed, changing the version would be tougher. You can rename the war (to not include the version), if that's what you're concerned about.


The app version is static; the set-version script simply updates the version number in application.properties. The version is a build-time property, it's not something that you would change at deployment time.

I'm not sure why you would want to change a version number during deployment. From a configuration management perspective build numbers are usually part of the build itself and don't ever change until there is another build.


I was able to achieve this (grails 3.3.0) by setting the version parameter in build.gradle file of the application

version "0.2"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜