Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

This page describes the steps required to create a new custom plugin, generate the jars, and subsequent deployment of the custom plugin into CDAP.

Steps

The creation and deployment of custom plugins involves three broad steps.

  1. One time setup on your local machine to write the java code.

  2. Writing the plugin code and building the jar.

  3. Deploying the plugin in CDAP.

One Time Setup

Clone Cloud Source repository to local machine

  • Install Google Cloud SDK on your local machine following the instructions available at:

https://cloud.google.com/sdk/docs/quickstart-macos

  • Run gcloud init to initialize your session with the right user name and project.

Set user name as the appropriate. 

Set project id to the project id hosting the cloud source repository.

  • Authenticate using gcloud auth login command:

https://cloud.google.com/source-repositories/docs/authentication

  • Follow instructions on the new web page that opens up, and choose the account that you want to authenticate.

  • When successfully authenticated, you will see a web page with below message:

You are now authenticated with the Google Cloud SDK!

  • Clone Cloud Source Repository to the local machine using the following command:

gcloud source repos clone <repository_name> --project=<project-id>

Install IDE, Maven

  • Install VS Code IDE or any other IDE of your choice:

https://code.visualstudio.com/

  • Install JDK 8.

    • Download and install Java: 

https://docs.oracle.com/javase/10/install/installation-jdk-and-jre-macos.htm#JSJIG-GUID-2FE451B0-9572-4E38-A1A5-568B77B146DE

  • Set JAVA_HOME.

    • Run the below command to get java home directory:

/usr/libexec/java_home -V

  • Set JAVA HOME:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home

Build Plugin Jar

  • In VS Code, on the Terminal pane,

    • Write plugin code in the suitable path in the cloned directory structure:

e.g., /Users/<username>/<repo_name>/<plugin-name>

  • Navigate to the directory where your plugin code is located in the repository path e.g., /Users/<username>/<repo_name>/<plugin-name>

    • Run the following command to build plugin jar:

/opt/apache-maven/bin/mvn install

This will create a new sub-directory ‘Target’ with the jar and json files for the plugin as below:

<plugin_name>-1.25-SNAPSHOT.jar

<plugin_name>-1.25-SNAPSHOT.json

Deploy Plugin in Data Fusion

  • No labels