java - Maven 内部错误:org.eclipse.tycho.core.osgitools.OsgiManifestParserException:异常解析 OSGi MANIFEST
问题描述
我正在为少数 dsl (xtext) 类型的项目配置 maven。我配置了 dsl1 (xtext) 插件所需的所有内容,它成功运行(生成 java 源代码、构建、运行测试、导出、生成 P2)。
然后,我为我的下一个 dsl2 插件移动了相同的 pom.xml 配置,它们几乎相同并且出现了问题:
[ERROR] Failed to execute goal org.eclipse.xtext:xtext-maven-plugin:2.16.0.M1:generate (default) on project com.dsl.dsl2: Execution default of goal org.eclipse.xtext:xtext-maven-plugin:2.16.0.M1:generate failed: Plugin org.eclipse.xtext:xtext-maven-plugin:2.16.0.M1 or one of its dependencies could not be resolved: Could not find artifact com.dsl.dsl2:com.dsl.dsl2:jar:0.1.0-SNAPSHOT
运行的插件是com.dsl.dsl2
,它告诉它找不到自己。事实上,由于某种原因,maven 未能将其复制到相应的.m2/repository
位置。我尝试了不同的解决方案来解决它,其中之一是删除整个~/.m2/repository
并重新生成它。但是现在,我没有解决我的问题,而是面临着其他不同的问题。
对于我之前运行的所有存储库mvn clean verify
,现在都抱怨相同的错误:
[INFO] Resolving class path of MavenProject: com.dsl.dsl2:com.dsl.dsl2:1.1.1-SNAPSHOT @ /<my_path>/<my_repo>/com.dsl.dsl2/pom.xml
[ERROR] Internal error: org.eclipse.tycho.core.osgitools.OsgiManifestParserException: Exception parsing OSGi MANIFEST ~/.m2/repository/p2/osgi/bundle/org.eclipse.xtext.xtext.generator/2.15.0.v20180916-0722/org.eclipse.xtext.xtext.generator-2.15.0.v20180916-0722.jar: zip file is empty -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: org.eclipse.tycho.core.osgitools.OsgiManifestParserException: Exception parsing OSGi MANIFEST ~/.m2/repository/p2/osgi/bundle/org.eclipse.xtext.xtext.generator/2.15.0.v20180916-0722/org.eclipse.xtext.xtext.generator-2.15.0.v20180916-0722.jar: zip file is empty
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)
...
Caused by: org.eclipse.tycho.core.osgitools.OsgiManifestParserException: Exception parsing OSGi MANIFEST ~/.m2/repository/p2/osgi/bundle/org.eclipse.xtext.xtext.generator/2.15.0.v20180916-0722/org.eclipse.xtext.xtext.generator-2.15.0.v20180916-0722.jar: zip file is empty
at org.eclipse.tycho.core.osgitools.DefaultBundleReader.doLoadManifest (DefaultBundleReader.java:68)
...
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.util.zip.ZipException: zip file is empty
at java.util.zip.ZipFile.open (Native Method)
...
我最感兴趣的是首先解决最后一个问题。jar 文件似乎是正确的:
% ls -lsa ~/.m2/repository/p2/osgi/bundle/org.eclipse.swt.gtk.linux.x86/3.105.3.v20170228-0512/
2568 <user> 2616403 org.eclipse.swt.gtk.linux.x86-3.105.3.v20170228-0512.jar
4 <user> 219 org.eclipse.swt.gtk.linux.x86-3.105.3.v20170228-0512-p2artifacts.xml
而且我不知道为什么它使用我在 pom.xml 属性中指定的 xtext 2.15.0
<xtend.version>2.16.0.M1</xtend.version>
<xtext.version>2.16.0.M1</xtext.version>
我的行家:
% mvn -version
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T21:33:14+03:00)
Maven home: ~/maven/apache-maven-3.5.4
Java version: 1.8.0_45, vendor: Oracle Corporation, runtime:
Default locale: en_US, platform encoding: ISO-8859-1
OS name: "linux", version: "2.6.32-642.11.1.el6.x86_64", arch: "amd64", family: "unix"
我正在使用代理。
更新
那就是它抱怨的解压缩jar的内容。
% ls /org.eclipse.swt.gtk.linux.x86-3.105.3.v20170228-0512
about_files fragment.properties libswt-cairo-gtk-4629.so libswt-gtk-4629.so libswt-pi-gtk-4629.so libswt-xulrunner-fix10.so META-INF swt.xpt
about.html libswt-atk-gtk-4629.so libswt-glx-gtk-4629.so libswt-mozilla-gtk-4629.so libswt-webkit-gtk-4629.so libswt-xulrunner-fix31.so org version.txt
chrome.manifest libswt-awt-gtk-4629.so libswt-gnome-gtk-4629.so libswt-pi3-gtk-4629.so libswt-xpcominit-gtk-4629.so libswt-xulrunner-gtk-4629.so swt.js
我正在使用简单的目标平台配置:
<repository>
<id>xtext</id>
<url>http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/</url>
<layout>p2</layout>
</repository>
<repository>
<id>eclipse</id>
<url>http://download.eclipse.org/releases/neon/201705151400/</url>
<layout>p2</layout>
</repository>
更新
我已经解决了我的问题,但我不能说这是我遇到的问题的解决方案。
- 我相信,由于代理限制,我遇到的最后一个错误是关于超时的。第二天就自行解决了。
- 我通过基于 https://www.eclipse.org/Xtext/documentation/350_continuous_integration.html重新创建我的 pom 配置解决了第一个概述的错误
基本上,我不再使用任何<artifactId>xtext-maven-plugin</artifactId>
失败的东西,如果需要,建议在非 Eclipse 插件中使用它。我不需要它。
解决方案
推荐阅读
- excel - 宏运行背景时如何在不挂起的情况下处理新的 Excel 工作表
- yii2 - 在应用程序引导属性下列出组件
- ng-file-upload - 用 ngFileUpload 替换而不是删除和添加文件
- css - 复选框不显示
- java - Spring Data @Query 创建 MySQL 事件
- python - 使用pandas / python在数据框中出现的列值小于某个数量时删除行?
- c# - 如何使用 PInvoke 将 std::wstring 从 C++ 返回到 C# 而无需编写字符串缓冲区转换
- python - 从浏览器运行 newman 测试
- python-3.x - 文本文件的前两列作为字典
- join - 在 asp.net 中使用 Linq 连接数据