第谷Surefire argline -data无法正常工作

时间:2016-06-27 12:14:58

标签: eclipse tycho surefire swtbot

我正在尝试更改“我的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] ------------------------------------------------------------------------

1 个答案:

答案 0 :(得分:0)

工作区目录的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>