在搭建Maven项目时导入elasticsearch架包时遇到的问题

<!-- 使用elasticsearch 需要导入两个包,从网上复制的可能因为有特殊字符报
cvc-complex-type.2.3: Element 'dependency' cannot have character [children], because the type's content type is element-only.
错误,只需要自己重新排版即可
-->
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>6.3.0</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>6.3.0</version>
</dependency>

首先是自己导入的只有一个client的jar包,导致在写测试类的时候无法导入下面这个类的包

在导入了第二个jar包之后正常了

我会慢慢更新一下Java 的学习知识,在我所写的内容中有不懂的可以直接私信我。
原文地址:https://www.cnblogs.com/interflow/p/11650284.html