Add build.gradle samples and docs for deployable WAR

Fixes gh-518