创建没有版本号的grails战争

时间:2020-03-06 15:03:04  来源:igfitidea点击:

如何创建grails war文件,使其没有版本号

(例如foo-0.1.war)

当我执行" grails war"命令时,是否添加到末尾?

解决方案

我认为我们可以在war命令中指定战争名称。

grails war foo.war

还要查看最新的Grails文档,以了解在何处将此设置为配置选项。有关详细信息,请参见其他答案。

从Grails文档的第17章,部署

There are also many ways in which you can customise the WAR file that is
  created. For example, you can specify
  a path (either absolute or relative)
  to the command that instructs it where
  to place the file and what name to
  give it:

grails war /opt/java/tomcat-5.5.24/foobar.war

  
  Alternatively, you can add a line to
  Config.groovy that changes the default
  location and filename:

grails.war.destFile = "foobar-prod.war"

  
  Of course, any command line argument
  that you provide overrides this
  setting.

生成没有版本号的war文件的另一种方法是将application.properties属性保留为空。

汇总其他出色的答案。有几种选择:

在命令行上明确设置它:grails war foo.war

在application.properties中将app.version属性设置为空将导致战争被命名为foo.war

使用Config.groovy中的grails.war.destFile属性来明确设置战争的名称