国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術(shù)文章
文章詳情頁

IDEA使用SpringAssistant插件創(chuàng)建SpringCloud項目

瀏覽:14日期:2023-09-20 17:37:25
目錄1、配置 IDEA 的 Maven 環(huán)境2、安裝 Spring Assistant 插件3、創(chuàng)建 Spring Cloud 項目1、配置 IDEA 的 Maven 環(huán)境

單擊菜單欄中的 File → Settings → Build, Execution, Deployment → Build Tools → Maven 菜單,在彈出的設(shè)置窗口中設(shè)置 Maven 路徑信息,如下圖:

IDEA使用SpringAssistant插件創(chuàng)建SpringCloud項目

2、安裝 Spring Assistant 插件

創(chuàng)建 Spring Cloud(Spring Boot)有兩種方式,這里使用 Spring Assistant 插件創(chuàng)建項目。

(1)啟動 IDEA,單擊菜單欄中的 File → Settings → plugins 菜單。

(2)進(jìn)入界面,在搜索框中輸入關(guān)鍵字 “Spring Assistant”,然后按 Enter 鍵,會搜索到 Spring Assistant(Spring 助理)。在 Spring Assistant 的下方點擊 “Install” 按鈕即可完成安裝。如下圖:

IDEA使用SpringAssistant插件創(chuàng)建SpringCloud項目

(3)重啟 IDEA 后即可使用。

3、創(chuàng)建 Spring Cloud 項目

下面以創(chuàng)建 Spring Cloud 項目中的基于 Consul 的“服務(wù)提供者”為例。

(1)打開 IDEA 開發(fā)工具后,選擇菜單:File → New → Project。

在左邊欄中選擇 Spring Assistant,點擊 “Next” 按鈕。

IDEA使用SpringAssistant插件創(chuàng)建SpringCloud項目

(2)輸入項目相關(guān)信息,點擊 “Next” 按鈕。

IDEA使用SpringAssistant插件創(chuàng)建SpringCloud項目

(3)創(chuàng)建基于 Consul 的“服務(wù)提供者”,選擇項如下圖,點擊 “Next” 按鈕。

IDEA使用SpringAssistant插件創(chuàng)建SpringCloud項目

(4)項目創(chuàng)建完成,項目結(jié)構(gòu)圖如下:

IDEA使用SpringAssistant插件創(chuàng)建SpringCloud項目

打開 pom.xml 文件內(nèi)容如下:

<?xml version='1.0' encoding='UTF-8'?><project xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd'><modelVersion>4.0.0</modelVersion><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.5.1</version><relativePath/> <!-- lookup parent from repository --></parent><groupId>com.pjb</groupId><artifactId>provider</artifactId><version>0.0.1-SNAPSHOT</version><name>Provider</name><description>Demo project for Spring Boot</description><properties><java.version>11</java.version><spring-cloud.version>2020.0.3</spring-cloud.version></properties><dependencies> <!-- Spring Cloud Consul 的依賴 --><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-consul-discovery</artifactId></dependency> <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency></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></dependencies></dependencyManagement> <build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins></build> </project>

從 pom.xml 文件中可以看出,Consul 的依賴已經(jīng)自動添加。

以上就是IDEA使用SpringAssistant插件創(chuàng)建SpringCloud項目的詳細(xì)內(nèi)容,更多關(guān)于IDEA創(chuàng)建SpringCloud項目的資料請關(guān)注好吧啦網(wǎng)其它相關(guān)文章!

標(biāo)簽: Spring
相關(guān)文章:
主站蜘蛛池模板: 凤凰县| 沙坪坝区| 弥渡县| 双流县| 罗江县| 威远县| 通渭县| 沙田区| 扶风县| 红桥区| 三穗县| 南汇区| 繁峙县| 射洪县| 金门县| 衡山县| 舞钢市| 崇阳县| 闻喜县| 修武县| 许昌市| 都江堰市| 嵩明县| 定州市| 固阳县| 贺兰县| 泾川县| 突泉县| 平南县| 龙游县| 新乐市| 江永县| 东光县| 石狮市| 凤翔县| 昭苏县| 辽源市| 黑龙江省| 横山县| 凯里市| 桃江县|