詳解Idea SpringBoot搭建SpringCloud的準(zhǔn)備工作(推薦)
1、編碼設(shè)置
2、開啟注解(讓注解生效)
3、本項(xiàng)目編譯運(yùn)行版本
4、把不需要的文件隱藏(注意可以不用做,做了可以讓項(xiàng)目看起來(lái)更加整潔干凈清晰明了)
以上就是搭建一個(gè)SpringCloud之前的步驟。
二、SpringCloud父工程的依賴
<groupId>org.example</groupId> <artifactId>spring-cloud</artifactId> <version>1.0-SNAPSHOT</version> <!-- 注意一定要改成pom--> <packaging>pom</packaging> <!--這是一個(gè)子工程--> <modules> <module>cloud-provider-payment8001</module> </modules>
<!-- 統(tǒng)一管理jar包版本--> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <!-- 單元測(cè)試的--> <junit.version>4.13</junit.version> <log4j.version>1.2.17</log4j.version> <lombok.version>1.18.12</lombok.version> <mysql.version>8.0.21</mysql.version> <!-- 這是德魯伊的(數(shù)據(jù)庫(kù)連接池)--> <druid.version>1.1.16</druid.version> <mybatis.spring.boot.version>2.1.3</mybatis.spring.boot.version> <!-- 截至2020/10/1日之前根據(jù)官方文檔cloud 的版本Hoxton.SR8 和spring boot的2.3.3.RELEASE最配--> <spring.cloud-version>Hoxton.SR8</spring.cloud-version> <spring.boot-version>2.3.3.RELEASE</spring.boot-version> </properties>
<!-- 提供統(tǒng)一版本作為版本鎖定 子工程就不用寫 groupId和version dependencyManagement只是管理版本號(hào)(父項(xiàng)目和子項(xiàng)目統(tǒng)一版本號(hào)),真正干活有用的還是dependencies--> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>${spring.cloud-version}</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>${spring.boot-version}</version> <type>pom</type> <scope>import</scope> </dependency> <!-- spring-cloud 阿里巴巴版 --> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-alibaba-dependencies</artifactId> <version>2.1.0.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> <!-- junit單元測(cè)試 --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${junit.version}</version> </dependency> <!-- 日志打印log4j --> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>${log4j.version}</version> </dependency> <!-- MySQL的jar --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>${mysql.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>5.2.9.RELEASE</version> </dependency> <!-- 德魯伊數(shù)據(jù)庫(kù)連接池--> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>${druid.version}</version> </dependency> <!-- mybatis和springboot的組合 --> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>${mybatis.spring.boot.version}</version> </dependency> </dependencies> </dependencyManagement>
到此這篇關(guān)于Idea SpringBoot搭建SpringCloud的準(zhǔn)備工作的文章就介紹到這了,更多相關(guān)idea搭建springcloud內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
SpringMVC @RequestBody 為null問(wèn)題的排查及解決
這篇文章主要介紹了SpringMVC @RequestBody 為null問(wèn)題的排查及解決,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2021-10-10SpringBoot項(xiàng)目使用yml文件鏈接數(shù)據(jù)庫(kù)異常問(wèn)題解決方案
在使用SpringBoot時(shí),利用yml進(jìn)行數(shù)據(jù)庫(kù)連接配置需小心數(shù)據(jù)類型區(qū)分,如果用戶名或密碼是數(shù)字,必須用雙引號(hào)包裹以識(shí)別為字符串,避免連接錯(cuò)誤,特殊字符密碼也應(yīng)用引號(hào)包裹2024-10-10Java中利用POI優(yōu)雅的導(dǎo)出Excel文件詳解
這篇文章主要給大家介紹了關(guān)于Java中如何利用POI優(yōu)雅的導(dǎo)出Excel文件的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家學(xué)習(xí)或者使用Java具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2020-05-05使用Log4j為項(xiàng)目配置日志輸出應(yīng)用詳解以及示例演示的實(shí)現(xiàn)分析
本篇文章是對(duì)Log4j為項(xiàng)目配置日志輸出應(yīng)用詳解以及示例演示的實(shí)現(xiàn)進(jìn)行了分析介紹,需要的朋友參考下2013-05-05JavaSwing FlowLayout 流式布局的實(shí)現(xiàn)
這篇文章主要介紹了JavaSwing FlowLayout 流式布局的實(shí)現(xiàn),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2019-12-12Springboot?多級(jí)緩存設(shè)計(jì)與實(shí)現(xiàn)方案
多級(jí)緩存是提升高并發(fā)系統(tǒng)性能的關(guān)鍵策略之一,它不僅能夠減少系統(tǒng)的響應(yīng)時(shí)間,提高用戶體驗(yàn),還能有效降低后端系統(tǒng)的負(fù)載,防止系統(tǒng)過(guò)載,這篇文章主要介紹了Springboot?多級(jí)緩存設(shè)計(jì)與實(shí)現(xiàn),需要的朋友可以參考下2024-02-02Java中的Set接口實(shí)現(xiàn)類HashSet和LinkedHashSet詳解
這篇文章主要介紹了Java中的Set接口實(shí)現(xiàn)類HashSet和LinkedHashSet詳解,Set接口和java.util.List接口一樣,同樣繼承自Collection接口,它與Collection接口中的方法基本一致,并沒有對(duì)Collection接口進(jìn)行功能上的擴(kuò)充,只是比Collection接口更加嚴(yán)格了,需要的朋友可以參考下2024-01-01