Couldn't transfer artifact org.springframework.boot:spring-boot-maven-plugin:pom:1.5.14.RELEASE from/to centralMirror (http://192.168.1.200/nexus/centent)connect to 192.168.1.200:80[/192.168.1.200] failed;connection timed out
maven加载jar包时,仓库地址不是自己设置的地址
通过ping 192.168.1.200 发现这个服务是broken的,而且这个maven仓库地址也不是我想要的ip地址;但是查询maven下面的conf/settings.xml里面没有这个配置;
原因在于:我在用户配置下面也配置了settings.xml文件导致,maven目录下的conf/settings.xml配置失效
settings.xml文件位置
settings.xml文件一般存在于两个位置:
全局配置: ${M2_HOME}/conf/settings.xml
用户配置: user.home/.m2/settings.xml:用户配置优先于全局配置。{user.home} 和和所有其他系统属性只能在3.0+版本上使用。请注意windows和Linux使用变量的区别。
配置优先级
需要注意的是:局部配置优先于全局配置。
配置优先级从高到低:pom.xml> user settings > global settings
如果这些文件同时存在,在应用配置时,会合并它们的内容,如果有重复的配置,优先级高的配置会覆盖优先级低的。