IDE Setup
- Download intelliJ community edition http://www.jetbrains.com/idea/download/
- Import settings into IntelliJ as explained here:
- Coding Standards
- Set Imports: Preferences -> Code Style -> Java -> Imports. Uncheck "Use fully qualified class names in javadocs"
- Install Homebrew
- ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Install git, git-flow and maven
brew install git
brew install git-flow
brew install maven
- Make sure git is version 1.8.x or greater installed on your machine.
- Download node.js http://nodejs.org/download/
brew install nodejs
- Please refer to Build System & CI on how to setup building of CDAP.
Creating an IntelliJ project
- Clone the CDAP project, if not done already
git clone git@github.com:caskdata/cdap.git
- Open IntelliJ and import the CDAP project
- Go to menu
File -> Import Project ...
- Select the
pom.xml
under the CDAP directory - Check
Import Maven projects automatically
andAutomatically download: Sources, Documentations
boxes in theImport Project from Maven
popup. - Click next and the new CDAP project will be created.
- Go to menu
Setting up Checkstyle in IntelliJ
See "Integrating CheckStyle with Intellij" on the Checkstyle integration with gradle wiki page. For more information on the rules enforced by checkstyle, see Java Coding Standards.
Setting up auto Copyright header in IntelliJ
In IntelliJ, do this:
- Go to menu
IntelliJ IDEA -> Preferences…
- Expand the
Copyright
setting on the left (underProject Settings
) - Select
Copyright Profiles
and add a new Copyright Profile (there is a+
button in the top-middle) - Give the profile a name (e.g. Cask Apache v2)
Paste the following text to the Copyright text box
Copyright © $today.year Cask Data, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- In the
Allow replacing copyright if old copyright contains
box, enterCopyright
. - Click on
Copyright
on the left again and add a new scope ofAll
with the copyright profile added in above step.
Build
Make sure git is version 1.8.x or greater
Download node.js http://nodejs.org/download/
Git clone CDAP master project
run: <PATH_CDAP_REPO>/mvn clean package -DskipTests
Set PATH variable :
- in bash:
export PATH=<PATH_TO_CDAP_REPO>:$PATH
Build and run Local Standalone CDAP
cd <path_to_cdap_repo> MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" mvn package -pl cdap-standalone,cdap-app-templates/cdap-etl,cdap-examples -am -amd -DskipTests -P examples,templates,dist,release,unit-tests cd cdap-standalone/target unzip cdap-sdk-<version>-SNAPSHOT.zip && cd cdap-sdk-<version>-SNAPSHOT cd bin ./cdap.sh start
- The ui runs on localhost:9999
- Drag and drop example jars; start/stop flows…