麦克斯仇
Think different
159
文章
36872
阅读
首页
INDEX
文章
ARTICLE
关于
ABOUT
微服务入门教程0:基础环境搭建
创建日期:
2021/08/01
修改日期:
2023/02/19
Java
SpringBoot
SpringCloud
Nacos
Zipkin
GateWay
Feign
Sleuth
> 微服务入门示例 # 环境 问题 | 方案 ---|--- 配置中心 | Nacos Config 注册中心 | Nacos Discovery 网关 | Gateway 负载均衡 | LoadBalancer 服务调用 | OpenFeign 链路追踪 | Sleuth + zipkin 分布式会话 | Spring Session # 父POM ```xml <?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.6.1</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.maxqiu.demo</groupId> <artifactId>demo-SpringCloud</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>pom</packaging> <properties> <java.version>11</java.version> </properties> <modules> <!-- 注册中心 --> <module>demo-SpringCloud-Discovery</module> <!-- 配置中心 --> <module>demo-SpringCloud-Config</module> <!-- 服务调用 --> <module>demo-SpringCloud-Feign</module> <!-- 服务端 --> <module>demo-SpringCloud-Server</module> <!-- 公共实体对象 --> <module>demo-SpringCloud-Common</module> <!-- 网关 --> <module>demo-SpringCloud-Gateway</module> <!-- 链路追踪 --> <module>demo-SpringCloud-Sleuth</module> </modules> <dependencies> <!-- Lombok --> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> </dependencies> <dependencyManagement> <dependencies> <!-- SpringCloud --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>2021.0.0</version> <type>pom</type> <scope>import</scope> </dependency> <!-- SpringCloud Alibaba --> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-alibaba-dependencies</artifactId> <version>2021.1</version> <type>pom</type> <scope>import</scope> </dependency> <!-- 公共模块 --> <dependency> <groupId>com.maxqiu.demo</groupId> <artifactId>demo-SpringCloud-Common</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> </dependencies> </dependencyManagement> <build> <finalName>${project.artifactId}</finalName> <plugins> <!-- SpringBoot默认打包插件 --> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <excludes> <exclude> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> </exclude> </excludes> </configuration> </plugin> <!-- 编译插件 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <!-- 指定jdk版本 --> <source>${java.version}</source> <target>${java.version}</target> <!-- 指定编码 --> <encoding>UTF-8</encoding> </configuration> </plugin> <!-- maven 打包时跳过测试 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <skip>true</skip> </configuration> </plugin> </plugins> </build> </project> ```
11
全部评论