当遇到无效字符的谷歌番石榴网址时,Maven脱机构建失败 [英] Maven offline build fails when it encouners google guava url with invalid character

查看:284
本文介绍了当遇到无效字符的谷歌番石榴网址时,Maven脱机构建失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使我的Tycho-Maven构建在离线模式下工作,所以我可以将其部署到没有Internet连接的环境中,并让人们从以前下载的工件运行构​​建,以获取我的应用程序所依赖的第三方代码。正在构建的产品是Eclipse RCP产品,使用 org.eclipse.tycho:target-platform-configuration 插件从RCP目标文件加载依赖项。 / p>

首先我运行 mvn -Dmaven.repo.local = / some / path / -DgeneratePom = true clean install 创建工件,构建成功。然后当我运行 mvn -Dmaven.repo.local = / some / path / -o clean install 它失败,因为它在离线模式下运行,并且没有可用的本地缓存 http://download.eclipse.org/tools/cdt/releases/8.6



所以我运行 mvn -Dmaven.repo.local = / some / path / dependency:go-offline 使其下载构建所需的所有工件,但会失败,并显示此消息:


[错误]无法执行目标
org.apache.maven.plugins:maven-dependency-plugin:2.8:resolve -plugins
(resolve-plugins)项目:Nested:无法传输
artifact com.google.guava:guava:jar:[10.0.1,14.0.1] from / to central
https://repo.maven.apache.org/maven2 ):路径中的非法字符at
index 60:
https://repo.maven.apache.org/maven2/com/google/guava/guava/ [10.0.1,14.0.1] / guava- [10.0.1,14.0.1]的.jar


索引60是番石榴罐的版本范围说明符中的[字符。我不知道该网址的创建位置,以及为什么不进行网址编码。获得依赖性是很好的:离线目标来完成执行,但我不认为这是我的问题的根源。



我说的原因是当我运行这个目标,我看到这在输出


[INFO]添加库
http://download.eclipse.org/tools/cdt/releases/8.6 [INFO]获取
p2.index from http://download.eclipse.org/tools/ cdt / releases / 8.6 / r /
(0B at 0B / s)


我不知道为什么它下载0字节,但我认为这是为什么当我尝试离线编译时,我找不到CDT软件包的缓存。



如果有人有一个想法如何解决这个失败,或任何其他方法使离线构建工作,这将是非常有用的。

解决方案

p>在创建一个剥离项目来演示问题的过程中,我发现了原因。在pom中存在 org.eclipse.xtend:xtend-maven-plugin 导致了问题。根据我在构建输出中看到的消息,插件不被使用,可能配置错误。


I need to make my Tycho-Maven build work in offline mode, so I can deploy it to environments with no Internet connection and let people run the build from the previously downloaded artifacts for the third party code my app depends on. The product being built is an Eclipse RCP product, using the org.eclipse.tycho:target-platform-configuration plug-in to load the dependencies from an RCP target file.

First I run mvn -Dmaven.repo.local=/some/path/ -DgeneratePom=true clean install to create the artifacts, and that build succeeds. Then when I run mvn -Dmaven.repo.local=/some/path/ -o clean install it fails because it's running in offline mode and there is no local cache available for http://download.eclipse.org/tools/cdt/releases/8.6

So then I run mvn -Dmaven.repo.local=/some/path/ dependency:go-offline to make it download all the artifacts it needs for the build, but it fails with this message:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:resolve-plugins (resolve-plugins) on project : Nested: Could not transfer artifact com.google.guava:guava:jar:[10.0.1,14.0.1] from/to central (https://repo.maven.apache.org/maven2): Illegal character in path at index 60: https://repo.maven.apache.org/maven2/com/google/guava/guava/[10.0.1,14.0.1]/guava-[10.0.1,14.0.1].jar

Index 60 is the "[" character in the version range specifier for the guava jar. I have no idea where that URL gets created and why it's not URL-encoded. It would be nice to get the dependency:go-offline goal to complete execution, but I don't think it's the source of my problem.

The reason I say that is when I run that goal, I see this in the output

[INFO] Adding repository http://download.eclipse.org/tools/cdt/releases/8.6 [INFO] Fetching p2.index from http://download.eclipse.org/tools/cdt/releases/8.6/r/ (0B at 0B/s)

I don't know why it downloads 0 Bytes, but I assume this is why I can't find a cache of the CDT bundles when I try to do an offline build.

If anyone has an idea how to work around this failure, or any other approach to make an offline build work, that would be very helpful.

解决方案

In the course of creating a stripped down project to demonstrate the problem, I discovered the cause. The presence of org.eclipse.xtend:xtend-maven-plugin in the pom was causing the problem. The plug-in is not used, and was perhaps misconfigured, per a message I saw in the build output.

这篇关于当遇到无效字符的谷歌番石榴网址时,Maven脱机构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆