網站首頁 編程語言 正文
springboot 打包為jar
項目測試背景是一個擁有jsp的項目
1.修改pom.xml文件
? 1) 指定打包后的文件名稱
<build>
<finalName>mybootfinalName>
build>
2)指定springboot-maven-plugin版本
<plugins>
<plugin>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-maven-pluginartifactId>
<version>1.4.2.RELEASEversion>
plugin>
plugins>
3)指定jsp編譯目錄
<resources>
<resource>
<directory>src/main/webappdirectory>
<targetPath>META-INF/resourcestargetPath>
<includes>
<include>**/*.*include>
includes>
resource>
<resource>
<directory>src/main/javadirectory>
<includes>
<include>**/*.xmlinclude>
includes>
resource>
<resource>
<directory>src/main/resourcesdirectory>
<includes>
<include>**/*.*include>
includes>
resource>
resources>
2.執行操作
點擊右側maven命令。首先點擊clean,然后點擊package打包
在target目錄中就可以看到生成.jar文件,例子是myboot.jar
3.運行
找到生成的jar包的文件目錄,在cmd中鍵入java -jar myboot.jar
4.測試
然后就可以在瀏覽器輸入接口查看了
原文鏈接:https://blog.csdn.net/Lucianklx/article/details/124732168
相關推薦
- 2022-09-13 C#?wpf使用ListBox實現尺子控件的示例代碼_C#教程
- 2022-06-08 Spring Cloud Nacos NacosWatch
- 2022-05-28 C語言實現隨機抽取紙牌程序_C 語言
- 2022-07-02 less與sass(scss)的區別
- 2022-04-16 spyder快捷鍵與python符號化輸出方式_python
- 2022-08-30 AndroidStudio編譯報錯 Connect to repo.maven.apache.org
- 2022-09-30 react中useState使用:如何實現在當前表格直接更改數據_React
- 2022-04-17 jQuery的基本使用
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支