Developer Setup
Skip to end of metadata
Go to start of metadata

Eclipse setup

Install and prepare Eclipse

  • Download and install Eclipse (Indigo or Juno is recommended);
  • Install Scala 2.9.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

Generate Eclipse project files

  • cd <kafka.project.dir>

  • Generate the eclipse projects with: ./gradlew eclipse. This command will create eclipse projects for every project defined in Kafka. 

Create the Eclipse workspace

  • Open Eclipse and create a new workspace;
  • Import the generated project (File -> Import -> General -> Existing Projects into Workspace)
    1. Navigate to the <kafka.project.dir>. Eclipse will find the projects generated by the previous command;
    2. Select the projects you want to import;

You should see the projects you have imported. For running unit tests and Kafka broker refer to the previous section.

Icon

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 ./gradlew eclipse and refresh eclipse.

Intellij Setup

Install and prepare IntelliJ

  • Download and install IntelliJ;
  • Install the IntelliJ IDEA Scala Plugin (Preferences -> Plugins -> Browse Repositories -> Search for Scala);

Checkout Kafka source

Temporary Hacks

Icon

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.

Also remove this file core/src/main/scala/kafka/utils/Annotations_2.9+.scala as it clashes with the Scala Plugin.

Note that if you want to switch back to perform any gradle tasks from the console, you need to revert the deletion of the Annotations_2.9+.scala file, and also set the environment variable SCALA_VERSION to 2.9.2 for any of the kafka shell script to work.

Update libraries and generate IntelliJ project files

  • cd <kafka.project.dir>
  • ./gradlew idea

Create IntelliJ workspace

  • Open Intellij and click open project pointing to <kafka.project.dir>
Labels
  • No labels
  1. Anonymous

    Seems that "./sbt idea" is not correct and instead should be "./sbt gen-idea"

    --Federico

    1. Ok, mistake removed...thank you very much

  2. Anonymous

    I just wanted to comment on your blog and say I really enjoyed reading your blog here. It was very informative and I also digg the way you write! Keep it up and I'll be back soon to find out more mate.Sound Box