dubbo测试搭建 --- 使用maven设计模块(二)

代码示例访问我的github: https://github.com/WilsonZhang8/dubbo-demo

初步试用dubbo,首先使用maven设计了各个模块之间的继承关系。
dubbo-parent是父模块,仅仅提供公共的配置,消除重复配置。
dubbo-simple-entity是实体类,常用的po vo 持久化实体等。
dubbo-simple-service-api提供了dao和service对应的api接口。( 生产者接口定义)
dubbo-simple-service-impl提供了dao和service对应api的接口实现。(生产者实现(或消费者使用),dubbo对应的生产者)
dubbo-config提供了 dubbo-simple-service-api和dubbo-simple-service-impl的配置。

dubbo-simple-webapp一般作为控制转发,是Controller层的实现。(一般作为消费者,调用dubbo提供的服务)。




创建dubbo-parent模块
由于父模块只是为了帮助消除配置的重复,因此它本身不包含除pom之外的项目文件,也就不需要src/main/java/之类的文件夹了。

pom.xml文件中报下面的错误则代表:不要使用eclipse中自带的maven,要配置自己的maven及setting文件。

Description Resource Path Location Type CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:3.1 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:3.1 from/to central ( https://repo.maven.apache.org/maven2): repo.maven.apache.org pom.xml /dubbo-simple line 1 Maven Project Build Lifecycle Mapping Problem

1.创建实体模块dubbo-simple-entity继承于父模块dubbo-parent.
该模块主要是包含了po jo vo 等各种新的实体对象或者包含了持久化对象。

2.创建服务接口API模块dubbo-simple-service-api 继承于父模块dubbo-parent.
3.创建服务接口API实现模块 dubbo-simple-service-impl继承于父模块dubbo-parent.
4.接口api和接口实现模块对应的配置模块 dubbo-config

5.创建web控制器模块dubbo-simple-webapp 继承于父模块dubbo-parent.



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值