SpringBoot項目離線環(huán)境手動構建的過程
內容來自黑馬程序員-JavaWeb開發(fā)教程
1. 創(chuàng)建maven項目
在idea中創(chuàng)建一個maven項目,正常填寫項目的坐標信息。如下圖所示:
輸入項目的基本信息之后,點擊finish,就可以創(chuàng)建一個maven項目。
但是這個maven項目目前并不是springboot項目,我們還需要做如下兩步操作。
2. pom.xml配置
1). 在pom.xml中指定springboot的父工程
<!-- springboot父工程--> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.7.4</version> <relativePath/> <!-- lookup parent from repository --> </parent>
2). 添加springboot項目的起步依賴以及maven插件
<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>
3. 基本結構
1). 創(chuàng)建基本的包結構 com.itheima,并創(chuàng)建啟動類 SpringBootDemoApplication
2). 并在resources目錄下準備一份配置文件,application.properties (創(chuàng)建一個新的file文件,命名為application.properties)
到此呢,我們就手動創(chuàng)建好了這樣一個springboot項目
到此這篇關于SpringBoot項目離線環(huán)境手動構建的文章就介紹到這了,更多相關SpringBoot離線環(huán)境內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
ArrayList?foreach循環(huán)增添刪除導致ConcurrentModificationException解決分
這篇文章主要為大家介紹了ArrayList?foreach循環(huán)增添刪除導致ConcurrentModificationException解決分析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪<BR>2023-12-12SpringBoot讀取自定義配置文件方式(properties,yaml)
這篇文章主要介紹了SpringBoot讀取自定義配置文件方式(properties,yaml),具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2022-07-07Spring BeanPostProcessor接口使用詳解
本篇文章主要介紹了Spring BeanPostProcessor接口使用詳解,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-01-01