Development Environment Setup

Creating an Application

When writing a CDAP application, it's best to use an integrated development environment (IDE) that understands the application interface and provides code-completion in writing interface methods.

We recommend using an IDE when building CDAP applications, such as either IntelliJ or Eclipse.

Using IntelliJ

  1. Open IntelliJ and import the Maven project by:

    • If at the starting IntelliJ dialog, click Import Project; or

    • If an existing project is open, click File > Open...

  2. Navigate to and select the pom.xml in the Maven project's directory.

  3. In the Import Project from Maven dialog box, select the Import Maven projects automatically and Automatically download: Sources, Documentation boxes.

  4. Click Next. Complete the remaining dialogs. The new CDAP project is created and opened.

Using Eclipse

  1. In your Eclipse installation, make sure you have the m2eclipse plugin installed.

  2. Click File > Import.

  3. To filter for Maven options, In the Select an import source dialog box, enter maven.

  4. Select Existing Maven Projects as the import source.

  5. Browse for the Maven project's directory.

  6. Click Finish. The new CDAP project is imported, created, and opened.

Running CDAP from within an IDE

As CDAP is an open source project, you can download the source, import it into an IDE, and then modify, build, and run CDAP.

To run CDAP from within an IDE, follow these steps:

  1. Install all the prerequisite system requirements for CDAP development.

  2. Either clone the CDAP repo or download a ZIP of the source:

    • Clone the CDAP repository using $ git clone -b v6.3.0 https://github.com/cdapio/cdap.git

    • Download the source as a ZIP from GitHub and unpack the ZIP in a suitable location

  3. In your IDE, install the Scala plugin (for IntelliJ or Eclipse) as there is Scala code in the project.

  4. Open the CDAP project in the IDE as an existing project by finding and opening the cdap/pom.xml.

  5. Resolve dependencies. This can take quite a while, as there are numerous downloads required.

  6. In the case of IntelliJ, you can create a run configuration to run CDAP Sandbox:

    1. Click Run > Edit Configurations...

    2. Add a new "Application" run configuration.

    3. Set Main class to be io.cdap.cdap.StandaloneMain.

    4. Set VM options to -Xmx1024m (for in-memory MapReduce jobs).

    5. Click OK.

    6. You can now use this run configuration to start an instance of CDAP Sandbox.

This allows you to start CDAP and access it from either the command line (CLI) or through the Microservices. To start the CLI, you can either start it from a shell using the cdap script or run the CLIMain class from the IDE.

If you want to run and develop the UI, you will need to follow additional instructions in the CDAP UI README.

Created in 2020 by Google Inc.