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



我需要编译jetison-1.3.8,而不是使用maven repo的版本。不是我的选择。。。

我试着这样做,得到:

[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 Forbidden错误。这看起来很奇怪。我对此进行了研究,发现一些东西表明,一些网站由于标题不完整而屏蔽了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显示的类似问题阻止了。

我将上面的"用户代理"字段添加到我的默认wget配置中,以防在幕后使用,但这并没有帮助。

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

您必须配置:mvn -Dhttps.protocols=TLSv1.2 clean package。原因是Central仅升级到TLSv1.2。

相关内容

最新更新