Community Articles

Find and share helpful community-sourced technical articles.
Welcome to the upgraded Community! Read this blog to see What’s New!
Labels (1)


Using correct HDP repositories is a requirement when building Spark production applications that run on HDP. Hence I decided to create this article to help those creating new spark applications using Eclipse with maven that may not know how to reference the Hortornworks repositories instead of the default ones.


Following video goes step by step on how to create a simple spark application using the Hortonworks repositories. I will share the content of pom.xml and Hello scala class bellow.


1. From market place you need to install Scala IDE for Eclipse. Site:

2. Second install the maven integration for Scala IDE plugin. Site:

3. Finally you need to add the archtype Remote Catalog - Url:

The pom.xml

<project xmlns=""; xmlns:xsi=""; xsi:schemaLocation="">;
  <description>My wonderfull scala app</description>
            <id>hortonworks repo</id>
            <name>hortonworks repo</name>
            <id>hortonworks jetty</id>
            <name>hortonworks jetty repo</name>
      <name>My License</name>
    <!-- Test -->
        <!-- see -->
          <!-- If you have classpath issue like NoDefClassError,... -->
          <!-- useManifestOnlyJar>false</useManifestOnlyJar -->

Important Note: We will use the HDP 2.6.1 Spark 2.1.1 dependencies to build the project. If you are running different HDP version you need to check and correct the dependency to match the correct version being used. Also you should check which is the correct scala you should use in your project. For spark 2.1.1 the correct scala version is 2.11.x.

The Hello scala class

  1. Create a new package called example
  2. Create a new scala class called Hello inside the example package with following content:
package example
import org.apache.spark.{SparkConf, SparkContext}
object Hello extends Greeting with App {
  val conf = new SparkConf().setAppName(appName)
  val sc = new SparkContext(conf)
trait Greeting {
  lazy val appName = "Hello World Spark App"
  lazy val greeting: String = "hello"
Version history
Last update:
‎11-14-2017 01:39 AM
Updated by: