1)安装nexus
1、下载并且解压缩
2、将bin添加到环境变量
3、nexus install将nexus安装到windows的服务中
4、修改
5、nexus start启动服务
2)仓库类型
1、host的仓库。内部项目的发布仓库
2、proxy的仓库。从远程中央仓库中寻找数据的仓库
3、group仓库。组仓库用来方便开发人员进行设置的仓库
3)配置镜像(设置setting.xml)
<mirror>
<id>central</id>
<mirrorOf>*</mirrorOf><!--设置所有的工厂都加镜像-->
<name>Human Readable Name for this Mirror.</name>
<url>http://localhost:8081/nexus/content/groups/public/</url>
</mirror>
激活profile
<activeProfiles>
<activeProfile>central</activeProfile>
</activeProfiles>
4)项目发布
设定release工厂和snapshots工厂
<distributionManagement>
<snapshotRepository>
<id>user-snapshots</id>
<name>User Project SNAPSHOTS</name>
<url>http://localhost:8081/nexus/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>user-releases</id>
<name>User Project SNAPSHOTS</name>
<url>http://localhost:8081/nexus/content/repositories/releases</url>
</repository>
</distributionManagement>
设定发布工厂的权限(setting.xml)
<server>
<id>user-snapshots</id>
<privateKey>deployment</privateKey>
<passphrase>deployment</passphrase>
</server>
<server>
<id>user-releases</id>
<privateKey>deployment</privateKey>
<passphrase>deployment</passphrase>
</server>
5)创建工厂
1、创建两个工厂:release和policy的
2、配置权限
3、创建角色并且分配权限
4、创建用户
5、创建发布的工厂