您的位置:首页 > 其它

maven第三节-nexus私服功能介绍

2017-09-27 00:00 295 查看
1.nexus私服的安装
从官网下载nexus,加压到本地,修改D:\installfile\nexus\nexus-2.12.0-01\bin\jsw\conf\wrapper.conf
wrapper.java.command=D:\Program Files\Java\jdk1.7.0_79\bin\java
到目录:D:\installfile\nexus\nexus-2.12.0-01\bin下
nexus install
nexus start启动,nexus stop停止,nexus这就这么启动关闭的,安装完毕
2.nexus仓库的介绍
A.host的仓库。内部项目的发布仓库



B.proxy的仓库。从远程中央仓库中寻找数据的仓库
C.group仓库。组仓库用来方便开发人员进行设置的仓库
D.一种virtus仓库(现在不理解)
3.私服的使用
这个也是nexus使用最多的功能,目的是我们每次下载jar包先从私服下载,私服如果不存在在从maven中央仓库下载
A.设置镜像(设置setting.xml)



B.在settings.xml配置仓库,此时本机中的所有maven项目都会去私有仓库中查询依赖



4.项目发布
需要在pom文件里配置

<distributionManagement>
<snapshotRepository>
<id>snapshots</id>
<url>http://localhost:8081/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>


同时在setting.xml文件里配置

<server>
<id>snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>


id即为发布到的工厂仓库 Repository ID
5.创建项目工厂,创建权限角色(略)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: