How to access maven.build.timestamp for resource filtering

前端 未结 4 553
北荒
北荒 2020-12-02 08:20

I am using maven 3.0.4 and would like to make the build timestamp accessible to my application. For this, I\'m putting a placeholder in a .properties file and l

4条回答
  •  旧时难觅i
    2020-12-02 08:51

    I have discovered this article, explaining that due to a bug in maven, the build timestamp does not get propagated to the filtering. The workaround is to wrap the timestamp in another property:

    
       ${maven.build.timestamp}
       yyyy-MM-dd HH:mm
    
    

    Filtering then works as expected for

    buildTimestamp=${timestamp}
    

提交回复
热议问题