gpt4 book ai didi

grails - 为什么 `grails war`每次都会创建不同的WAR?

转载 作者:行者123 更新时间:2023-12-02 15:20:18 25 4
gpt4 key购买 nike

为什么grails war每次都会生成不同的WAR文件?在命令行中,我观察到以下行为。

$ grails test war
| Done creating WAR target/foo-2.5.3.war
MacBook-Air:foo mba$ md5 target/foo-2.5.3.war
MD5 (target/foo-2.5.3.war) = af45e22b24d158a72c9a0db67cd31417

$ grails test war
| Done creating WAR target/foo-2.5.3.war
MacBook-Air:foo mba$ md5 target/foo-2.5.3.war
MD5 (target/foo-2.5.3.war) = 157635f7d152cb56bc3b5bd731a8fb6e

无需更改,我所做的就是连续运行两次相同的 grails test war命令。从第二次运行生成的WAR文件具有与第一次运行不同的MD5校验和。谁能帮我理解为什么?值得的是,我正在运行Grails 2.5.0。

最佳答案

当Grails产生 war 时,它将使用默认应用程序(grails create-app foo-> grails war)在多个位置插入或更新时间戳。

有时间戳记:

  • application.properties
  • views.properties
  • manifest.properties

  • 此外,不能保证其中某些属性文件中的字符串排序,因此在后续运行中某些行以不同的顺序出现。

    这是我得到的全部差异:
    diff -ru tmp1/ tmp2/
    diff -ru tmp1/WEB-INF/classes/application.properties tmp2/WEB-INF/classes/application.properties
    --- tmp1/WEB-INF/classes/application.properties 2016-05-23 16:36:44.000000000 -0400
    +++ tmp2/WEB-INF/classes/application.properties 2016-05-23 16:37:24.000000000 -0400
    @@ -1,4 +1,4 @@
    -#Mon, 23 May 2016 16:36:43 -0400
    +#Mon, 23 May 2016 16:37:24 -0400
    #Grails Metadata file
    #Mon May 23 16:35:56 EDT 2016
    app.grails.version=2.5.1
    diff -ru tmp1/WEB-INF/classes/gsp/views.properties tmp2/WEB-INF/classes/gsp/views.properties
    --- tmp1/WEB-INF/classes/gsp/views.properties 2016-05-23 16:36:42.000000000 -0400
    +++ tmp2/WEB-INF/classes/gsp/views.properties 2016-05-23 16:37:22.000000000 -0400
    @@ -1,8 +1,8 @@
    #Precompiled views for databaseMigration
    -#Mon May 23 16:36:42 EDT 2016
    +#Mon May 23 16:37:21 EDT 2016
    /WEB-INF/plugins/database-migration-1.4.0/grails-app/views/dbdoc/_overview-summary.gsp=gsp_databaseMigration_dbdoc_overview_summary_gsp
    -/WEB-INF/plugins/database-migration-1.4.0/grails-app/views/dbdoc/_stylesheet.gsp=gsp_databaseMigration_dbdoc_stylesheet_gsp
    /WEB-INF/plugins/database-migration-1.4.0/grails-app/views/dbdoc/_index.gsp=gsp_databaseMigration_dbdoc_index_gsp
    +/WEB-INF/plugins/database-migration-1.4.0/grails-app/views/dbdoc/_stylesheet.gsp=gsp_databaseMigration_dbdoc_stylesheet_gsp
    /WEB-INF/grails-app/views/index.gsp=gsp_5index_gsp
    /WEB-INF/plugins/database-migration-1.4.0/grails-app/views/dbdoc/_globalnav.gsp=gsp_databaseMigration_dbdoc_globalnav_gsp
    /WEB-INF/grails-app/views/layouts/main.gsp=gsp_5_layoutsmain_gsp
    diff -ru tmp1/assets/manifest.properties tmp2/assets/manifest.properties
    --- tmp1/assets/manifest.properties 2016-05-23 16:36:54.000000000 -0400
    +++ tmp2/assets/manifest.properties 2016-05-23 16:37:26.000000000 -0400
    @@ -1,5 +1,5 @@
    #
    -#Mon May 23 16:36:53 EDT 2016
    +#Mon May 23 16:37:25 EDT 2016
    apple-touch-icon-retina.png=apple-touch-icon-retina-21d524e96ee946f16c9b8fb4ea0c3f6e.png
    skin/information.png=skin/information-3750c701d2ec35a45d289b9b9c1a0667.png
    skin/database_add.png=skin/database_add-82a75143b4660a3f02f9c058f0a3ae93.png
    @@ -20,9 +20,9 @@
    errors.css=errors-81f3e38a6e878acd57e3d51912c37b04.css
    main.css=main-46ae5880f56b5942fc138e25d2f87c47.css
    jquery/jquery-1.11.1.min.map=jquery/jquery-1.11.1.min-ffbeb16578d8cdf58104889baacbbef2.map
    -favicon.ico=favicon-9ef27019cc7a636e29ecc851528f716e.ico
    skin/database_save.png=skin/database_save-8303213a3c95654e14d5afd4e72ed4c2.png
    -skin/sorted_desc.gif=skin/sorted_desc-b85986b88116c4b0ef7571a1c4f3cfa3.gif
    +favicon.ico=favicon-9ef27019cc7a636e29ecc851528f716e.ico
    grails_logo.png=grails_logo-eabe4af98753b0163266d7e68bbd32e3.png
    +skin/sorted_desc.gif=skin/sorted_desc-b85986b88116c4b0ef7571a1c4f3cfa3.gif
    jquery/jquery-1.11.1.min.js=jquery/jquery-1.11.1.min-ac124bf54878ec7f20b578d3e627d6a8.js
    skin/house.png=skin/house-99bea32e1990e011e870f6c562e87a6a.png

    关于grails - 为什么 `grails war`每次都会创建不同的WAR?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37399095/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com