Nexus安装配置完成后,需要在Maven中进行相应的配置才能正常使用,配置方式主要有两种:
方式1.在~/.m2/setting.xml文件(或者&M2_HOME/conf/settings.xml文件)中配置镜像,如:
<mirror>
<id>nexus</id>
<mirrorOf>central</mirrorOf>
<name>Public Repositories</name>
<url>http://127.0.0.1:9002/nexus/content/groups/public</url>
</mirror>
方式2:在项目的pom.xml文件中配置仓库地址,如:
<repositories>
<repository>
<id>public</id>
<name>Public Repositories</name>
<url>http://localhost:9002/nexus/content/repositories/central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>public</id>
<name>Public Repositories</name>
<url>http://localhost:9002/nexus/content/repositories/central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
很显然,使用方式2需要在所有项目的pom.xml文件中进行配置,造成了重复,如果同时使用方式1和方式2进行了配置,那么Maven会优先使用settings.xml文件中的镜像地址进行查找.
分享到:
相关推荐
nexus 搭建 maven仓库nexus 搭建 maven仓库nexus 搭建 maven仓库nexus 搭建 maven仓库nexus 搭建 maven仓库
关于使用Nexus搭建Maven私服的开发文档。新手了解一下。
Windows 下Nexus搭建Maven私服 Windows 下Nexus搭建Maven私服
Maven Nexus 私服搭建 从零开始,资源下载、安装指导、开发配置说明
Nexus搭建Maven私服 +maven安装步骤
maven nexus 配置,简要介绍如何配置nexus。。。。。。
Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库的维护和外部仓库的访问
maven官方索引文件包,由于eclipse-maven中rebuild index非常慢,自己下载索引文件,使用tomcat模拟索引服务器,更新索引
提供了基于Nexus搭建Maven私服所需要的一切资源和个人经验,搭建后可maven deploy 上传自己的jar包。别人如何在自己的maven项目中引用我将单独再上传一份。
nexus maven私服搭建nexus maven私服搭建nexus maven私服搭建nexus maven私服搭建nexus maven私服搭建nexus maven私服搭建
nexus构建maven仓库总结,添加了一些maven的基本命令
使用Nexus搭建Maven私有仓库详细讲解。使用Nexus搭建Maven私有仓库详细讲解。使用Nexus搭建Maven私有仓库详细讲解。使用Nexus搭建Maven私有仓库详细讲解。
详细介绍持续集成环境hudson+nexus+maven搭建
maven使用及Nexus搭建Maven私服
nexus+maven构建私服,自己备忘
使用nexus 可以搭建maven私服,如何使用nexus搭建maven 本地服务器呢?
Maven私有库和本地库的安装与配置教程(Sonatype Nexus + Maven)
详细的使用Nexus搭建Maven私服的步骤指导
nexus maven 私服搭建,附带搭建教程。