簡體   English   中英

運行`SolrTestCaseJ4`測試時出現斷言錯誤:在lucene-core.jar之前修復你的類路徑以獲得tests-framework.jar

[英]Assertion Error when running `SolrTestCaseJ4` tests: Fix your classpath to have tests-framework.jar before lucene-core.jar

當嘗試使用Solr的測試框架運行簡單測試時,我收到以下錯誤消息:

java.lang.AssertionError:在lucene-core.jar之前修復你的類路徑以獲得tests-framework.jar

at __randomizedtesting.SeedInfo.seed(...)

我正在使用IntelliJ IDEA IDE 如何在lucene-core.jar之前修復classpath以獲得tests-framework.jar

盡管@ mindas上面的答案指向了我,但從某種意義上說,它並不是對這個問題的直接回答。 我今天遇到了這個問題,並發現lucene-core.jar並沒有被拉出來。 我把它添加到我的pom.xml中,現在我不再得到上面提到的錯誤了。 以下是我的pom.xml的<dependencies>部分現在的樣子:

  <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版本匹配。

希望這有助於其他人登陸此頁面。

在某些情況下,圖書館的順序可能很重要。 <..>

為了使編譯成功,某些庫(例如與JDK本身及其擴展有關的庫)必須包含在模塊bootclasspath中。 因此,這些庫必須出現在JDK之前的列表中。

有關更多詳細信息,請參閱IntelliJ Web幫助的相關章節

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM