ID #1040

Building Sakai from source with Maven -- from subdirectories (or, one module or project at a time)

Once your maven is set up properly, you can issue maven commands from the top-level directory of your source tree, to build and to deploy Sakai/OSPortfolio:

maven bld dpl

The "build" portion compiles your source code (primarily java) from items in the "src" directories, and plops the appropriate results into the "target" directories. The "deploy" portion moves those results into the Tomcat directory structure in order to serve up your Sakai/OSP instance.

But when you're tweaking just a portion of the source code -- for example, the providers -- you shouldn't have to wait for a half hour to rebuild the entire tree, right? It's just a few little changes local to one project of one module... You should be able to quickly update just the compiled items that depend on those few items that have changed in your subtree, and then deploy those, in a matter of seconds...

"We have the technology. We can rebuild it!"

To do that, you need the Sakai plugin for maven. (You also need to set up your maven as outlined in the normal setup docs):

maven plugin:download \
-DartifactId=sakai \
-DgroupId=sakaiproject \
-Dversion=2.2 \
 __  __
| \\/ |__ _Apache__ ___
| |\\/| / _` \\ V / -_) ' \\ ~ intelligent projects ~
|_| |_\\__,_|\\_/\\___|_||_| v. 1.0.2



[delete] Deleting 1 files from C:\Apache\Maven\Maven1.0.2\plugins
[delete] C:\Documents and Settings\windo~1\.maven\plugins not found.
[delete] Deleting 5 files from C:\Documents and Settings\windo~1\.maven\cache
[delete] Deleted 2 directories from C:\Documents and Settings\windo~1\.maven\cache
[copy] Copying 1 file to C:\Apache\Maven\Maven1.0.2\plugins
Total time: 2 seconds

Once you've done that, your maven will behave nicely, even from inside subdirectories of your source tree. You can tweak a few files from one project, then issue the build-and-deploy command from there, and you're ready to restart Tomcat (in a matter of seconds, instead of half an hour)...

This applies to version 2.4 as of July 2007.

OSP is an open-source electronic portfolio built into Sakai, which is an open-source CLE (collaborative learning environment).

Categories for this entry

Last update: 2008-07-09 16:50
Author: will trillich
Revision: 1.1

Print this record Print this record
Send to a friend Send to a friend
Show this as PDF file Show this as PDF file
Export as XML-File Export as XML-File

Please rate this entry:

Average rating: 3.35 out of 5 (46 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry