第一个Dubbo的Provider
新建父项目Parent1。最终结构如下:
编写pom.xml继承SpringBoot父项目。
对于dubbo的配置,如果是ssm项目需要一个比较麻烦的步骤,具体的可以去查.springboot直接添加依赖即可
zookeeper 去了哪里,被最后两个依赖封装了,在里面.直接用就行
所以配置一个带web的一个不带web,就是为了给孩子用嘛
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.zhen77</groupId>
<artifactId>DubboParent</artifactId>
<packaging>pom</packaging>
<version>1.0.0</version>
<modules>
<module>api</module>
<module>provider</module>
</modules>
<parent>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.10.RELEASE</version>
</parent>
<!-- 我们在这里面配置的所有依赖都是为了给子工程用的 所以可以使用 dependencyManagement-->
<dependencyManagement>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>2.1.10.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.1.10.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.dubbo/dubbo-spring-boot-starter -->
<dependency>
<groupId>org.apache.dubbo