我正在使用Tycho构建和测试一些Eclipse插件。我有一个包含许多平台特定片段的bundle。我还有一个测试bundle,该测试bundle使用tycho-surefire-plugin来测试具有平台特定片段的原始bundle。然而,Tycho没有将当前平台的fragment包含在测试运行时中。
所有平台特定片段都像下面列出的win64片段清单一样。(实际上,总共有六个片段,每个片段都是为我需要支持的每个平台组合而创建的。)
当我尝试执行Tycho构建并运行surefire测试插件时(无论我尝试哪个操作系统),正确的平台片段不会被添加到运行时中。我在stackoverflow上看到了一些各种 帖子,涉及类似的问题,但在那些情况下,加载到测试运行时中的片段不是具有操作系统过滤器的特定于平台的片段。
所有平台特定片段都像下面列出的win64片段清单一样。(实际上,总共有六个片段,每个片段都是为我需要支持的每个平台组合而创建的。)
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Liferay AUI Upgrade Tool Win64
Bundle-SymbolicName: com.liferay.laut.win32.win32.x86_64;singleton:=true
Bundle-Version: 1.0.2.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Fragment-Host: com.liferay.ide.alloy.core
Eclipse-BundleShape: dir
Eclipse-PlatformFilter: (& (osgi.ws=win32)(osgi.os=win32)(osgi.arch=x86_64))
Bundle-Vendor: Liferay, Inc.
示例 win64 片段 pom.xml 的 <build>
部分
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</build>
当我尝试执行Tycho构建并运行surefire测试插件时(无论我尝试哪个操作系统),正确的平台片段不会被添加到运行时中。我在stackoverflow上看到了一些各种 帖子,涉及类似的问题,但在那些情况下,加载到测试运行时中的片段不是具有操作系统过滤器的特定于平台的片段。
tycho-surefire-plugin
上配置了extraRequirements
。但这没有作用。extraRequirements
必须在target-platform-configuration
插件上配置。 - oberlies