Create your project

Chris Beams edited this page Dec 22, 2010 · 6 revisions


These instructions are written specifically with new Gradle-based Spring projects in mind, but may be of general use to any Spring project concerned with setting up infrastructure such as continuous integration, issue tracking, etc.

Prerequisites for using the shared Gradle build

Project must be Git- or Subversion-based

Git projects will include the buildSrc directory as a git submodule, and thanks to GitHub's Subversion support, SVN projects can include buildSrc as an svn:external.

Project documentation must be based on Docbook 5

Many projects currently use Docbook 4.x; in order to use the Docbook plugin included in buildSrc, sources will need to be updated to Docbook 5. This is usually as simple as changing the root element of each XML file to use the docbook 5 XSD instead of the docbook 4 DTD.

Summary of Steps

  1. choose a git repository location
  2. set up 'info' docs
  3. set up CI
  4. set up Jira
  5. set up documentation subproject
  6. set up settings.gradle
  7. set up
  8. set up build.gradle
  9. add shared buildSrc submodule
  10. set up .gitignore
  11. initialize remote doc structure
  12. generate and check in the Gradle Wrapper

Steps in Detail

Set up CI

Request a new project be set up for you at at Use your project abbreviation, e.g.: 'INT' to identify your project. This will make up the first part of the 'build key'. Use something sensible like 'NIGHTLY' or 'MASTER' as the second part of the build plan key. Many projects further distinguish the second part of the build key as 'MASTERQUICK' and 'MASTERNIGHTLY' in order to accommodate per-branch nightly and quick builds.

In the Administration section for each of your build plans, set the 'Builder' to 'Script' and supply gradlew as the script. See Screenshot below (TODO)

Be sure to set JAVA_HOME to the specific JDK you wish to use. Other builder configurations like Maven and Ant allow for setting the JDK explicitly, but as Gradle relies on Bamboo's generic 'script' support, we narrow the JDK through the environment. The JAVA_HOME you specify will be picked up by the gradlew script. If this is not set, you'll get whatever happens to be the current JDK on the build machine. This is probably Java 6. For projects that need to ensure compatibility with Java 5, setting JAVA_HOME is imperative.

  • set up Jira
  • set up documentation subproject
  • set up settings.gradle
  • set up
  • set up build.gradle
  • add shared buildSrc submodule
  • set up .gitignore
  • initialize remote doc structure on static including: * api and reference and changelog links * latest-ga link * 2.0.x (wildcard) link semantics
  • generate and check in the Gradle Wrapper
  • set up multi-project build
    • settings.gradle
  • git submodule add /Users/cbeams/Work/spring-build/gradle buildSrc