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

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的仓库。内部项目的发布仓库

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


maven第三节-nexus私服功能介绍_第2张图片
 
B.在settings.xml配置仓库,此时本机中的所有maven项目都会去私有仓库中查询依赖



maven第三节-nexus私服功能介绍_第3张图片
 
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.创建项目工厂,创建权限角色(略)



 

你可能感兴趣的:(maven第三节-nexus私服功能介绍)