当使用tycho-surefire-plugin执行 JUnit 测试时,tycho fork 一个Equinox 运行时。在极少数情况下,OSGi 测试运行时中的某些包可能无法解析/启动(例如包使用冲突)。如果您阅读调试日志(maven CLI 选项-X
),您会发现类似
!ENTRY org.eclipse.osgi 2 0 2012-10-08 16:41:31.635
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2012-10-08 16:41:31.635
An error has occurred. See the log file
C:\mytestproject.tests\target\work\configuration\1349705136008.log.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12:03.181s
[INFO] Finished at: Mon Oct 08 16:17:16 CEST 2012
[INFO] Final Memory: 20M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:0.15.0:test (default-test) on project mytestproject.tests: An unexpected error occured (return c
ode 13). See log for details. -> [Help 1]
在包使用冲突的情况下,eclipse 控制台日志没有提供足够的信息。
如何分析由 tycho 分叉的 OSGi 测试运行时中的捆绑包?