idea将springboot项目打成jar包

1.首先,找到pom.xml,把下面的build块中的内容改成如下所示

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!--这里写上main方法所在类的路径-->
<configuration>
<mainClass>com.huitian.auth.starter.HuitianAuthApplication</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

2.项目的根目录,然后用  mvn clean package 这个命令来打包
3.在项目的target目录想找到自己打成的jar包

猜你喜欢

转载自www.cnblogs.com/yscec/p/11977809.html