【问题原因】 ?? ?用户文件夹下的.m2文件夹内的setting.xml文件未生效,导致下包失败。 ?? ?核心原因未知,没查到,反正他就没生效,所以网络上的各种解决501的问题都失败,因为根本没有在这里走,修改pom或者setting都不管用。 【解决方案】 ?? ?修改NetBeans安装文件夹下的maven\conf\setting.xml的mirror标签与未生效setting一致(替换了也行) 【扩展】 ?? ?这个问题的核心,不是501,不是jdk版本,而是setting未生效,注意观察构建输出的最上方cd进的maven文件夹,是NetBeans的maven,所以他应该走的是maven默认的setting,而不是用户.m2下的。
【报错内容】
Scanning for projects... Downloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/nbm-maven-plugin/3.9/nbm-maven-plugin-3.9.pom
The build could not read 1 project -> [Help 1] ?? ? The project 【公司项目地址】) has 2 errors ? ? Unresolveable build extension: Plugin org.codehaus.mojo:nbm-maven-plugin:3.9 or one of its dependencies could not be resolved: Failed to collect dependencies for org.codehaus.mojo:nbm-maven-plugin:jar:3.9 (): Failed to read artifact descriptor for org.codehaus.mojo:nbm-maven-plugin:jar:3.9: Could not transfer artifact org.codehaus.mojo:nbm-maven-plugin:pom:3.9 from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/codehaus/mojo/nbm-maven-plugin/3.9/nbm-maven-plugin-3.9.pom. Return code is: 501, ReasonPhrase: HTTPS Required. -> [Help 2] ? ? Unknown packaging: nbm-application @ line 12, column 16
To see the full stack trace of the errors, re-run Maven with the -e switch. Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException ?
|