Using Maven 2.x to build and deploy Sakai

  1. Open a command line shell
  2. Change directory to /opt/<sakai-src>/
    • Example: cd /opt/cafe-trunk/
  3. 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)
    1. Change directory to /opt/<sakai-src>/<tool-dir>
      • Example: cd /opt/cafe-trunk/announcements/
    2. Execute mvn clean install sakai:deploy to clean, build, and deploy the tool
  • Note: Developers can even choose to only build a part of single Sakai tool
    1. Change directory to /opt/<sakai-src>/<tool-dir>/<tool-subdir>
      • Example: cd /opt/cafe-trunk/announcements/tool/
    2. Execute mvn clean install sakai:deploy to clean, build, and deploy just the webapp part of the tool (in thie example)


  • 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