【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的用户和密码

相关推荐
一只学java的小汉堡14 分钟前
微服务与面向服务编程(SOA)入门指南:从架构演进到 Spring Cloud 实践(初学者友好版)
spring boot·spring cloud·java-ee·maven
程序员烧烤26 分钟前
【Java初学基础10】一文讲清反射
java·开发语言
长安——归故李28 分钟前
【PLC程序学习】
java·c语言·javascript·c++·python·学习·php
大卫小东(Sheldon)31 分钟前
如何用Java25编译Java17的项目
java
tingting011935 分钟前
mysql 8.4.2 备份脚本
android·数据库·mysql
铜峰叠翠1 小时前
Redis安装配置
数据库·redis·缓存
笨手笨脚の1 小时前
设计模式-建造者模式
java·设计模式·建造者模式·创建型设计模式
SimonKing1 小时前
SpringBoot多模板引擎整合难题?一篇搞定JSP、Freemarker与Thymeleaf!
java·后端·程序员
Lbwnb丶1 小时前
JUnit 4 + Spring Boot 测试依赖
数据库·spring boot·junit