```
Springboot+dubbo整合教程1:创建父模块及子模块规划-【IT123私塾出品】
联系方式
Users users = new Users();
users.setName("IT123私塾mastudy老师");
users.setEmail("1261639911@qq.com");
users.setPassword("weixin:mastudy");
int mum = usersService.add(users);
软件准备:
开发工具:sts
下载地址:https://download.springsource.com/release/STS/3.9.9.RELEASE/dist/e4.12/spring-tool-suite-3.9.9.RELEASE-e4.12.0-win32-x86_64.zip
JavaJdk版本:jdk8
Springboot版本:2.0.4.RELEASE
dubbo-spring-boot-starter版本0.2.0
创建一个springboot-dubbo的工程作为父工程 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.it123</groupId>
<artifactId>springboot-dubbo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>mdubbo</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<modules>
<!-- 模块规划 -->
<module>springboot-dubbo-common-code</module>
<!-- 公共核心必备包模块 -->
<module>springboot-dubbo-common-face</module>
<!-- 公共service接口引入模块 -->
<module>springboot-dubbo-common-utils</module>
<!-- 公共工具类模块 -->
<module>springboot-dubbo-users-service</module>
<!-- 用户服务提供模块 端口2000-->
<module>springboot-dubbo-web</module>
<!-- 测试web展示模块 -端口80-->
</modules>
</project>
创建几个必须的通用模块,作为子模块,
<!-- 模块规划 -->
<module>springboot-dubbo-common-code</module>
<!-- 公共核心必备包模块 -->
<module>springboot-dubbo-common-face</module>
<!-- 公共service接口引入模块 -->
<module>springboot-dubbo-common-utils</module>
<!-- 公共工具类模块 -->
<module>springboot-dubbo-users-service</module>
<!-- 用户服务提供模块 端口2000-->
<module>springboot-dubbo-web</module>
<!-- 测试web展示模块 -端口80-->
```