zoukankan      html  css  js  c++  java
  • java 操作elasticsearch之搭建测试项目环境

    在创建项目之前请确认maven是否安装好,在此我是以环境都搭建好的情况下进行示范,现在以eclipse开发工具为例,具体操作如下:

    1、创建maven项目

    File - new -other

     

    2、在pom文件中导入对应的jar包坐标

    在此我没有添加log4j等坐标,需要的根据自己需要进行添加jar包坐标

    <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>com.cyb</groupId>
      <artifactId>ElasticTest</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      
       <dependencies>
            <!-- Elasticsearch核心依赖包 -->
            <dependency>
                <groupId>org.elasticsearch.client</groupId>
                <artifactId>transport</artifactId>
                <version>6.2.4</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
                <scope>test</scope>
            </dependency>
           
            
        </dependencies>
        
        <build>
            
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.2</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                        <encodeing>UTF-8</encodeing>
                    </configuration>
                </plugin>
            </plugins>
       
        </build>
    </project>

    3、根据pom坐标进行下载对应的jar包

      右击项目-选择maven-选择 update project..进行jar包下载

      到此该项目环境已搭建完成,后期我将java操作的增删改查,聚合查询,版本控制陆续在后面博客中写出,感兴趣的朋友可以关注,另转发请说明转发出处。本人的博客主页为:https://www.cnblogs.com/chenyuanbo/ 。另这篇文章也感谢千峰教育对这些技术视频的免费,祝千峰发展越来越壮大。

    技术在于交流!

  • 相关阅读:
    无休止的项目,何来快感!!
    [From HTTP to AWS][4]使用LibcURL with OpenSSL support
    [From HTTP to AWS][2]Analyze TCP/IP Packets
    The setup of Piaoger
    从Adobe Subscription editions扯到破坏性创新
    SaaS窘境[欣赏然后翻译之]
    Algodoo,很棒的物理引擎
    浮水法POJ2528
    蛤的旅行
    题解 CF712A 【Memory and Crow】
  • 原文地址:https://www.cnblogs.com/chenyuanbo/p/10296777.html
Copyright © 2011-2022 走看看