THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
- Run as...<Unit Test|Scala Application>
- By default log4j will not be configured correctly. To fix this go to your run target and under Classpath choose Advanced... and then Add Folders, and the folder config/
Eclipse Setup With SBT Eclipse Plugin
The following steps assume you have the kafka source and installed the Eclipse Scala IDE, as stated in the Eclipse Setup section above.
- edit the project/plugins.sbt file by adding the
sbteclipse-plugin
from Typesafe (last line in the snippet below). Once modified, the file should look like this:Code Block resolvers += Resolver.url("artifactory", url("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns) addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.8.5") addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.2.0") addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.1")
- run:
./sbt update
- generate the eclipse projects with:
./sbt eclipse
. This command will create eclipse projects for every project defined in Kafka. You should have the following output on your console:Code Block [info] About to create Eclipse project files for your project(s). [info] Successfully created Eclipse project files for project(s): [info] kafka-perf [info] hadoop-consumer [info] kafka-java-examples [info] kafka [info] hadoop-producer
- In eclipse, use Import -> General -> Existing Projects into Workspace
- navigate to the kafka source directory, it should find the projects generated by the previous command.
- select the projects you want to import and click Finish
- you should see the projects you have imported
Once you have your projects in place, you will be able to run/debug any of the applications from eclipse.
Info |
---|
You will need regenerate the projects and refresh eclipse every time there is a change in the projects dependencies. In other words, every time you run |
Intellij Setup
- Checkout kafka source
- Update the libraries:
- ./sbt update
- Create IDEA project files:
- ./sbt
- idea
- Install the IntelliJ IDEA Scala Plugin Preferences -> Plugins -> Browse Repositories -> Search for Scala
- Open Itellij, Open new project, point to your kafka source location.