1 把dubbo消费的jar安装到本地maven仓库
mvn install:install-file -Dfile=F:\dataService-1.0-SNAPSHOT.jar -DgroupId=com.dataService.api -DartifactId=dataService -Dversion=1.0 -Dpackaging=jar
2 项目pom文件引入服务jar包,需要与安装时的信息对应
<dependency> <groupId>com.dataService.api</groupId> <artifactId>dataService</artifactId> <version>1.0</version> </dependency>
3 创建dubbo.xml,我这边路径为 resource/config/dubbo.xml
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://code.alibabatech.com/schema/dubbo http://code.al