【问题标题】:Tycho fails to resolve packages from my own wrapper of plain Maven dependenciesTycho 无法从我自己的纯 Maven 依赖项包装器中解析包
【发布时间】:2012-07-26 15:04:34
【问题描述】:

我正在尝试创建一个依赖于普通 Maven 工件的 Eclipse 插件。我创建了以下项目结构:

Parent POM
 |- Dependencies (Third Party)
 \- My Code
     |- Bundle
     \- Bundle Tests

我遵循了 Tycho 示例 itp02,但仅使用了第三方依赖项。据我了解,这个想法是将所有依赖项包装在一个包中,并将其用作我的包的输入。我设法正确构建和安装依赖包:创建了一个 jar,它包含从 Maven 存储库获得的所有 JAR 文件。但是当我尝试编译我的包时,我收到一条错误消息,说我的包清单中的包无法导入。

[ERROR]   Missing requirement: MyPlugin 0.0.1.qualifier requires 'package org.apache.commons.lang.StringEscapeUtils 0.0.0' but it could not be found
[ERROR] 
[ERROR] Internal error: java.lang.RuntimeException: "No solution found because the problem is unsatisfiable.": ["Unable to satisfy dependency from MyPlugin 0.0.1.qualifier to package org.apache.commons.lang.StringEscapeUtils 0.0.0.", "No solution found because the problem is unsatisfiable."] -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: "No solution found because the problem is unsatisfiable.": ["Unable to satisfy dependency from MyPlugin 0.0.1.qualifier to package org.apache.commons.lang.StringEscapeUtils 0.0.0.", "No solution found because the problem is unsatisfiable."]

我错过了什么?

【问题讨论】:

    标签: maven eclipse-plugin tycho


    【解决方案1】:

    从您的描述中,您的项目是如何设置的或您用于构建它的命令不是很清楚。 但是,您的“POM 父母”似乎建议您尝试一次性构建它。如果是这种情况,您不能在同一构建中混合使用 pom-first (maven-bundle-plugin) 项目和 manifest-first (eclipe-plugin) 项目,请参阅 [1]。您需要先构建 pom-first 项目并将其安装到本地 maven 存储库中,然后才能构建 manifest-first 项目。

    要检查的第二件事是您配置了正确的依赖项,并且您已按照 [2] 设置 pomDependencies=consider。

    最后,如果这没有帮助,请检查本地 maven 存储库中的 jar 文件是否具有 META-INF/MANIFEST.MF 以及正确的“Export-Package”语句 - 特别是应该有一行 org.apache .commons.lang.StringEscapeUtils.

    [1]http://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts#It_is_not_possible_to_mix_pom-first_and_manifest-first_projects_in_the_same_reactor_build.

    [2]http://git.eclipse.org/c/tycho/org.eclipse.tycho-demo.git/tree/itp02/build02/pom.xml

    【讨论】:

    • @Sallum:我很想知道建议的哪一个步骤解决了这个问题。
    猜你喜欢
    • 2011-08-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-21
    • 2017-05-06
    • 2014-05-03
    • 1970-01-01
    • 2020-01-14
    • 2021-07-10
    相关资源
    最近更新 更多