Search code examples
mavensbtapache-zeppelin

What dependency to add to project (sbt or maven) get hold of ZeppelinContext?


Zeppelin has an object ZeppelinContext, which can then be used to share state between languages and bind variables to angular and thus create cool user interfaces inside Zeppelin notebooks.

We have written numerous convenience methods to create things like drop down menus, buttons, UI stuff, from scala. These methods call ZeppelinContext. We wish to add these methods to an sbt project, so that we can package them in a jar, but it seems the Zeppelin project provides no artifact that contains ZeppelinContext (we have tried many).

Rather there only seems to exist two work arounds:

  1. Build all of Zeppelin and add the resulting jar as an unmanaged jar (not nice).
  2. Use duck typing (also really not nice).

Question: Is there a lesser known resolver / artifact id to get hold of this type?


Solution

  • The ZeppelinContext class is available on github.

    From the related pom.xml file the Maven coordinates are:

      <groupId>org.apache.zeppelin</groupId>
      <artifactId>zeppelin-spark_2.10</artifactId>
    

    Which leads to this Maven dependency on the Maven Central repository.

    <dependency>
        <groupId>org.apache.zeppelin</groupId>
        <artifactId>zeppelin-spark_2.10</artifactId>
        <version>0.6.1</version>
    </dependency>
    

    Effectively, the jar file contains the ZeppelinContext.class.