【问题标题】:Tycho Surefire argline -data not workingTycho Surefire argline - 数据不工作
【发布时间】:2016-06-27 12:14:58
【问题描述】:

我正在尝试更改 My SWTBot 的默认工作区。

但是当我使用

<properties>
    <test-work-directory>/home/chakraborty/example/app/ide/example/SWTBbot_work</test-work-directory>
    <tycho.testArgLine>-data ${test-work-directory}</tycho.testArgLine>
</properties>

Maven 无法执行并出现以下错误消息


[/usr/lib/jvm/java-8-oracle/jre/bin/java, -Dosgi.noShutdown=false, - Dosgi.os=linux, -Dosgi.ws=gtk, -Dosgi.arch=x86_64, -data, /home/chakraborty/example/app/ide/example/SWTBbot_work, -Dosgi.clean=true, -jar, /home/chakraborty/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.launcher/1.3.200.v20160318-1642/org.eclipse.equinox.launcher-1.3.200.v20160318-1642.jar, -data, /home/chakraborty/example/app/ide/example/tests/com.example.ui.test/target/work/data, -install, /home/chakraborty/example/app/ide/example/tests/com.example.ui.test/target/work, -configuration, /home/chakraborty/example/app/ide/example/tests/com.example.ui.test/target/work/configuration, -application, org.eclipse.tycho.surefire.osgibooter.uitest, -testproperties, /home/chakraborty/example/app/ide/example/tests/com.example.ui.test/target/surefire.properties, -testApplication, org.eclipse.ui.ide.workbench, -product, com.example.application.exampleide, -nouithread]
Unrecognized option: -data
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.580 s
[INFO] Finished at: 2016-06-27T14:05:44+02:00
[INFO] Final Memory: 64M/565M
[INFO] ------------------------------------------------------------------------

【问题讨论】:

    标签: eclipse tycho surefire swtbot


    【解决方案1】:

    tycho-surefire-plugin 的工作空间目录有一个特定的属性:https://eclipse.org/tycho/sitedocs/tycho-surefire/tycho-surefire-plugin/test-mojo.html#osgiDataDirectory

    因此,您应该在 tycho-surefire-plugin 的配置中提供自定义目录,而不是设置 tycho.testArgLine,例如

    <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-surefire-plugin</artifactId>
        <version>${tycho-version}</version>
        <configuration>
            <!-- other configurations, e.g., for SWTBot -->
            <osgiDataDirectory>${test-work-directory}</osgiDataDirectory>
        </configuration>
    </plugin>
    

    【讨论】:

      猜你喜欢
      • 2016-12-14
      • 2016-07-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多