Eclipse打包Springboot项目

首先,在pom.xml文件中添加配置,修改mainClass主函数:

XML 复制代码
<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
					<mainClass>com.xxx.web.App</mainClass>
					<layout>JAR</layout>
				</configuration>
			</plugin>
		</plugins>
	</build>

然后,在项目的根目录中执行命令:

bash 复制代码
mvn clean package

生成jar文件,并在当前目录执行命令 java -jar xxx.jar

bash 复制代码
java -jar xxxx.jar
相关推荐
程序员爱钓鱼1 天前
Go语言实战案例 — 项目实战篇:简易博客系统(支持评论)
前端·后端·go
excel1 天前
ES6 中函数的双重调用方式:fn() 与 fn\...``
前端
可乐爱宅着1 天前
全栈框架next.js入手指南
前端·next.js
你的人类朋友1 天前
什么是API签名?
前端·后端·安全
昵称为空C1 天前
SpringBoot3 http接口调用新方式RestClient + @HttpExchange像使用Feign一样调用
spring boot·后端
会豪1 天前
Electron-Vite (一)快速构建桌面应用
前端
中微子1 天前
React 执行阶段与渲染机制详解(基于 React 18+ 官方文档)
前端
唐某人丶1 天前
教你如何用 JS 实现 Agent 系统(2)—— 开发 ReAct 版本的“深度搜索”
前端·人工智能·aigc
中微子1 天前
深入剖析 useState产生的 setState的完整执行流程
前端
遂心_1 天前
JavaScript 函数参数传递机制:一道经典面试题解析
前端·javascript