【问题标题】:getting Tycho to resolve dependencies from old-style Eclipse update site让 Tycho 解决旧式 Eclipse 更新站点的依赖关系
【发布时间】:2012-10-07 19:01:02
【问题描述】:

我正在尝试构建一个依赖于org.apache.uima.runtime 的插件,它是UIMA Eclipse update site 上托管的UIMA Eclipse plugins 的一部分。这个更新站点是一个老式(p2 之前)的更新站点,所以我知道Tycho won't resolve those dependencies。所以我正在尝试制作 UIMA Eclipse 更新站点的本地副本,将其升级到 p2,然后从那里获取依赖项。这是我尝试过的:

$ svn co http://svn.apache.org/repos/asf/uima/uimaj/trunk/uimaj-eclipse-update-site/
...
Checked out revision 1395335.

$ java -jar /.../eclipse/plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar \
  -application org.eclipse.equinox.p2.publisher.UpdateSitePublisher \
  -metadataRepository file:/.../uimaj-eclipse-update-site \
  -artifactRepository file:/.../uimaj-eclipse-update-site \
  -source /.../uimaj-eclipse-update-site
Generating metadata for ..
Generation completed with success [0 seconds].

如果我查看uimaj-eclipse-update-site 目录,我现在会看到artifacts.xmlcontent.xml,这似乎是正确的。我还用p2 repository browser 进行了检查,没有显示为“PARTIAL”,我可以看到org.apache.uima.runtime.feature.jar 2.4.0org.apache.uima.runtime.feature.group 2.4.0

我现在将此本地站点添加到我的 Eclipse 插件的 pom.xml 中:

<repository>
    <id>uima</id>
    <layout>p2</layout>
    <url>file:/.../uimaj-eclipse-update-site</url>
</repository>

当我在更新的项目中运行mvn compile 时,Tycho 找到了本地更新站点,但仍然找不到org.apache.uima.runtime

...
[INFO] Adding repository file:/.../uimaj-eclipse-update-site
[INFO] Adding repository file:/.../uimaj-eclipse-update-site
[INFO] Resolving dependencies of MavenProject: org.cleartk:org.cleartk.plugin.jcasgen.m2e:0.9.1.qualifier @ /.../jcasgen-m2e-connector/org.cleartk.plugin.jcasgen.m2e/pom.xml
[INFO] Cannot complete the request.  Generating details.
[INFO] Cannot complete the request.  Generating details.
[INFO] {osgi.ws=cocoa, osgi.os=macosx, osgi.arch=x86_64, org.eclipse.update.install.features=true}
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: org.cleartk.plugin.jcasgen.m2e 0.9.1.qualifier
[ERROR]   Missing requirement: org.cleartk.plugin.jcasgen.m2e 0.9.1.qualifier requires 'bundle org.apache.uima.runtime [2.4.0,3.0.0)' but it could not be found
[ERROR] 
[ERROR] Internal error: java.lang.RuntimeException: "No solution found because the problem is unsatisfiable."
...

我做错了什么?

如果你想复制错误,我正在从这个目录运行mvn compile(在如上修改pom.xml之后):

http://cleartk.googlecode.com/git/jcasgen-m2e-connector/

编辑:我确实在生成的artifacts.xml 中看到了org.apache.uima.runtime

<artifact classifier='org.eclipse.update.feature' id='org.apache.uima.runtime' version='2.4.0'>
  <properties size='4'>
    <property name='artifact.size' value='9466'/>
    <property name='download.size' value='9466'/>
    <property name='download.md5' value='f9d4f1f8dc54f0a99379dcede2fc2700'/>
    <property name='download.contentType' value='application/zip'/>
  </properties>
</artifact>

【问题讨论】:

  • 您的方法在原则上看起来不错,我看不到明显的错误。丢失的内容是否真的包含在您转换后的 p2 存储库中?
  • 我相信是的。我在 artifacts.xml 上方添加了一个 sn-p,在那里我看到了我正在寻找的 org.apache.uima.runtime
  • 那个 sn-p 看起来是 org.apache.uima.runtime 功能而不是 org.apache.uima.runtime 插件。浏览 svn repo 链接,看起来插件目录是空的,只有功能存在。但是,更新站点 URL 的插件目录中确实有插件。你能检查你的本地插件目录有一些插件吗?您可能需要镜像远程存储库,然后运行 ​​FeaturesAndBundlesPublisher 应用程序。
  • 查看您的 svn 存储库,您可能只需要先运行 maven 来“构建”它。
  • 只有content.xml 用于依赖解析; artifacts.xml 仅在依赖关系解析后才变得相关。

标签: maven eclipse-plugin tycho


【解决方案1】:

浏览 svn repo 链接,看起来插件目录是空的,只有功能存在。您可能只需要先运行 maven 来“构建”它并填充插件目录。

如果您拥有所有内容,则可以运行p2 features and bundles publisher 应用程序直接生成 p2 存储库。如果要在 Tycho 构建中使用,则不需要生成更新站点的类别。

【讨论】:

  • +1 UpdateSitePublisher 不会创建完整的 p2 元数据,但 FeaturesAndBundlesPublisher 会
  • 所以我只是尝试了 FeaturesAndBundlesPublisher 而不是 UpdateSitePublisher 并且错误是一样的。
  • 确认一下,在构建更新站点后,UpdateSitePublisher 没有生成所有必要的元数据,但 FeaturesAndBundlesPublisher 生成了。
【解决方案2】:

我迟到了,但 Apache UIMA 现在有一个 p2 存储库。

在您的 pom.xml 中添加 uima 存储库:

<repositories>
    <repository>
        <id>uima</id>
        <url>http://www.apache.org/dist/uima/eclipse-update-site</url>
        <layout>p2</layout>
    </repository>
</repositories>

【讨论】:

    猜你喜欢
    • 2013-04-20
    • 1970-01-01
    • 1970-01-01
    • 2019-12-14
    • 2014-12-13
    • 2020-12-27
    • 1970-01-01
    • 1970-01-01
    • 2016-11-18
    相关资源
    最近更新 更多