我可以在maven测试阶段传递我的单元,但如果我运行验证,我将遇到NoSuchMethodError问题。我在父pom文件和子模块文件中有不同的番石榴版本。但奇怪的是,测试通过测试,但在验证中遇到了这个问题。谁能告诉我为什么?感谢
java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;
at org.elasticsearch.threadpool.ThreadPool.<clinit>(ThreadPool.java:192)
at org.elasticsearch.node.Node.<init>(Node.java:170)
at org.elasticsearch.node.Node.<init>(Node.java:140)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:143)
at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:150)
....
这是父pom文件中与番石榴有关的东西
<properties>
<guava.version>15.0</guava.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
...
这是子模块中与番石榴相关的东西
<properties>
<guava.version>18.0</guava.version>
</properties>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>