服务打包包名设置

pom文件设置打包名,build.time是显示时间,不需要则可以去除

xml 复制代码
<finalName>服务名-${build.time}</finalName>```

```xml
<build>
        <!--suppress UnresolvedMavenProperty -->
        <finalName>服务名-${build.time}</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <id>timestamp-property</id>
                        <goals>
                            <goal>timestamp-property</goal>
                        </goals>
                        <configuration>
                            <name>build.time</name>
                            <pattern>MMddHHmm</pattern>
                            <locale>zh_CN</locale>
                            <timeZone>Asia/Shanghai</timeZone>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
             <!-- 打包时包含git信息,包含分支等信息 -->
            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
                <version>4.9.10</version>
                <executions>
                    <execution>
                        <id>get-the-git-infos</id>
                        <!-- 默认绑定阶段initialize -->
                        <phase>package</phase>
                        <goals>
                            <!-- 目标:revision -->
                            <goal>revision</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!-- 检查的仓库根目录,${project.basedir}:项目根目录,即包含pom.xml文件的目录 -->
                    <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
                    <!-- false:扫描路径时不打印更多信息,默认值false,可以不配置 -->
                    <verbose>false</verbose>
                    <!-- 定义插件中所有时间格式,默认值:yyyy-MM-dd'T'HH:mm:ssZ -->
                    <dateFormat>yyyy-MM-dd HH:mm:ss</dateFormat>
                    <!-- git属性文件中各属性前缀,默认值git,可以不配置 -->
                    <prefix>git</prefix>
                    <!-- 生成git属性文件,默认false:不生成 -->
                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
                    <!-- 生成git属性文件路径及文件名,默认${project.build.outputDirectory}/git.properties -->
                    <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
                    <!-- 生成git属性文件格式,默认值properties -->
                    <format>properties</format>
                    <!-- 配置git-describe命令 -->
                    <gitDescribe>
                        <skip>false</skip>
                        <always>false</always>
                        <dirty>-dirty</dirty>
                    </gitDescribe>
                </configuration>
            </plugin>
        </plugins>
    </build>```
相关推荐
Leinwin2 小时前
OpenClaw 多 Agent 协作框架的并发限制与企业化规避方案痛点直击
java·运维·数据库
薛定谔的悦2 小时前
MQTT通信协议业务层实现的完整开发流程
java·后端·mqtt·struts
enjoy嚣士2 小时前
springboot之Exel工具类
java·spring boot·后端·easyexcel·excel工具类
罗超驿3 小时前
独立实现双向链表_LinkedList
java·数据结构·链表·linkedlist
盐水冰3 小时前
【烘焙坊项目】后端搭建(12) - 订单状态定时处理,来单提醒和顾客催单
java·后端·学习
凸头4 小时前
CompletableFuture 与 Future 对比与实战示例
java·开发语言
wuqingshun3141594 小时前
线程安全需要保证几个基本特征
java·开发语言·jvm
努力也学不会java4 小时前
【缓存算法】一篇文章带你彻底搞懂面试高频题LRU/LFU
java·数据结构·人工智能·算法·缓存·面试
攒了一袋星辰4 小时前
高并发强一致性顺序号生成系统 -- SequenceGenerator
java·数据库·mysql
小涛不学习4 小时前
Spring Boot 详解(从入门到原理)
java·spring boot·后端