Spring Cloud微服务之父工程的创建(一)

第一步:创建父工程

1、创建sprigboot工程itydf-parent

在idea开发工具中,使用 Spring Initializr 快速初始化一个 Spring Boot 模块,版本使用:2.2.1.RELEASE,不选择任何依赖支持,建立空的Spring Boot模板。

2、删除 src 目录
3、配置 pom.xml

首先artifactId节点后面添加 pom类型

<packaging>pom</packaging>

在这里插入图片描述

4、在pom.xml中添加公共依赖的版本

删除pom.xml中的 dependencies 全部内容 比如默认生成的test测试依赖等等。

添加 properties 确定依赖的版本

 <!--确定依赖的版本-->
 <properties>
     <java.version>1.8</java.version>
     <mybatis-plus.version>3.0.5</mybatis-plus.version>
     <swagger.version>2.7.0</swagger.version>
     <cloud-alibaba.version>0.2.2.RELEASE</cloud-alibaba.version>
 </properties>

配置 dependencyManagement 锁定依赖的版本

<!--锁定依赖的版本-->
<dependencyManagement>
   <dependencies>
       <!--Spring Cloud-->
       <dependency>
           <groupId>org.springframework.cloud</groupId>
           <artifactId>spring-cloud-dependencies</artifactId>
           <version>Hoxton.RELEASE</version>
           <type>pom</type>
           <scope>import</scope>
       </dependency>
       <dependency>
           <groupId>org.springframework.cloud</groupId>
           <artifactId>spring-cloud-alibaba-dependencies</artifactId>
           <version>${cloud-alibaba.version}</version>
           <type>pom</type>
           <scope>import</scope>
       </dependency>

       <!--mybatis-plus 持久层-->
       <dependency>
           <groupId>com.baomidou</groupId>
           <artifactId>mybatis-plus-boot-starter</artifactId>
           <version>${mybatis-plus.version}</version>
       </dependency>

       <!--swagger-->
       <dependency>
           <groupId>io.springfox</groupId>
           <artifactId>springfox-swagger2</artifactId>
           <version>${swagger.version}</version>
       </dependency>
       <!--swagger ui-->
       <dependency>
           <groupId>io.springfox</groupId>
           <artifactId>springfox-swagger-ui</artifactId>
           <version>${swagger.version}</version>
       </dependency>
   </dependencies>
</dependencyManagement>

第二步:创建子模块

后续文章,正在更新。。。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

DT辰白

你的鼓励是我创作的源泉

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值