【问题标题】:Add Fragment to tycho-surefire-plugin将片段添加到 tycho-surefire-plugin
【发布时间】:2017-07-19 12:06:24
【问题描述】:

我想用tycho-surefire-plugin 开始一个片段。很简单,对吧?

<plugin>
    <groupId>org.eclipse.tycho</groupId>
    <artifactId>tycho-surefire-plugin</artifactId>
    <version>${tycho-version}</version>
    <configuration>
        <providerHint>junit4</providerHint>
        <dependencies>
            <!-- I want to add my fragment here -->
        </dependencies>
    </configuration>
</plugin>

但是,由于缺少文档(或者它可能被隐藏了),我无法弄清楚要输入什么:

<!-- this works for a plug-in -->
<dependency>
    <type>p2-installable-unit</type>
    <artifactId>org.eclipse.equinox.ds</artifactId>
</dependency>
<!-- this works for a feature -->
<dependency>
    <type>eclipse-feature</type>
    <artifactId>org.eclipse.e4.rcp</artifactId>
</dependency>
<!-- but a fragment? IDK -->
<dependency>
    <groupId>myGroup</groupId> <!-- I also tried without group -->
    <type>eclipse-fragment</type> <!-- I also tried the above types -->
    <artifactId>org.acme.module.fragment</artifactId>
    <version>${project.version}</version>  <!-- I also tried without version -->
</dependency>

如何向 Tycho Surefire 插件添加片段?

【问题讨论】:

    标签: tycho tycho-surefire-plugin


    【解决方案1】:

    当然,片段是在完全不同的 Tycho 插件中解析的:

    <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>target-platform-configuration</artifactId>
        <configuration>
            <dependency-resolution>
                <extraRequirements>
                    <requirement>
                        <type>eclipse-plugin</type>
                        <id>org.acme.module.fragment</id>
                        <versionRange>0.0.0</versionRange>
                    </requirement>
                </extraRequirements>
            </dependency-resolution>
        </configuration>
    </plugin>
    

    【讨论】:

    • 好吧,根据the plug-in documentation,您可以将它们添加到tycho-surefire-plugin &lt;configuration&gt;,尽管它说使用target-platform-configuration插件是首选方式。
    • @AndreasSewe 我的问题是如何将它们添加到tycho-surefire-plugin。使用那个插件我无法弄清楚他们的类型。
    • Looking at the code&lt;configuration&gt; 元素应该被称为&lt;dependencies&gt;。其中的每个&lt;dependency&gt; 子节点都遵循标准的Maven 格式:&lt;groupId&gt;&lt;artifactId&gt; 等。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-08-09
    • 2015-11-28
    • 2012-11-18
    • 2013-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多