1

I am trying to change the default workspace for My SWTBot .

but when i use

<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 can't execute with this error message below


[/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] ------------------------------------------------------------------------
Abhishek2k6
  • 425
  • 5
  • 9

1 Answers1

1

There is a specific property of the tycho-surefire-plugin for the workspace directory: https://eclipse.org/tycho/sitedocs/tycho-surefire/tycho-surefire-plugin/test-mojo.html#osgiDataDirectory

So, instead of setting tycho.testArgLine, you should provide your custom directory in the configuration of the tycho-surefire-plugin, for example

<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>
lorenzo-bettini
  • 2,106
  • 1
  • 16
  • 11