dubbo-2.8.4编译发布到本地Nexus库
首先修改本地Maven的settings.xml文件,注意<Servers>标签中的内容:
<settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <mirrors> <mirror> <id>CN</id> <name>OSChina Central</name> <url>http://maven.oschina.net/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors> <localRepository>D:\Java\m2\repository</localRepository> <servers> <server> <id>releases</id> <username>deployment</username> <password>deployment</password> </server> </servers> </settings>
dubbo-master顶层配置文件:
<distributionManagement> <repository> <id>releases</id> <name>dubbo-2.8.4 releases</name> <url>http://172.28.3.60:8081/nexus/content/repositories/releases/</url> </repository> </distributionManagement>
在Nexus中设置deployment账户的用户名和密码:
在repository中设置,repository可以:Allow Redeploy:
在dubbo-master的顶层目录执行:mvn deploy –Dmaven.test.skip=true:
执行完毕后,可以在本地的库中看到dubbo被成功的发布到了公司内部的mavne服务器:
使用者只需要在自己的pom文件中,添加如下配置即可:
<repositories> <!-- <repository> <id>thirdparty</id> <url>http://172.28.3.60:8081/nexus/content/repositories/thirdparty</url> </repository> --> <repository> <id>releases</id> <url>http://172.28.3.60:8081/nexus/content/repositories/releases</url> </repository> </repositories>