1、准备工作
下载dubbox的源代码
下载地址:https://github.com/dangdangdotcom/dubbox
修改dubbox的父工程,在pom文件中找到,spring.bom.version将spring由 3.2.8-RELEASE修改为4.2.4.RELEASE(主要是适配自己spring的版本)
将dubbo-rpc-http工程的HttpProtocol类中的CommonsHttpInvokerRequestExecutor替换成HttpComponentsHttpInvokerRequestExecutor
(主要是为了兼容web-service rest)
将项目中有插件:maven-assembly-plugin的版本设置成:2.2.1(主要是适配自己的版本)
将项目编译
2、编译源码(此处默认大家会用maven了)
运行maven命令:mvn clean install -Dmaven.test.skip=true ,此处注意,有坑,在win10上面默认是使用 windows PowerShell来启动的,在这个工具下是不能使用这条命令的,得换成这一条:
mvn `-Dmaven.test.skip=true install
原因是:The reason for this is, in Powershell the "-
" has special meaning and it is causing problem with maven.
按照这样修改后即可安装成功
3,安装dubbo-2.8.4.jar包到maven仓库中如下操作:
mvn install:install-file -Dfile=d:/dubbo-2.8.4.jar -DgroupId=com.alibaba -DartifactId=dubbo -Dversion=2.8.4 -Dpackaging=jar -DgeneratePom=true
4,引入jar包
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<version>2.8.4</version>
</dependency>