规范的包名对开发及运维人员的记录及备份是有益的!
如何在maven 打包时后缀加时间,在原有打包plugin后面加如下代码:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.9.1</version>
<executions>
<execution>
<id>timestamp-property</id>
<goals>
<goal>timestamp-property</goal>
</goals>
</execution>
</executions>
<configuration>
<name>current.time</name>
<pattern>yyyy-MM-dd-HHmmss</pattern>
<timeZone>GMT+8</timeZone>
<regex/>
<source/>
<value/>
</configuration>
</plugin>
</plugins>
<!--设置打包后生产的包名 -->
<finalName>zjm_demo-${current.time}</finalName>
文章介绍了如何使用Maven的build-helper-maven-plugin插件在打包过程中插入当前时间戳,以创建具有时间信息的包名,这有助于开发和运维人员进行记录与备份。
1500

被折叠的 条评论
为什么被折叠?



