使用Maven管理项目须要管理本身的依赖,如支付宝,微信等支付或者短信接口等组件,未在maven repository发布,这时,咱们须要构建本身的私服,将这些组件发布并经过dependency节点进行依赖管理。首先咱们须要在nexus新建hosted repository,而后经过微信
0. nexus的upload功能进行上传
maven
经过maven提供deployurl
在pom.xml中添加:
code
<distributionManagement> <repository> <id>xxoo</id> <url>http://IP:port/nexus/content/repositories/xxoo</url> </repository> </distributionManagement>
在maven的settings中添加:server
<servers> <server> <id>xxoo</id> <username>deployment</username> <password>your_pwd</password> </server> </servers>
memo:要在repository configuration中配置allow deployxml