Maven私有仓库的基本配置
来源:互联网 发布:json接口测试 编辑:程序博客网 时间:2024/05/21 22:28
Maven仓库,私有仓库的设置(在 settings.xml 中配置远程仓库)
1: 索引更新:将下载的nexus-maven-repository-index.zip包中替换 D:\Nexus\sonatype-work\nexus\indexer\central-ctx
如果工厂换了,那么索引页需要更换
2: 配置镜像,覆盖中央仓库的默认地址
<mirrors>
<mirror>
<id>central</id>
<mirrorOf>nexus</mirrorOf><!--如果想为所有的仓库做镜像那么可以改为:<mirrorOf>*</mirrorOf>-->
<name>Human Readable Name for this Mirror.</name>
<url>http://127.0.0.1:8081/nexus/content/groups/public/</url>
</mirror>
</mirros>
pom.xml文件中的配置为(在不修改默认配置的情况下):
<repository>
<id>nexus</id>
<name>nexus repository</name>
<url>http://127.0.0.1:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
这就表示我们项目中所有的依赖不会到pom.xml文件中的url中找了,而是会倒我们镜像中配置的url中找,
两者之间是通过id来进行一一对应关联的
3: 如果我们将我们项目pom里面的仓库设置删除、那么我们有一个默认的仓库设置,但是不支持快照版的发布,
如果我们修改这一默认的配置,就得使用profile。如下配置:
在我们本地仓库的settings.xml文件中:
<profiles>
<profile>
<id>central-repos</id>
<repositories>
<repository>
<id>central</id>
<name>Central</name>
<url>http://central</url><!--这个地址无效,因为我们为所有的仓库配置了镜像-->
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
<activeProfiles>
<activeProfile>central-repos</activeProfile>
</activeProfiles>
4: 通过以上配置之后我们就可以在nexus上来搜索我们的项目依赖了,而不用去其他的网上maven仓库中查找
- Maven私有仓库的基本配置
- maven私有仓库配置
- 【Maven】配置私有仓库
- centos 安装配置 nexus maven私有仓库
- 使用Nexus配置Maven私有仓库
- 配置Sonatype Nexus Maven私有仓库(1)
- Android项目使用私有maven仓库配置
- maven(6)--私有仓库
- 自建私有 Maven 仓库
- Maven 私有仓库搭建
- 搭建Maven私有仓库
- maven仓库的配置
- 修改maven仓库为自己的私有仓库
- docker 私有仓库配置
- Docker 私有仓库配置
- 搭建maven私有仓库(Archiva)
- Maven本地私有仓库搭建
- Nexus 搭建maven 私有仓库
- Swing界面刷新问题
- Jquery 常用方法经典总结
- 《深入浅出WPF》视频列表
- 孙多洋华科论道 答疑解惑中小企业融资难题
- eclipse.ini内存设置
- Maven私有仓库的基本配置
- vim 编程
- java字节码和.NET IL
- js Array数组的方法
- SQL 更新列名
- Maven项目搭建
- java swing 之 设置 JTable 单元格内容右对齐
- 使用cPickle来序列化Python对象
- Maven生命周期详解