dubbo测试搭建 --- 使用maven设计模块(二)
2016-08-20 11:20
519 查看
代码示例访问我的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 fromhttps://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.
初步试用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 fromhttps://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.
相关文章推荐
- Leetcode 167. Two Sum II - Input array is sorted (Medium) (cpp)
- 线程池函数1 - 异步调用函数
- 点图层叠加与事件响应
- [leetcode] 310. Minimum Height Trees
- PAT甲级.1027. Colors in Mars (20)
- Lambda表达式
- 栈和队列面试题(二)
- AlertDialog的简单实用
- 写JSP文件遇到的一个问题
- 树上路径
- 父类调用子类的成员变量
- <s:doubleselect 的使用-不支持EL表达式,需要使用OGNL来动态赋值-could not be resolved as a collection/array/map/enumerati
- String类常用属性方法小结
- 用 PNChart 做统计图
- 2014-11-12-自定义子弹
- Python读写文件
- 陶瓷贴片电容的容值和封装对应的选择关系
- linux下修改ip地址
- 找零问题
- C的内部函数和外部函数