问题:Maven 编译 jettison pom,"Could not transfer ... from/to central ..."

Issues: Maven compiling jettison pom, "Could not transfer ... from/to central ..."

我需要编译 jettison-1.3.8 而不是使用 maven 仓库中的版本。不是我的选择...

我尝试这样做,得到:

[INFO] Scanning for projects...
Downloading from central:     https://repo.maven.apache.org/maven2/org/apache/felix/maven-bundle-plugin/1.0.0/maven-bundle-plugin-1.0.0.pom
[ERROR]
[ERROR] Some problems were encountered while processing the POMs:
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 54, column 15
[ERROR] Unresolveable build extension: Plugin org.apache.felix:maven-bundle-plugin:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.felix:maven-bundle-plugin:jar:1.0.0 @
[ERROR] Unknown packaging: bundle @ line 6, column 14 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project org.codehaus.jettison:jettison:1.3.8 (xxx/pom.xml) has 2 errors
[ERROR]     Unresolveable build extension: Plugin org.apache.felix:maven-bundle-plugin:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.felix:maven-bundle-plugin:jar:1.0.0: Could not transfer artifact org.apache.felix:maven-bundle-plugin:pom:1.0.0 from/to central (https://repo.maven.apache.org/maven2): Received fatal alert: protocol_version -> [Help 2]
[ERROR]     Unknown packaging: bundle @ line 6, column 14
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]

这完全超出了我的正常活动范围,所以我不确定哪里出了问题,但它不是代理问题。

我 运行 在 linux 机器上,所以没有 windows 问题,并且从命令行 - 这台机器上没有图形界面。

我全新安装了 jdk 1.7 和全新安装的 maven-3.5.4。我不需要在这台机器上使用代理。 (这是我几乎所有搜索中出现的答案)。

我确实找到了一个答案,它指出了一个显而易见的问题——我在连接到 http://repo1.maven.org/maven2/

时遇到了问题

我尝试使用 wget 对此进行验证,但收到 403 禁止错误。这似乎很奇怪。我对此进行了调查,发现某些网站由于不完整 headers 而阻止了 wget。所以我 运行 再次

wget -U 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4' http://repo1.maven.org/maven2/

并且能够访问存储库并下载索引页。所以,再一次,不是代理问题,我没有连接到中央仓库的问题,但我想知道我是否在检索必要的插件或依赖项时遇到问题,因为我被类似的问题阻止了wget 显示。

我将上面的 User-Agent 字段添加到我的默认 wget 配置中,以防它在幕后被使用,但这没有帮助。

在这一点上,我完全没有想法。看起来我应该能够连接到中央仓库,获取所需的插件并继续,但这并没有发生。

您必须配置:mvn -Dhttps.protocols=TLSv1.2 clean package。原因是中环有upgraded to TLSv1.2 only.