开发者学堂课程【微服务+全栈在线教育实战项目演练(SpringCloud Alibaba+SpringBoot):搭建项目环境(创建工程)】学习笔记,与课程紧密连接,让用户快速学习知识。
课程地址:https://developer.aliyun.com/learning/course/667/detail/11281
搭建项目环境(创建工程)
目录:
一、创建新的工程
二、在 pom.xml 中添加依赖的版本
三、添加<properties>确定依赖的版本
四、配置<dependencyManagement>锁定依赖的版本
一、创建新的工程
第一步:建立一个新的工程 guli_parent,在 spring boot 中选择2.1.1.2,然后点击完成。
第二步:修改 pom 文件
<parent>
groupIdorg.springframework.bootx/groupId
artifactIdspring--boot-starter-parent<artifactI d
<version>2.2.1. RELEASE<version>
relativePath/><!--lookup parent from repository
/<parent
<artifactld>芍点后面添加 pom 类型
1.<artifactId>guli-parent</artifactId>
2.<packaging>pam</packaging>
第三步:创建 maven 工程
右击 guli_parent 新建 module 选择 maven 输入子模块名称搭建 service 模块
<xml versTon-"'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.0http://maven.apache.org/xsd/maven-4.0parent>
artifactIdguli_parent</artifactId
groupIdcom.atguigu</groupId
version0.0.1-SNAPSHOT</ version
</parent>
modelVersion4.0.0</modelVersion
<artifactIdservice<artifactId
</project>
二、在 pom.xml 中添加依赖的版本
删除 pom.xmlsag<dependencies>内容
<--以下内容删除-->
<dependencies >
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
(scope test('scope)
(scope test(/scope><dependency>
</dependencies>
三、添加<properties>确定依赖的版本
Kproperties>
<java.version>1.8/java.version>
<guli.version>0.0.1-SNAPSHOT</guli.version>
<mybatis-plus.version>3.0.5</mybatis-plus.version>
<velocity.version>2.0</velocity version>
<swagger.version>2.7.0</swagger.version>
<aliyun.oss.version>2.8.3</aliyun.oss.version>
<jodatime.version>2.10.1</jodatime.version>
<poi.version>3.17</poi.version>
commons-fileupload.version>1.3.1</ccmmons-fileupload.version>
<commons-io.version>2.6</commons-io.version>
chttpclient.version>4.5.1</httpclient.version>
<jwt.version>0.7.0</jwt.version>
<aliyun-java-sdk-core.version>4.3.3</aliyun-java-sdk-core.version>
<aliyun-sdk-oss.version>3.1.0</aliyun-sdk-oss.version>
<allyun-java-sdk-vod.version>2.15.2</aliyun-java-sdk-vod.version>
<aliyun-java-vod-upload.version>1.4.11</aliyun-java-vod-upload.version>
<aliyun-sdk-vod-upload.version>1.4.11</aliyun-sdk-vod-upload.version,<fastjson.version>1.2.28</fastjson version>
<gson.version>2.8.2</gson.version>
<json.version>20170516</json.version>
<commons-dbutils.version>1.7</commons-dbutils.version>
<canal.client.version>1.1.0</canal.client.version>
<docker.image.prefix>zx</docker.image.prefix>
<cloud-alibaba.version>0.2.2.RELEASE</cloud-alibaba.version>
</properties »
四、配置<dependencyManagement>锁定依赖的版本
<dependencyManagement>
<dependencies>
<l--SpringCloud-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artif.actId>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>
cl--mybatis-plus持久层--〉
<dependency>
<groupId>cam.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter/artifactId><version>$mybatis -plus.version</version>
</dependency>
<!-- velocity 模板引擎 Mybatis Plus 代码生成器需要-->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId><version>$(velocity.version)</version>
</dependency>
<!--Swagger-->
<dependency>
<groupId>io.springfox</groupId>
cantifactId>springfox-swagger2</artifactId>
<version>${swagger version}</version>
</dependency>
(!--swagger ui-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui<fartifactId><version>$[swagger.version]</version>
</dependency>
(!--aliyunOSS-->
<dependency>
<groupId>ccm.aliyun.oss
<artifactId>aliyun-sdk-OSs(/artifactId><version>$(aliyun .oss . version]</version></dependency>
<1--日期时间工具-->
<dependency>
<groupId>joda-time</groupId>
<artif actId>joda-time</artifactId>
<version>$(jodatime.version]</version></dependency>
<l--xls-->
<dependency>
<groupId>org. apache.poi </groupId><artifactId>poi</artifactId>
<version>$(poi. version]</version></dependency>
l--xlsx--
<dependency>
<groupId>org.apache.poi</groupId><artifactId>poi-ooxml</artifactId><version>${poi.versin]</version></dependency>
<!--文件上传--〉
<version>$(httpclient.version]</version></dependency>
<dependency>
<groupId>com.google.code.gson</groupId,<artifactId>gson</artifactId>
<version>${gson.version}/ver</dependency>
<dependency>
<groupIdio.jsonwebtoken</groupId><artifactId>jjwt</artifactId>
<version>8{jwt.version}</version</dependency>
(!--aliyun-->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>$aliyun-java-sdk-core.version]</version>