springboot maven 项目打包jar 最后 名称 自定义

maven 文件打包,输入 :package -Dmaven.test.skip=true 进行打包,  一般生成的jar 文件 名称是项目名+版本号这样的

如何在pom.xml 中加入finalname  属性,就可以获得稳定的jar 名称

    <build>
		<finalName>pay</finalName>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
		</plugins>
	</build>

这样最好就能生产  名为  pay.jar  的jar包。

猜你喜欢

转载自blog.csdn.net/atmknight/article/details/81663600
今日推荐