Using Maven 2.x to build and deploy Sakai
- Note: Maven 2 is supported in Sakai 2.5 or higher, if you are using an older version see Using Maven 1.0.x to build Sakai tools
- Open a command line shell
- Change directory to /opt/<sakai-src>/
- Example: cd /opt/cafe-trunk/
- Execute mvn clean install sakai:deploy to clean, build, and deploy the sakai source
- Note: This is the same as the old maven 1 maven cln bld dpl
- Note: Automated tests should be executed by maven by default
- Note: You need to have a settings.xml file defined for this to deploy to the write location, if you do not have one, you can run the command this way to specify a deploy deirectory
mvn -Dmaven.tomcat.home=/opt/tomcat clean install sakai:deploy
- Note: Developers can build a single Sakai tool (no need to recompile the entire codebase for each change)
- Change directory to /opt/<sakai-src>/<tool-dir>
- Example: cd /opt/cafe-trunk/announcements/
- Execute mvn clean install sakai:deploy to clean, build, and deploy the tool
- Change directory to /opt/<sakai-src>/<tool-dir>
- Note: Developers can even choose to only build a part of single Sakai tool
- Change directory to /opt/<sakai-src>/<tool-dir>/<tool-subdir>
- Example: cd /opt/cafe-trunk/announcements/tool/
- Execute mvn clean install sakai:deploy to clean, build, and deploy just the webapp part of the tool (in thie example)
- Change directory to /opt/<sakai-src>/<tool-dir>/<tool-subdir>
- Quick guide to Maven 2
- Execute mvn clean to clean up any built code or artifacts
- Execute maven compile to build the code
- Execute maven install to build the code and put in the local repository
- Execute maven sakai:deploy to deploy the built code (will fail to do anything if not code is built yet)
- Note: The Sakai maven 2 plugin should always be installed automatically