学习编译dubbox并发布到私服(nexus)

使用brew安装nexus

nexus在Mac中安装

1
$ brew install nexus

默认端口8081

dubbox源码下载

1
2
3
4
5
6
7
8
9
$ git clone https://github.com/dangdangdotcom/dubbox.git
Cloning into 'dubbox'...
remote: Counting objects: 46039, done.
remote: Total 46039 (delta 0), reused 0 (delta 0), pack-reused 46039
Receiving objects: 100% (46039/46039), 7.14 MiB | 665.00 KiB/s, done.
Resolving deltas: 100% (15973/15973), done.
Checking connectivity... done.
root:git shaozhipeng$ ls
dubbox

修改pom.xml文件

1
2
3
4
5
6
7
<!-- 发布到私服,mvn deploy -->
<distributionManagement>
<repository>
<id>thirdparty</id>
<url>http://127.0.0.1:8081/nexus/content/repositories/thirdparty/</url>
</repository>
</distributionManagement>

修改maven的settings.xml

1
2
3
4
5
<server>
<id>thirdparty</id>
<username>admin</username>
<password>admin123</password>
</server>

mvn install -Dmaven.test.skip=true

打包遇到的:

ERROR 执行mvn clean(检查命令的-是否正确)

1
2
3
4
5
6
7
[ERROR] Unknown lifecycle phase "?Dmaven.test.skip=true". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/LifecyclePhaseNotFoundException

ERROR 执行export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home(检查Java的环境变量)

1
[ERROR] Failure executing javac,  but could not parse the error:

ERROR com.alibaba.dubbo.container.jetty.JettyContainer server.start()方法报错

1
2
3
4
5
6
[ERROR] /Users/shaozhipeng/2016/git/dubbox/dubbo-container/dubbo-container-jetty/src/main/java/com/alibaba/dubbo/container/jetty/JettyContainer.java:[61,17] 错误: 无法访问AbstractLifeCycle
[ERROR] 找不到org.mortbay.component.AbstractLifeCycle的类文件
/Users/shaozhipeng/2016/git/dubbox/dubbo-container/dubbo-container-jetty/src/main/java/com/alibaba/dubbo/container/jetty/JettyContainer.java:[78,18] 错误: 找不到符号
[ERROR] 类型为Server的变量 server
/Users/shaozhipeng/2016/git/dubbox/dubbo-container/dubbo-container-jetty/src/main/java/com/alibaba/dubbo/container/jetty/JettyContainer.java:[86,26] 错误: 二元运算符 '!=' 的操作数类型错误
[INFO] 3 errors

<jetty_version>6.1.26</jetty_version>版本号改为6.1.25

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
[INFO] dubbo-parent ....................................... SUCCESS [  0.858 s]
[INFO] Hessian Lite(Alibaba embed version) ................ SUCCESS [ 5.155 s]
[INFO] dubbo-common ....................................... SUCCESS [ 6.512 s]
[INFO] dubbo-container .................................... SUCCESS [ 0.010 s]
[INFO] dubbo-container-api ................................ SUCCESS [ 1.520 s]
[INFO] dubbo-container-spring ............................. SUCCESS [ 0.793 s]
[INFO] dubbo-container-javaconfig ......................... SUCCESS [ 0.848 s]
[INFO] dubbo-container-jetty .............................. SUCCESS [ 0.809 s]
[INFO] dubbo-container-log4j .............................. SUCCESS [ 0.970 s]
[INFO] dubbo-container-logback ............................ SUCCESS [ 0.993 s]
[INFO] dubbo-remoting ..................................... SUCCESS [ 0.005 s]
[INFO] dubbo-remoting-api ................................. SUCCESS [ 2.506 s]
[INFO] dubbo-remoting-netty ............................... SUCCESS [ 1.416 s]
[INFO] dubbo-remoting-mina ................................ SUCCESS [ 1.212 s]
[INFO] dubbo-remoting-grizzly ............................. SUCCESS [ 1.183 s]
[INFO] dubbo-remoting-p2p ................................. SUCCESS [ 1.884 s]
[INFO] dubbo-remoting-http ................................ SUCCESS [ 1.638 s]
[INFO] dubbo-remoting-zookeeper ........................... SUCCESS [ 1.489 s]
[INFO] dubbo-rpc .......................................... SUCCESS [ 0.008 s]
[INFO] dubbo-rpc-api ...................................... SUCCESS [ 3.170 s]
[INFO] dubbo-rpc-default .................................. SUCCESS [ 2.836 s]
[INFO] dubbo-rpc-injvm .................................... SUCCESS [ 0.972 s]
[INFO] dubbo-rpc-rmi ...................................... SUCCESS [ 1.043 s]
[INFO] dubbo-rpc-hessian .................................. SUCCESS [ 1.732 s]
[INFO] dubbo-rpc-http ..................................... SUCCESS [ 1.255 s]
[INFO] dubbo-rpc-webservice ............................... SUCCESS [ 1.825 s]
[INFO] dubbo-cluster ...................................... SUCCESS [ 3.221 s]
[INFO] dubbo-registry ..................................... SUCCESS [ 0.005 s]
[INFO] dubbo-registry-api ................................. SUCCESS [ 1.762 s]
[INFO] dubbo-monitor ...................................... SUCCESS [ 0.006 s]
[INFO] dubbo-monitor-api .................................. SUCCESS [ 1.391 s]
[INFO] dubbo-filter ....................................... SUCCESS [ 0.006 s]
[INFO] dubbo-filter-validation ............................ SUCCESS [ 1.802 s]
[INFO] dubbo-filter-cache ................................. SUCCESS [ 1.246 s]
[INFO] dubbo-registry-default ............................. SUCCESS [ 1.354 s]
[INFO] dubbo-monitor-default .............................. SUCCESS [ 1.160 s]
[INFO] dubbo-registry-multicast ........................... SUCCESS [ 1.692 s]
[INFO] dubbo-config ....................................... SUCCESS [ 0.009 s]
[INFO] dubbo-config-api ................................... SUCCESS [ 3.732 s]
[INFO] dubbo-config-spring ................................ SUCCESS [ 2.543 s]
[INFO] dubbo-rpc-thrift ................................... SUCCESS [ 2.462 s]
[INFO] dubbo-rpc-memcached ................................ SUCCESS [ 1.364 s]
[INFO] dubbo-rpc-redis .................................... SUCCESS [ 1.492 s]
[INFO] dubbo-rpc-rest ..................................... SUCCESS [ 1.748 s]
[INFO] dubbo-registry-zookeeper ........................... SUCCESS [ 1.771 s]
[INFO] dubbo-registry-redis ............................... SUCCESS [ 1.987 s]
[INFO] dubbo .............................................. SUCCESS [ 25.708 s]
[INFO] dubbo-simple ....................................... SUCCESS [ 0.008 s]
[INFO] dubbo-registry-simple .............................. SUCCESS [ 57.409 s]
[INFO] dubbo-monitor-simple ............................... SUCCESS [ 11.515 s]
[INFO] dubbo-admin ........................................ SUCCESS [ 11.213 s]
[INFO] dubbo-demo ......................................... SUCCESS [ 0.007 s]
[INFO] dubbo-demo-api ..................................... SUCCESS [ 2.185 s]
[INFO] dubbo-demo-provider ................................ SUCCESS [ 4.675 s]
[INFO] dubbo-demo-consumer ................................ SUCCESS [ 13.619 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:21 min
[INFO] Finished at: 2016-01-20T00:09:51+08:00
[INFO] Final Memory: 43M/734M

mvn deploy -Dmaven.test.skip=true

邵志鹏 wechat
扫一扫上面的二维码关注我的公众号
0%