【问题标题】:Which feature to include for bundle org.junitbundle org.junit 要包含的功能
【发布时间】:2011-10-20 09:28:16
【问题描述】:

我正在重构我的 RCP 应用程序,我将使用 tycho 作为构建系统。

在此过程中,我不得不重写我的目标平台以依赖在线存储库。目前,我的目标是:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.6"?>
<target name="MyRcpApp" sequenceNumber="12">
  <locations>
    <location includeAllPlatforms="false" includeMode="planner" includeSource="false" type="InstallableUnit">
      <unit id="org.eclipse.rcp.feature.group" version="0.0.0"/>
      <unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0" />
      <repository location="http://download.eclipse.org/releases/indigo/"/>
    </location>
  </locations>
  <targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
</target>

但是,此目标不提供用于 junit 测试的包 (org.junit)...因此我的 eclipse 有很多错误(由于缺少 junit)并且我的构建失败。

有人知道我应该包括哪个单元吗? (或者,更好的是,我如何获取给定存储库中所有可用单元的列表?)

【问题讨论】:

    标签: eclipse-rcp tycho


    【解决方案1】:

    您将需要 JDT 功能(不幸的是,我知道没有更小的功能包括 junit)

    <unit id="org.eclipse.jdt.feature.group" version="0.0.0"/>
    

    另一种选择是包含单个捆绑 IU(.target 文件格式支持这一点,但目标编辑器 UI 不支持)。在这种情况下,您需要确保还添加了传递依赖项。尝试添加

    <unit id="org.junit" version="0.0.0"/>
    <unit id="org.hamcrest.core" version="0.0.0"/>
    

    【讨论】:

    • +1 包括单个单元!我不希望整个 JDT 只运行我的 junit 测试!
    猜你喜欢
    • 1970-01-01
    • 2013-10-02
    • 2013-09-23
    • 2017-11-01
    • 1970-01-01
    • 2012-11-07
    • 1970-01-01
    • 2018-11-11
    • 1970-01-01
    相关资源
    最近更新 更多