Table of Contents | ||
---|---|---|
|
...
- Download and install Eclipse (Indigo or Juno is recommended);
- Install Scala 2.910.x IDE plugin as described here. Make sure to get the right bundle / update site according with your Eclipse version;
- Install IvyIDE plugin as described here. This will allow to automatically create classpath containers starting from ivy files;
Checkout Kafka source
- git clone http://git-wip-us.apache.org/repos/asfgit@github.com:apache/kafka.git <kafka.project.dir>
Generate Eclipse project files
cd <kafka.project.dir>
- Bootstrap gradle wrapper with:
gradle
Generate the eclipse projects with:
./gradlew eclipse
. This command will create eclipse projects for every project defined in Kafka.- Note that the source folder structure may need to be fixed manually : see
Jira server ASF JIRA serverId 5aa69414-a9e9-3523-82ec-879b028fb15b key KAFKA-4617
Create the Eclipse workspace
...
You should see the projects you have imported. For running unit tests and Kafka broker refer to the previous section.
Info |
---|
You will need regenerate the projects and refresh eclipse every time there is a change in the projects dependencies. In other words, you need to run |
NOTE - update for Eclipse 3.7.x Oxygen, scala-ide 4.7.1RC3 and Scala 2.12
After generating the projects with
gradle -PscalaVersion=2.12
./gradlew -PscalaVersion=2.12 eclipse --refresh-dependencies
In Eclipse you need some manual tweaking to get rid of the build errors :
- remove the duplicate java src path entry from core
- remove all 'test' library entries in the projects : core/streams/streams-scala
then, break the build cycle
- remove the `test-utils` project dependency from streams
- add the test-utils source folders `test-utils/src/main/java` and `test-utils/src/test/java` to the streams project
Intellij Setup
Install and prepare IntelliJ
- Download and install IntelliJ;
- Install the IntelliJ IDEA Scala Plugin (Preferences Menu Item File | Settings -> Plugins -> Browse Repositories -> Search for Scala);
Checkout Kafka source
- git clone http://git-wip-us.apache.org/repos/asfgit clone git@github.com:apache/kafka.git <kafka.project.dir>
...
title | Temporary Hacks |
---|
Currently IntelliJ Scala Plugin doesn't support 2.8.0 Scala, so to use IntelliJ you need to temporary upgrade Kafka's Scala version by editing gradle.properties scalaVersion to 2.9.2.
...
Update libraries and generate IntelliJ project files
- cd <kafka.project.dir>
gradle
./gradlew idea
Create IntelliJ workspace
...