Build System & CI
Build Overview
We use Maven as our build system
Docs: Available Plugins
Docs: Help Plugin
The top level module to check out which orchestrates all the build process
How To Build CDAP Artifacts
git clone cdap project
git clone git@github.com:caskdata/cdap.git
Common Maven commands
Clean all modules:
mvn clean
Build all modules:
mvn package
Run all tests:
mvn test
Run checkstyle, skipping tests:
mvn package -DskipTests
Build a particular module with all dependencies:
mvn package -pl [module] -am
Run selected test:
mvn -Dtest=TestClass,TestMore*Class,TestClassMethod#methodName -DfailIfNoTests=false testSee http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html for more
Show dependency tree:
mvn package dependency:tree -DskipTests
Show dependency tree for a particular module:
mvn package dependency:tree -DskipTests -pl [module] -am
Show test output to stdout:
mvn -Dsurefire.redirectTestOutputToFile=false ...
Offline mode:
mvn -o ...
Change version:
mvnversions:set-DnewVersion=[new_version] -DgenerateBackupPoms=false
List of projects, build order and the platform details like system properties and environment variables:
mvnhelp:system
Module Organization
The CDAP project is built as a multi-module maven project. While all modules are aggregated in the top-level CDAP pom, only the cdap-api module inherited from CDAP, while all others inherited from the parent module. By doing so, we have the flexibility on internal modules, while keeping the cdap-api simple.
How To Add A New Module
In situations when you want to add new module, create a sub-directory with the name of the new module. Then create a pom.xml inside that looks like this:
|
Then modify the top level pom.xml to include the new module
|
You can also easily do it using Intellij. Just right click on the top level "CDAP" project and select New->Module and follow the screen.