在pom.xml中修改finalName节点的值即可,如下:
1 <build> 2 <plugins> 3 <plugin> 4 <groupId>org.springframework.boot</groupId> 5 <artifactId>spring-boot-maven-plugin</artifactId> 6 </plugin> 7 </plugins> 8 <resources> 9 <resource> 10 <directory>src/main/resources</directory> 11 <includes> 12 <include>**/*.properties</include> 13 </includes> 14 <filtering>true</filtering> 15 </resource> 16 <resource> 17 <directory>src/main/resources</directory> 18 <excludes> 19 <exclude>**/*.properties</exclude> 20 </excludes> 21 <filtering>false</filtering> 22 </resource> 23 </resources> 24 <finalName>projectName</finalName> 25 </build> 26 27 </project>
上面代码片段中,<finalName>projectName</finalName>节中的 projectName 即为war包的名称。