Child pages
  • Maven Build and Deploy (2.x - 3.x)
Skip to end of metadata
Go to start of metadata

Install the Sakai master project

Sakai makes use of Maven's Project Object Model to provide an XML representation of basic project information covering dependency management, build targets, external repositories, issue tracking, mailing lists, reporting plugins, developer bios, etc. A top-level master pom.xml file located in the /master project acts as a parent for other Sakai pom.xml files. If you are building Sakai for the first time you should install the master project first by issuing the clean and install goals from the /master project folder.

cd master
mvn clean install
cd ..

Install and deploy Sakai

Once you have built the master pom, issue the following Maven goals from the top-level Sakai source directory:

(info) -Dmaven.tomcat.home specifies Tomcat's location. -Dsakai.home specifies the location of the sakai properties file(s) within Tomcat. -Djava.net.preferIPv4Stack can help resolve issues with Maven hanging while attempting to pull from certain repositories. These can be omitted if specified in Maven's settings.xml file (version 2.x) or in MAVEN_OPTS (version 3.x).

mvn clean install sakai:deploy -Dmaven.tomcat.home=/pathto/tomcathome -Dsakai.home=/pathto/tomcathome/sakai -Djava.net.preferIPv4Stack=true

Your first Sakai build will take some time as Maven downloads and stocks your local .m2/repository with missing dependencies while performing the build and deploying .war and .jar files to Tomcat's $CATALINA_HOME/webapps, $CATALINA_HOME/components and $CATALINA_HOME/shared/lib folders. If during this process Maven reports that the build failed read the accompanying error message carefully to troubleshoot the issue (see the Troubleshooting section).

You can also issue mvn clean install sakai:deploy from any sakai project module top-level folder in order to build and deploy portions of Sakai such as individual tools.

Maven Goal Options

There are a number of other ways to build and deploy Sakai using Maven:

Print debug output

mvn -X clean install sakai:deploy

Build and Deploy in offline mode

If your local repository contains all Sakai project dependencies, you can run Maven "offline" by adding the -o option:

mvn -o clean install sakai:deploy

Skip unit tests

There may be occasions when you want to build and deploy Sakai without executing the set of unit tests that accompany many of the Sakai modules. If so add -Dmaven.test.skip=true to the goals you issue:

mvn clean install -Dmaven.test.skip=true sakai:deploy

Perform a "framework" build

The framework build profile triggers a Sakai build minus it's tool set.

The -Pframework build profile is no longer supported in Sakai 10.x versions.

mvn -Pframework clean install sakai:deploy

Perform a "cafe" build

The programmers' cafe build profile is favored by many developers new to Sakai as well as those developing or testing new capabilities.

The -Pcafe build profile is no longer supported in Sakai 10.x versions.

mvn -Pcafe clean install sakai:deploy
  • No labels