Trong khi tạo Elasticsearch Client, tôi nhận được ngoại lệ java.lang.NoSuchMethodError: com.google.common.util.concurrent. MoreExecutors.directExecutor() Ljava/util/đồng thời/Executor; Sau khi tra cứu, các đường nối như Guava-18 đang được ghi đè bởi một phiên bản cũ hơn trong thời gian chạy, và Guava-18 chỉ hoạt động trong khi thực hiện nhiệm vụ biên dịch.NoSuchMethodError: conflits com.google.common.util.concurrent.MoreExecutors.directExecutor trên Elastic Tìm jar
cấu hình của tôi Maven là sau:
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Làm thế nào tôi có thể buộc các phiên bản Ổi-18 ở thời gian thực hiện?
Cảm ơn bạn đã trả lời, nhưng tôi không thể xóa phiên bản ổi cũ hơn, không thuộc mã của tôi. –
Thực ra tôi giải quyết nó với giải pháp đó, vì vậy cảm ơn bạn! –
Khi tôi xóa phiên bản cũ, nó vẫn còn ném ngoại lệ, vì lib cũ không thể sử dụng ổi.18, làm thế nào tôi có thể sửa lỗi này. – Jack