尝试使用 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/