1 在服务器上安装artifactory,并启动,启动后服务地址为http://hostip:port/artifactory/
hostip:服务器ip
port:服务端口
2 在本地maven的settings.xml 文件中加入profile配置
<profile>
<id>dev</id>
<repositories>
<repository>
<id>central</id>
<url>http://192.168.99.51:8081/artifactory/repo</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<layout>default</layout>
</repository>
<repository>
<id>snapshots</id>
<url>http://192.168.99.51:8081/artifactory/repo</url>
<releases>
<enabled>false</enabled>
</releases>
<layout>default</layout>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://192.168.99.51:8081/artifactory/repo</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<layout>default</layout>
</pluginRepository>
<pluginRepository>
<id>snapshots</id>
<url>http://192.168.99.51:8081/artifactory/repo</url>
<releases>
<enabled>false</enabled>
</releases>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
</profile>
3 在本地使用maven指令时加上 -P dev 即可使用自己搭建的maven仓库。
eg. mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=myapp -P dev
4 artifactory数据仓库说明
artifactory默认配置了三种仓库,本地(Local),远程(Remote)以及虚拟(Virtual)仓库.
本地仓库中的资源url形式为
http://<host>:<port>/artifactory/<local-repository-name>/<artifact-path>
远程仓库中的资源url形式为
http://<host>:<port>/artifactory/<remote-repository-name>/<artifact-path>或
http://<host>:<port>/artifactory/<remote-repository-name>-cache/<artifact-path>
第二种形式只使用已经缓存了的内容;第一种形式在请求的内容不存在时,会从配置的remote服务器上获取。我们可以删除这个仓库中缓存的内容,但不能向其中发布任何内容。
虚拟仓库
Artifactory使用一个全局虚拟仓库,可以通过下面的url地址访问
http://<host>:<port>/artifactory/repo
这个仓库包含了所有本地和远程的仓库,因此在配置仓库地址时,只需配置此地址即可。虚拟仓库的请求顺序为:local->remote-cache->remote
分享到:
相关推荐
java maven仓库 搭建Nexus
超全面搭建Maven仓库:Maven环境变量配置,Maven仓库创建(本地资源库,中央资源库),Eclipse内配置Maven环境
nexus 搭建 maven仓库nexus 搭建 maven仓库nexus 搭建 maven仓库nexus 搭建 maven仓库nexus 搭建 maven仓库
maven是有仓库的安装包,加速自己的开发环境搭建,企业里都用的maven仓库安装软件,希望对大家有帮助,!!
使用nexus可以方便的搭建本地仓库,避免连接远程仓库带来的速度慢的烦恼
构建java的nexus私人仓库和maven的搭建,方便本地团队的仓库管理。
一个专门的 Maven 仓库管理软件,用于搭建 Maven 私服。本版本是2021年3月Unix最新版 3.30.0
Maven本地仓库搭建工具nexus-2.11.4-01-bundle.zip
2021-10-28官网下载archetype-catalog.xml。(maven项目快速搭建,缺少这个文件时,提示maven-archetype-webapp could not resolve archetpye)
Maven私服搭建必备,完整的Maven私服和本地仓库搭建步骤
Maven 仓库和搭建Nexus私服 #资源达人分享计划 # 技术文档
Windows 下Nexus搭建Maven私服 Windows 下Nexus搭建Maven私服
maven下载环境变量配置安装,maven添加本地仓库,eclispe配置maven,创建maven项目
linux下搭建内网maven私服
Windows Server 2016环境下使用Nexus搭建Maven私有仓库详细过程及常用配置。
构建java的nexus私人仓库和maven的搭建分享.pdf
构建java的nexus私人仓库和maven的搭建可用.pdf
Maven仓库的搭建,包教会,详细文档,注意事项都有提示
【Android Gradle 插件】将自定义 Gradle 插件上传到自建 Maven 仓库 ⑤ ( 使用 Sonatype Nexus 搭建 Maven 仓库 ) https://hanshuliang.blog.csdn.net/article/details/127385094 博客资源
主要介绍了在Centos上搭建Maven中央仓库的方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧