nexus maven工厂配置
来源:互联网 发布:阿里云个人免费邮箱 编辑:程序博客网 时间:2024/06/06 02:24
nexus上默认有4种的工厂 分别是:group、hosted(面向的是内部的提交)、 proxy、 virtual
当我们执行mvn : deploy 发布的时候,默认都是提交给hosted类型的工厂
hosted 类型的又有3个版本,分别是:Releases Snapshots 3rd party
proxy类型的工厂主要用到了Central这个工厂,主要把中央工厂里面的第三方包下载到这里来。所以这里要配置一个中央工厂地址。
另外两个proxy用来下载Snapshots的包
group 类型是一个整合,因为他可以多个仓库配置在一起,当内部调用的时候,只需要指向这一个group仓库即可:
在项目中引用(这是其中一种配置引用工厂的一种方式)
<repositories><repository><id>nexus</id><name>Nexus Repository</name><url>http://localhost:8081/nexus/content/groups/public/</url><releases><enabled>true</enabled></releases><!-- snapshots默认是关闭的,需要手动开启--><snapshots><enabled>true</enabled></snapshots></repository></repositories>
当然另外一种就是在maven的setting文件中配置(常用),这样所有的项目的配置都用到了这个仓库:
<pre name="code" class="java"><profile> <id>nexusProfile</id> <repositories><repository><id>nexus</id><name>Nexus Repository</name><url>http://localhost:8081/nexus/content/groups/public/</url><releases><enabled>true</enabled></releases><!--snapshots默认是关闭的,需要手动开启--><snapshots><enabled>true</enabled></snapshots></repository></repositories> </profile> <!--激活--> <activeProfiles> <activeProfile>nexusProfile</activeProfile> </activeProfiles>
工厂镜像:
默认情况下,当我们的私服stop了,我们找jar包的时候,maven会意识到私服挂了,自动切换到中央仓库去找。
但是有时候我们并不希望这样,当私服挂了,我们就不去中央仓库找了,中央仓库只有私服能访问,这样的话我们就得配置镜像。
<!---工厂的镜像,只要mirrorOf中的工厂要被访问,都会自动来找镜像的url,如果镜像的url访问不到,那就访问不到了-->
<mirror> <id>mirrorId</id> <!--<mirrorOf>nexusProfile,central</mirrorOf>--> <mirrorOf>*</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://localhost:8081/nexus/content/groups/public/</url> </mirror>
0 0
- nexus maven工厂配置
- Maven Nexus配置
- Maven Nexus 安装配置
- 配置maven使用nexus
- nexus 配置maven仓库
- 06、maven Nexus配置
- Maven Nexus配置
- Maven配置使用Nexus
- Maven配置nexus
- Maven配置Nexus
- maven 配置nexus私服
- 配置maven私服nexus
- maven nexus配置
- maven私服nexus配置
- maven笔记-Nexus配置
- nexus配置maven私服
- 配置maven私服nexus
- maven配置使用nexus仓库
- 1011. A+B和C
- chromephp:chrome浏览器php控制台调试工具使用指南
- find命令笔记
- 弹出窗体内容改变时刷新父窗体内容
- 统计学与机器学习相关概念
- nexus maven工厂配置
- 打印条码
- hdoj--5621--KK's Point(简单数学)
- 根据父窗体字段状态屏蔽操作按钮
- 2.1、决策树之信息增益与熵
- 点击按钮跳转到另一个页面
- 保存脚本判断字段非空(增行编辑)
- 1002. A+B for Polynomials (25)
- 平台实时弹框消息提醒SQL