使用Maven将Spring Boot打包到带有本地JAR的JAR可以通过以下步骤完成:
<build>
标签内添加以下配置:<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
mvn clean package
以上步骤将Spring Boot项目打包成了一个包含本地JAR的JAR文件,可以直接运行该JAR文件来启动Spring Boot应用程序。
领取专属 10元无门槛券
手把手带您无忧上云