仓库介绍
| 名称 | 地址 | 说明 |
|---|---|---|
| maven-release | http://192.168.3.122:8081/repository/maven-release/ | 发布Relase版本的库 |
| maven-snapshot | http://192.168.3.122:8081/repository/maven-snapshot/ | 发布snapshot版本的库 |
| maven-center | http://192.168.3.122:8081/repository/maven-center/ | 代理maven中央库 |
| maven-aliyun | http://192.168.3.122:8081/repository/maven-aliyun/ | 代理aliyun加速库 |
| maven-public | http://192.168.3.122:8081/repository/maven-public/ | 聚合以上四个库 |
maven-public库聚合了maven-release,maven-snapshot,maven-center,maven-aliyun四个库 查询节点的顺序为:maven-snapshot —> maven-release—> maven-aliyun—> maven-center
私服WebAdmin
地址:http://192.168.3.122:8081/
用户名:dev-maven
密码:123456
拥有的权限:
- 对以上maven库jar包的管理
-
本地maven使用私服
配置setting.xml
<mirror><id>maven-public</id><mirrorOf>*</mirrorOf><name>徽宁私服</name><url>http://192.168.3.122:8081/repository/maven-public/</url></mirror>
发布jar包到私服
1. 配置setting.xml
<server><id>hn-maven-release</id><username>dev-maven</username><password>123456</password></server><server><id>hn-maven-snapshot</id><username>dev-maven</username><password>123456</password></server>
2. 配置pom.xml
<distributionManagement><repository><id>hn-maven-release</id><name>releases</name><url>http://192.168.3.122:8081/repository/maven-release/</url></repository><snapshotRepository><id>hn-maven-snapshot</id><name>snapshots</name><url>http://192.168.3.122:8081/repository/maven-snapshot/</url></snapshotRepository></distributionManagement>
3. 打包时将源码上传到私服
在pom.xml中添加
下添加源码插件 <plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-source-plugin</artifactId><configuration><attach>true</attach></configuration><executions><execution><phase>compile</phase><goals><goal>jar</goal></goals></execution></executions></plugin>
