Apache Cayenne Website > Index > Developer Guide > Building Cayenne

Building Cayenne

Prepare

  • Download Maven2.
  • Check out the repository trunk (or another appropriate branch). eg:
    svn co https://svn.apache.org/repos/asf/cayenne/main/trunk/ cayenne

Build All Modules

cd cayenne && mvn install

First Time Bootstrap

When building for the first time (with clean local repo), you must bootstrap the repository by executing the command above. On subsequent runs, you can use other maven commands like "clean", and/or build modules one by one.

Skipping integration tests

In order to skip the tests (to speed up the build process or because some tests are failing):

mvn -Dmaven.test.skip=true install

Building Platform Specific Artifacts

To create CayenneModeler artifacts specific to Mac or Windows, use corresponding profiles (they only work on the machine that runs the target OS):

mvn -P mac install
mvn -P windows install

Windows Woes

Full tree build may fail on Windows if the Maven2 repository directory contains spaces, which it does by default ("C:\Documents and Settings\user\.m2"). This is a bug in Maven. Until it is fixed, the workaround is to relocate a repository to a directory with no spaces, e.g. "C:\.m2". This can be done by entering the new location in the settings.xml itself located in the default directory:

C:\Documents and Settings\user\.m2\settings.xml
<settings>
   <localRepository>c:\.m2</localRepository>
</settings>

It has also been reported that there are issues with Subversion on Windows with long paths:

Long Path Problems in Subversion on Windows
C:\  [succeeded]
C:\Documents and Settings [succeeded]
C:\Documents and Settings\borutb\Desktop [failed]

Build Assemblies

A generic assembly is built like this:

cd cayenne/assembly && mvn clean package

A Windows assembly is built like this:

cd cayenne/assembly && mvn -P windows clean package

A Mac assembly is built with a shell script as Maven does not have a plugin to create a .dmg:

cd cayenne/assembly && ./build-mac.sh

Refresh Documentation from Wiki

To rebuild the docs from Confluence Wiki, a build must be done with "wiki-docs" profile activated:

# cd cayenne/docs/doc
# mvn -P wiki-docs clean install -Dconfluence.userName=username -Dconfluence.password=password
# svn ci -m "docs updated"
Note that building this from parent directory ("cayenne/docs") will result in the docs placed in the wrong location. We need to fix it in the POM.