springcloud学习-02 重构-提取通用模块(自己看的)【周阳springcloud2020学习笔记】
程序员文章站
2024-03-22 18:33:40
...
重构:将公共代码提取
1.建module
2.pom.xml
<dependencies>
<!-- devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<!-- lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<!-- hutool 超好用的工具类 -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.1.0</version>
</dependency>
</dependencies>
3.把代码copy进去
4.maven 执行clean install
5.其他模块pom引入公共module依赖
<dependency>
<groupId>cn.chen.demo</groupId>
<artifactId>api-common</artifactId>
<version>${project.version}</version>
</dependency>