【Maven私服配置】

Maven私服配置

对于一些中央的pom,应该配置对应的mirror镜像访问

xml 复制代码
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>

在上述中mirrorOf表示只有central的maven才会走这个镜像去访问下载;

其他的会走profit

xml 复制代码
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>nexus</id>
<name>Nexus</name>
<url>http:私服地址/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>Nexus</name>
<url>http:私服地址m/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>

私服需要认证因此需要定义server

xml 复制代码
<servers>
<server>
<id>xx</id>
<username>xx</username>
<password>6xxx1</password>
</server>
</servers>

这里的server的ID没有意义,如果存在多个server会依次往下去找对应的server的用户和密码

相关推荐
小七rrrrr8 分钟前
动态规划法 - 53. 最大子数组和
java·算法·动态规划
手把手入门11 分钟前
★CentOS:MySQL数据备份
数据库·mysql·adb
自由的疯16 分钟前
在 Java IDEA 中使用 DeepSeek 详解
java·后端·架构
自由的疯22 分钟前
Java 通过接口方式使用 DeepSeek 详解
java·后端·trae
敲代码中30 分钟前
Maven入门到精通
java·maven
拂晓银砾1 小时前
Java数据结构-队列
java·数据结构
重生成为编程大王1 小时前
Java ConcurrentHashMap 深度解析
java·开发语言
SelectDB1 小时前
5000+ 中大型企业首选的 Doris,在稳定性的提升上究竟花了多大的功夫?
大数据·数据库·apache
路多辛1 小时前
Golang database/sql 包深度解析(二):连接池实现原理
数据库·sql·golang