首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么tycho plugin:test考虑的是Bundle-ClassPath而不是bin.includes?

为什么tycho plugin:test考虑的是Bundle-ClassPath而不是bin.includes?
EN

Stack Overflow用户
提问于 2016-07-16 23:10:22
回答 1查看 560关注 0票数 2

在我的eclipse插件项目中。我有一个特定的jar,我需要它在构建过程中是可见的,特别是在测试阶段,但是我不需要它在eclipse插件的运行时可见。我发现tycho-surefire-plugin正在使用MANIFEST.MF的Bundle-ClassPath中存在的jars,而不是build.properties.的bin.includes。有没有办法强迫tycho-surefire-plugin从build.properties而不是MANIFEST.MF获取其类路径?正如我所看到的,这是这两个文件之间的正常区别。

我的片段测试项目pom如下:

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<project>
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.myproject</groupId>
        <artifactId>projectparent</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <relativePath>../../../../projectparent/pom.xml</relativePath>
    </parent>

    <artifactId>com.myproject.projecttest</artifactId>
    <packaging>eclipse-test-plugin</packaging>
    <name>${project.artifactId}</name>
    <description>
        Tests for my project
    </description>

    <properties>
        <maven.site.skip>true</maven.site.skip>
        <maven.site.deploy.skip>true</maven.site.deploy.skip>
    </properties>
</project>
EN

回答 1

Stack Overflow用户

发布于 2016-07-22 09:47:19

如果我正确理解了你的问题:

  • 您有一些依赖项,您只需要在测试阶段使用它们,而不需要将它们包含在产品中。

为此,您必须为测试使用目标平台配置插件,然后指定extraRequirements以包含您的测试仅依赖项。

示例目标-平台-配置:

代码语言:javascript
复制
  <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>target-platform-configuration</artifactId>
            <version>${tycho.version}</version>
            <configuration>
                <environments>
                    <environment>
                        <os>win32</os>
                        <ws>win32</ws>
                        <arch>x86</arch>
                    </environment>
                    <environment>
                        <os>linux</os>
                        <ws>gtk</ws>
                        <arch>x86</arch>
                    </environment>
                    <environment>
                        <os>linux</os>
                        <ws>gtk</ws>
                        <arch>x86_64</arch>
                    </environment>
                </environments>
                <dependency-resolution>
                    <optionalDependencies>ignore</optionalDependencies>
                    <extraRequirements>
                        <requirement>
                            <type>eclipse-plugin</type>
                            <id>org.eclipse.ui</id>
                            <versionRange>0.0.0</versionRange>
                        </requirement>
                        <requirement>
                            <type>eclipse-plugin</type>
                             <id>org.eclipse.ui.views</id>
                            <versionRange>0.0.0</versionRange>
                        </requirement>
                        <requirement>
                            .....
                        </requirement>
                    </extraRequirements>
                </dependency-resolution>
            </configuration>
        </plugin>

将此包含在测试pom中。

希望这能有所帮助。

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

https://stackoverflow.com/questions/38416478

复制
相关文章

相似问题

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