我们有一个用Tycho 0.15.0建造的项目。当运行测试(即UI测试)时,maven将执行
cmd.exe /X /C ""C:\Program Files (x86)\Java\jre7\bin\java.exe" -Dosgi.noShutdown=false -Dosgi.os=win32 [...]"到目前为止这是可行的。
但是现在,我们希望使用不同的JVM (例如,位于c:\my_custom_jvm\jre\bin中)运行测试实例。
这是可能的吗?我已经寻找了可能的可能性,并找到了jvm选项的Maven保险火插件,但这似乎不支持的tycho-保险火.
作为参考,下面是pom.xml的完整片段:
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>0.15.0</version>
<configuration>
<testSuite>my.tests</testSuite>
<testClass>my.tests.AllTests</testClass>
<product>my.product</product>
<bundleStartLevel>
<bundle>
<id>org.eclipse.equinox.event</id>
<level>4</level>
<autoStart>true</autoStart>
</bundle>
</bundleStartLevel>
<dependencies>
<dependency>
<type>p2-installable-unit</type>
<artifactId>my.product</artifactId>
<version>0.0.0</version>
</dependency>
</dependencies>
<argLine>-Xmx768m -XX:PermSize=128m -Xss1m -Dosgi.framework.extensions=org.eclipse.equinox.weaving.hook -Dequinox.ds.block_timeout=60000 -Dequinox.use.ds=true</argLine>
</configuration>
</plugin>
</plugins>
</build>发布于 2013-07-30 20:46:18
(根据专家的答覆)
工具链插件完全可以满足我的需要。
我将以下行添加到我的pom.xml中(在标记中):
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
<configuration>
<toolchains>
<jdk>
<version>1.4</version>
<vendor>sun</vendor>
</jdk>
</toolchains>
</configuration>
</plugin>我在C:\Users\itsame\.m2中创建了一个C:\Users\itsame\.m2文件(如果您希望它放在其他地方,也许this会帮助它),其中包括以下内容:
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<version>1.4</version>
<vendor>sun</vendor>
<id>CustomJRE</id>
</provides>
<configuration>
<jdkHome>c:\my_custom_jvm\jre</jdkHome>
</configuration>
</toolchain>
</toolchains>注意,尽管它是一个JRE (不是JDK),但它可以运行测试。
发布于 2013-07-24 11:00:57
tycho支持maven工具链1
1
https://stackoverflow.com/questions/17827815
复制相似问题