2017-04-21 72 views
0

由於不同的原因,我應該使用DISCO API version 1.4而不是最新版本2.1。基本上,關鍵的原因是根據this documentation2.1不支持西班牙語。java.lang.VerifyError:class org.apache.lucene.analysis.ReusableAnalyzerBase覆蓋最終方法tokenStream

當我在我的項目中使用disco-1.4.jar,我得到了Lucene版本之間的下列衝突:

java.lang.VerifyError: class org.apache.lucene.analysis.ReusableAnalyzerBase overrides final method tokenStream.(Ljava/lang/String;Ljava/io/Reader;)Lorg/apache/lucene/analysis/TokenStream; 

這是我pom.xml

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <groupId>org.test</groupId> 
    <artifactId>testapi</artifactId> 
    <version>1.0-SNAPSHOT</version> 

    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 
     <java.version>1.8</java.version> 
     <spark.version>1.6.1</spark.version> 
    </properties> 

    <parent> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-parent</artifactId> 
     <version>1.4.0.BUILD-SNAPSHOT</version> 
    </parent> 

    <dependencies> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-web</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-test</artifactId> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.github.spullara.mustache.java</groupId> 
      <artifactId>compiler</artifactId> 
      <version>0.9.1</version> 
     </dependency> 
     <dependency> 
      <groupId>joda-time</groupId> 
      <artifactId>joda-time</artifactId> 
      <version>2.9.3</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.jena</groupId> 
      <artifactId>jena-tdb</artifactId> 
      <version>3.0.0</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.json</groupId> 
      <artifactId>json</artifactId> 
      <version>20160810</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.spark</groupId> 
      <artifactId>spark-sql_2.10</artifactId> 
      <version>${spark.version}</version> 
     </dependency> 
     <dependency> 
      <groupId>org.jsoup</groupId> 
      <artifactId>jsoup</artifactId> 
      <version>1.10.2</version> 
     </dependency> 
     <dependency> 
      <groupId>com.fasterxml.jackson.core</groupId> 
      <artifactId>jackson-databind</artifactId> 
      <version>2.8.2</version> 
     </dependency> 
     <dependency> 
      <groupId>com.fasterxml.jackson.module</groupId> 
      <artifactId>jackson-module-scala_2.10</artifactId> 
      <version>2.8.2</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.lucene</groupId> 
      <artifactId>lucene-queryparser</artifactId> 
      <version>6.5.0</version> 
     </dependency> 
    </dependencies> 

    <repositories> 
     <repository> 
      <id>spring-releases</id> 
      <url>https://repo.spring.io/libs-release</url> 
     </repository> 
     <repository> 
      <id>spring-snapshots</id> 
      <name>Spring Snapshots</name> 
      <url>https://repo.spring.io/libs-snapshot</url> 
      <snapshots> 
       <enabled>true</enabled> 
      </snapshots> 
     </repository> 
    </repositories> 
    <pluginRepositories> 
     <pluginRepository> 
      <id>spring-releases</id> 
      <url>https://repo.spring.io/libs-release</url> 
     </pluginRepository> 
    </pluginRepositories> 

</project> 

任何想法如何解決這個矛盾,同時保持迪斯科1.4?

回答

0

pom.xml解決了這個問題,通過替換的Lucene的版本:

<dependency> 
    <groupId>org.apache.lucene</groupId> 
    <artifactId>lucene-queryparser</artifactId> 
    <version>5.1.0</version> 
</dependency>