Tuesday, June 7, 2016

How to import elasticsearch project into Eclipse

ElasticSearch uses Gradle to do its build, import the entire project into eclipse is not very obvious. To do that, following the following steps:

1. Clone the project by doing this:
        git clone https://github.com/elastic/elasticsearch
2. Change to the root directory, then run the following command to generate eclipse .project and .classpath files:

        export GRADLE_HOME=/Users/tongli/gradle-2.13
        export PATH=$PATH:$GRADLE_HOME/bin
        gradle clean eclipseProject eclipseClasspath

 3. From eclipse, File->Import->General->Existing Projects into workspace, click on next, then specify where the root location is, also select search for nested projects, click on finish.


Use the following command to deal with ElasticSearch build:

gradle tasks --all
 
lists all tasks, and the dependencies for each task.

gradle clean build
lists all tasks, and the dependencies for each task.

Or reference the following page:

https://docs.gradle.org/current/userguide/eclipse_plugin.html

No comments:

Post a Comment