简体   繁体   English

使用反应堆工件在Tycho中运行Eclipse

[英]Running Eclipse inside Tycho using reactor artifacts

Is there a way to make the tycho-eclipserun-plugin:eclipse-run goal resolve dependencies against artifacts in the current reactor or in the local repository . 有没有一种方法可以使tycho-eclipserun-plugin:eclipse-run目标解决对当前反应堆 或本地存储库中的 工件的依赖关系。 I'm trying to run the Eclipse/CDT headless build application as a step in our Tycho build, but I cannot figure out how to populate the Eclipse instance with the newly-built toolchain plugins. 我正在尝试运行Eclipse / CDT无头构建应用程序,这是我们的Tycho构建中的一个步骤,但是我不知道如何用新建的工具链插件来填充Eclipse实例。

<plugin>
    <groupId>org.eclipse.tycho.extras</groupId>              
    <artifactId>tycho-eclipserun-plugin</artifactId>
    <executions>
    <execution>
        <configuration>
        <appArgLine>-application org.eclipse.cdt.managedbuilder.core.headlessbuild -import file:///...  -cleanBuild all</appArgLine>
                <repositories>
                    <repository>
                        <url>http://download.eclipse.org/releases/kepler/</url>
                        <layout>p2</layout>
                    </repository>
                </repositories>
                <dependencies>
                    ...
                    <dependency> 
                        <artifactId>my.toolchain.feature</artifactId>
                        <type>eclipse-feature</type>
                    </dependency>
        </dependencies>
            </configuration>
            <goals>
                <goal>eclipse-run</goal>
            </goals>
            <phase>test</phase>
        </execution>
    </executions>
 </plugin>

This will fail since my toolchain plugins are not present in the Eclipse instance which hosts the headless build application. 这将失败,因为在托管无头构建应用程序的Eclipse实例中不存在我的工具链插件。 I could, of course, point out an external update site which hosts the plugins, but I would like to be able to use the plugins which are already being built in the same reactor. 我当然可以指出一个托管插件的外部更新站点,但是我希望能够使用已经在同一反应堆中构建的插件。 Is that possible? 那可能吗?

EDIT: Original question included "or local repository artifacts", but that was not what I actually meant. 编辑:最初的问题包括“或本地存储库工件”,但这不是我真正的意思。

No, this is not possible. 不,这是不可能的。

Earlier versions of Tycho allowed using artifacts from the reactor for the eclipserun-plugin, but this caused problems for projects which build upstream artifacts from the artifacts they used for the eclipserun-plugin , namely the Eclipse Platform. Tycho的早期版本允许将反应堆中的工件用于eclipserun-plugin,但这给从其用于eclipserun-plugin 的工件 (即Eclipse Platform) 构建上游工件的项目造成了问题 So to fix this, the artifacts used by the eclipserun-plugin were decoupled from the reactor & reactor dependencies in Tycho 0.17.0 . 因此,为解决此问题,将eclipserun-plugin使用的工件与Tycho 0.17.0中的电抗器和电抗器依赖项分离。

One could imagine ways to re-allow this use case, but this is currently just not implemented. 可以想象重新允许这种用例的方法,但是目前还没有实现。 AFAIK there are no concrete ideas yet how to do this. AFAIK目前尚无具体想法。 If you want to contribute one, you could file an enhancement in Tycho's issue tracker . 如果您想贡献一份,可以在Tycho的问题跟踪器中进行增强

The easiest way I could find is to use the maven-dependency-plugin to copy the repository from the repository-module: 我能找到的最简单的方法是使用maven-dependency-plugin从存储库模块复制存储库:

<plugin>
    <artifactId>maven-dependency-plugin</artifactId>
    <version>2.8</version>
    <executions>
        <execution>
            <goals>
                <goal>unpack</goal>
            </goals>
            <phase>integration-test</phase>
            <configuration>
                <artifactItems>
                    <artifactItem>
                        <groupId>com.iar</groupId>
                        <artifactId>my.toolchain.repository</artifactId>
                        <version>0.0.1-SNAPSHOT</version>
                        <type>zip</type>
                    </artifactItem>
                </artifactItems>
            </configuration>
        </execution>
    </executions>
</plugin>

This will copy and unpack the repository locally. 这将在本地复制和解压缩存储库。 It can then be specified as a repository when calling the eclipserun target: 然后可以在调用eclipserun目标时将其指定为存储库:

<repository>
    <url>file://${project.build.directory}/dependency</url>
    <layout>p2</layout>
</repository>

The only thing you need to know is the GAV of the "eclipse-repository" module which contains the repository you need. 您唯一需要知道的是包含您所需存储库的“ eclipse-repository”模块的GAV。

EDIT: This turned out to not work as I expected. 编辑:事实证明这无法正常工作。 It will pull artifacts from the local repository, and not from the reactor as I expected. 它将从本地存储库中提取工件,而不是从反应堆中提取工件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM