原因:虽然指定了配置文件,但maven会同时加载setting.xml配置,如果有名叫setting.xml的文件,将会优先使用,所以要把setting.xml的名字改掉。
在idea指定了配置文件
指定配置文件setting-site.xml,里面配置了阿里云仓库。
刷新maven报错
指定的配置文件应该到阿里云仓库下载才对(setting-site.xml里的),但实际下载访问到了setting.xml配置的私库服务器。
Non-resolvable parent POM for com.xxx:xxx:1.0: com.xxx:xxx-parent:pom:1.0.1-RELEASE was not found in http://私库/repository/maven-public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of nexus-gdin has elapsed or updates are forced and 'parent.relativePath' points at no local POM
原因:
虽然指定了配置文件,但maven会同时加载setting.xml配置,如果有名叫setting.xml的文件,将会优先使用,所以要把setting.xml的名字改掉。
修改前
检查maven的conf文件夹下是否有名为setting.xml的文件,有则增加后缀,比如setting-defaule.xml。
修改后