java - 在 lucene-core.jar 之前运行 `SolrTestCaseJ4` 测试 : Fix your classpath to have tests-framework. jar 时出现断言错误

标签 java solr lucene

尝试使用 Solr's testing framework 运行简单测试时我收到以下错误消息:

java.lang.AssertionError: fix your classpath to have tests-framework.jar before lucene-core.jar

at __randomizedtesting.SeedInfo.seed(...)

我正在使用 IntelliJ IDEA IDE .如何修复类路径以在 lucene-core.jar 之前包含 tests-framework.jar

最佳答案

尽管上面@mindas 的回答向我指出了这一点,但从某种意义上说,这并不是对问题的直接回答。我今天遇到了这个确切的问题,发现 lucene-core.jar 并没有被拉出来。我将它添加到我的 pom.xml 中,现在我不再收到上述错误。这是 <dependencies> 的内容我的 pom.xml 部分现在看起来像:

  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.7.5</version>
    </dependency>
    <dependency>
      <groupId>org.apache.solr</groupId>
      <artifactId>solr-test-framework</artifactId>
      <version>4.6.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.lucene</groupId>
      <artifactId>lucene-core</artifactId>
      <version>4.6.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

注意:确保您的 lucene-core 和 solr-test-framework 版本匹配。

希望这有助于其他人登陆此页面。

关于java - 在 lucene-core.jar 之前运行 `SolrTestCaseJ4` 测试 : Fix your classpath to have tests-framework. jar 时出现断言错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25721320/

相关文章:

java - 使用牛顿法求平方根的时间复杂度

java - 错误: Failed to resolve: android.支持:support. v7 :29. 0.2

java - 公共(public)(静态)swap() 方法与冗余(非静态)私有(private)方法

search - Solr 术语跨多个字段的组件?

boost - 如何在Elasticsearch中使用所有搜索词而不是所有搜索词的OR来 boost 记录?

java - 非事务 session 中抛出的 JMS 事务异常

apache - 如何按 Apache Solr 中关联对象的数量过滤结果?

curl - SOLR索引一个远程文件

Solr - 在文档中重复查询中的单词没有额外分数

ruby-on-rails - 如何在Rails 4中使用Lucene/Solr?