【问题标题】:How do I build an Eclipse feature from source that uses Maven with Tycho as its build system?如何从使用 Maven 和 Tycho 作为其构建系统的源代码构建 Eclipse 功能?
【发布时间】:2012-08-28 18:51:52
【问题描述】:

我在 git.eclipse.org 中看到我想从 HEAD 构建的一个功能(以获得错误修复的好处)。从源代码构建一些 Eclipse 特性过去有点棘手,但现在有了 Tycho,它应该更容易,因为它使用 Maven。幸运的是,我看到这个功能已经设置为使用 Tycho 和 Maven。

但如何将 Tycho 用作最终用户并不十分明显 - 我曾尝试以“全新安装”为目标运行 Maven 构建,但失败了。

请提供有关如何运行 Tycho 构建的完整分步说明,从要构建的项目的源代码检查开始,包括安装任何必要的软件,最后运行具有所需功能的 Eclipse。

另外,如果我想在 Eclipse 中更改插件的源代码,那是否意味着我应该使用不同的方式来构建它?


仅供参考,这是导致上述一般问题的具体问题:我尝试构建功能 org.eclipse.linuxtools/systemtap/org.eclipse.linuxtools.systemtap-feature,并且我在同级目录中签出了 systemtap 插件(因为它们是同一个 git 的一部分存储库,所以我免费获得它们)。

错误是:

[ERROR] Failed to execute goal org.eclipse.tycho.extras:tycho-source-feature-
plugin:0.14.0:source-feature (source-feature) on project org.eclipse.linuxtools.systemtap: Could not generate source feature for project MavenProject: org.eclipse.linuxtools.systemtap:org.eclipse.linuxtools.systemtap:1.2.0-SNAPSHOT @ /home/greenrd/git/org.eclipse.linuxtools/systemtap/org.eclipse.linuxtools.systemtap-feature/pom.xml
[ERROR] Missing sources for plugins [org.eclipse.linuxtools.systemtap.ui.consolelog_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.editor_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.graphingapi.ui_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.logging_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.structures_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.graphing_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.systemtapgui_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.ide_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.dashboard_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.dashboardextension_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.graphicalrun_0.3.0.201203201951]
[ERROR] -> [Help 1]
[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] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

【问题讨论】:

  • Maven 构建不包括源代码签出。您需要先手动执行此操作。

标签: eclipse tycho


【解决方案1】:

使用 Tycho 的项目应该像任何其他 Maven 项目一样构建,即您应该能够构建项目并通过在项目的根目录中调用 mvn clean verify 来运行其测试。 (如果根目录中没有pom.xml,请查找名为“parent”的项目或向项目询问其构建入口点。)

就像在 Maven 中一样,您通常无法签出项目并直接构建它的一部分,例如通过调用mvn eclipse-feature 子项目。为此,您首先需要使用 mvn clean install 构建整个项目一次,然后您还可以重新构建项目的某些部分。

如果您进行源代码修改,我建议您再次进行完整构建。可以只构建更改的子项目,但您还需要手动确保重新构建所有聚合项目类型(即“eclipse-feature”和“eclipse-repository”),这可能不值得努力. (不幸的是,Maven 选项--also-make-dependentscurrently not supported by Tycho。)

为了从本地构建结果安装,您需要找到将项目的二进制文件组装为 p2 存储库的子项目:查找 target/repository(或可能是 @987654328 @) 目录并检查 features/plugins 子文件夹。存储库或站点文件夹可用作 Eclipse 中更新机制的“本地”源。


免责声明:上述步骤不适用于所有使用 Tycho 的项目。如果出现问题,您应该查看项目的文档以获取运行构建的特殊说明,或询问项目的开发人员。

【讨论】:

    【解决方案2】:

    mvn package 通常会使用 Tycho 构建打包插件和功能。也许您的失败与使用mvn install 有关,这还涉及在verify 阶段运行集成测试。

    如果mvn package 不起作用,请添加您正在构建的项目以及您遇到的错误。

    【讨论】:

    • 这个错误似乎不太相关。在哪个目录下执行 mvn clean install?
    • 在 org.eclipse.linuxtools/systemtap/org.eclipse.linuxtools.systemtap-feature.
    • 试试 org.eclipse.linuxtools/systemtap 或 org.eclipse.linuxtools 。该功能预计将与它将包含的插件一起构建在反应器中。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-14
    • 1970-01-01
    相关资源
    最近更新 更多