首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用目标平台处理使用Tycho构建的Eclipse插件的依赖关系

使用目标平台处理使用Tycho构建的Eclipse插件的依赖关系
EN

Stack Overflow用户
提问于 2015-12-15 23:07:47
回答 1查看 700关注 0票数 1

我正在用Tycho开发一个Eclipse插件,我想按照这个tutorial中描述的步骤使用一个目标平台来处理我的依赖关系。但是当我尝试编译我的插件项目(使用全新安装)时,我得到了以下错误:

代码语言:javascript
运行
复制
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: com.codeandme.tycho.plugin 1.0.0.qualifier
[ERROR]   Missing requirement: com.codeandme.tycho.plugin 1.0.0.qualifier requires 'bundle org.eclipse.ui 0.0.0' but it could not be found

这是我的插件项目的pom.xml:

代码语言:javascript
运行
复制
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <artifactId>com.codeandme.tycho.plugin</artifactId>
    <packaging>eclipse-plugin</packaging>

    <parent>
        <groupId>tycho_example</groupId>
        <artifactId>com.codeandme.tycho.releng</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <relativePath>../com.codeandme.tycho.releng</relativePath>
    </parent>
</project>

下面是父项目(Releng)的pom.xml:

代码语言:javascript
运行
复制
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>tycho_example</groupId>
    <artifactId>com.codeandme.tycho.releng</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <properties>
        <tycho.version>0.22.0</tycho.version>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>



    <build>
        <plugins>
            <plugin>
                <!-- enable tycho build extension -->
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-maven-plugin</artifactId>
                <version>${tycho.version}</version>
                <extensions>true</extensions>
            </plugin>

            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>target-platform-configuration</artifactId>
                <version>${tycho.version}</version>
                <configuration>
                    <resolver>p2</resolver>
                    <pomDependencies>consider</pomDependencies>
                    <target>
                        <artifact>
                            <groupId>tycho_example</groupId>
                            <artifactId>com.codeandme.tycho.releng.targetplatform</artifactId>
                        </artifact>
                    </target>
                    <environments>
                        <environment>
                            <os>win32</os>
                            <ws>win32</ws>
                            <arch>x86</arch>
                        </environment>
                    </environments>
                </configuration>
            </plugin>

        </plugins>
    </build>
    <modules>
        <module>../com.codeandme.tycho.plugin</module>

        <module>../com.codeandme.tycho.releng.targetplatform</module>
    </modules>
</project>  

下面是我的目标平台的pom.xml:

代码语言:javascript
运行
复制
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <artifactId>com.codeandme.tycho.releng.targetplatform</artifactId>
  <packaging>eclipse-target-definition</packaging>
  <parent>
    <groupId>tycho_example</groupId>
    <artifactId>com.codeandme.tycho.releng</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <relativePath>../com.codeandme.tycho.releng</relativePath>
  </parent>
  <groupId>tycho_example</groupId>
</project>

最后是目标平台的.tpd:

代码语言:javascript
运行
复制
target "Tycho Tutorial"

with source requirements

location "http://download.eclipse.org/tools/orbit/downloads/drops/R20150519210750/repository/" mars-orbit {
    org.apache.commons.lang3
}

location "http://download.eclipse.org/releases/mars" mars-release {
    org.eclipse.platform.feature.group
    org.eclipse.equinox.executable.feature.group
    org.eclipse.e4.rcp.feature.group
    org.eclipse.ui.trace
    org.eclipse.pde.feature.group
}

任何形式的帮助都将不胜感激。

EN

回答 1

Stack Overflow用户

发布于 2015-12-16 14:10:36

在您的目标定义中,您包含了org.eclipse.e4.rcp.feature.group,而原始教程要求您包含org.eclipse.rcp.feature.group。这就是UI包缺失的原因。

您可以很容易地查看目标平台的实际内容:右键单击.tpd文件,选择"generate target definition",打开新生成的.target文件,等待Eclipse解析它(查看进度视图),解析完成后,目标编辑器的"contents“页面将显示该目标平台中可用的插件。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34292621

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档