SpringBoot項目離線環(huán)境手動構(gòu)建的過程
內(nèi)容來自黑馬程序員-JavaWeb開發(fā)教程
1. 創(chuàng)建maven項目
在idea中創(chuàng)建一個maven項目,正常填寫項目的坐標(biāo)信息。如下圖所示:

輸入項目的基本信息之后,點擊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. 基本結(jié)構(gòu)
1). 創(chuàng)建基本的包結(jié)構(gòu) com.itheima,并創(chuàng)建啟動類 SpringBootDemoApplication
2). 并在resources目錄下準(zhǔn)備一份配置文件,application.properties (創(chuàng)建一個新的file文件,命名為application.properties)

到此呢,我們就手動創(chuàng)建好了這樣一個springboot項目
到此這篇關(guān)于SpringBoot項目離線環(huán)境手動構(gòu)建的文章就介紹到這了,更多相關(guān)SpringBoot離線環(huán)境內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
ArrayList?foreach循環(huán)增添刪除導(dǎo)致ConcurrentModificationException解決分
這篇文章主要為大家介紹了ArrayList?foreach循環(huán)增添刪除導(dǎo)致ConcurrentModificationException解決分析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪<BR>2023-12-12
SpringBoot讀取自定義配置文件方式(properties,yaml)
這篇文章主要介紹了SpringBoot讀取自定義配置文件方式(properties,yaml),具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2022-07-07
Spring BeanPostProcessor接口使用詳解
本篇文章主要介紹了Spring BeanPostProcessor接口使用詳解,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-01-01

