One of the advantages of using Eclipse as your IDE of choice is that each Sakai module (e.g., common, kernel, portal, provider, etc.) available for download from Sakai's SVN repository is configured as an Eclipse project. Each module includes Eclipse's .classpath and .project files, the contents of which mesh with each Sakai module's project.xml file. To view these files and their contents switch to Eclipse's Resource perspective.
Assumptions
- Mac OS environment
- Java 1.4.2 installed
- Tomcat 5.5.x installed together with Compat *.jar
- Maven installed and build.properties defined
- Eclipse 3.1.x installed
- MyEclipse 4.0.x installed (optional)
- Subversion client installed
| SVN client for the Mac A good SVN client for the Mac is the command-line version. You can find it at: http://metissian.com/projects/macosx/subversion To install: You can copy the binary from /usr/local/bin/svn to somewhere on your path if you want, rather than changing your path. |
Retrieve, build and deploy Sakai from source (see sample script automating the following steps below)
- Database: Startup MySQL/Oracle database if not using default HSQL database
- Tomcat: perform fresh install of Tomcat (recommended whenever downloading Sakai source from SVN)
- SVN: create a local SVN folder external to Eclipse workspace directories (e.g.; Users/arwhyte/aw_dev/svnsakai).
- SVN: retrieve files from Sakai SVN repository into local SVN folder (e.g., svn co https://source.sakaiproject.org/svn/trunk/sakai)
- Maven: execute Maven build and deploy goal to Tomcat (i.e., maven sakai
- Start tomcat and launch Sakai (e.g. startup.sh or in debug mode catalina.sh jpda start)
Eclipse/MyEclipse setup
- Create eclipse workspace folder
- Start Eclipse
- Import Subclipse plugin (Help > Software Updates > Find and Install . . . > Search for new features to install > next > new local site (Subclipse at http://subclipse.tigris.org/update) . . . .
- Modify workspace preferences
- Under General > Startup and shutdown deactivate unnecessary plugins (e.g., extraneous MyEclipse plugins)
- Under MyEclipse > Application Server enable Tomcat 5 and specify home location
- Under Java > Buildpath > Classpath Variables add missing CLASSPATH references (e.g., HIBERNATE_HOME, JSSE.jar, JSF_HOME, MAVEN_REPO, OKI_HOME, SPRING_HOME, TOMCAT_HOME, SPRING_HOME and VELOCITY_HOME)
- Under Project disable (unclick) Build Automatically
- Import external Sakai modules (File > Import... > Existing Projects into Workspace > Select root directory (browse to Eclipse workspace and select projects to import) > Finish)
- Under Project > Clean... clean individual projects as necessary
- Under Project enable (check) Build Automatically
| Importing Sakai modules as Eclipse projects Mike Osterman suggests "[w]hen importing the multitude of Sakai project into Eclipse 3.1.x, I've found that you can import them all in one fell swoop by selecting File > Import... > Existing Projects into Workspace and then indicating the root of Sakai in the Select root directory dialogue." |
Sample Script: getsvnsakai.csh
shellscripts $ cat getsvnsakai.csh #!/bin/csh # SET MYPATH # set MYPATH=`pwd` # PICK SAKAI TAG AND CHECKOUT TYPE # HEAD CHECK OUT set TYPE=trunk set TAG=sakai echo SAKAI CHECKOUT TYPE: $TYPE TAG: $TAG echo # SET TOMCAT PORTS AND VERSION set TC_PORT=8080 set TC_SHUT=8005 set TOMCAT=5.5.9 echo TOMCAT Version: $TOMCAT Port: $TC_PORT Shutdown port: $TC_SHUT echo # SET MYSQL CONNECTOR VERSION set MYSQLCONN=3.1.10 echo MySQL VERSION: $MYSQLCONN echo # SET AXIS VERSION set AXIS=1_1 echo AXIS VERSION: $AXIS echo # DIRECTORY CLEANUP cd ~/aw_dev/svnsakai pwd echo rm -rf old-$TAG mv $TAG old-$TAG echo EXTRACTING TOMCAT echo cd ~/aw_dev pwd echo rm -rf tomcat/ tar xf ../aw_downloads/apache/tomcat_5.5.9/jakarta-tomcat-5.5.9.tar mv jakarta-tomcat-5.5.9 tomcat echo EXTRACTING TOMCAT COMPAT JAR echo tar xf ../aw_downloads/apache/tomcat_5.5.9-compat/jakarta-tomcat-5.5.9-compat.tar echo EXTRACTING JMX, XERCES AND XML-APIS JARS echo cp ../aw_downloads/apache/tomcat_5.5.9-compat/jakarta-tomcat-5.5.9/bin/jmx.jar tomcat/bin/jmx.jar cp ../aw_downloads/apache/tomcat_5.5.9-compat/jakarta-tomcat-5.5.9/common/endorsed/xercesImpl.jar tomcat/common/endorsed/xercesImpl.jar cp ../aw_downloads/apache/tomcat_5.5.9-compat/jakarta-tomcat-5.5.9/common/endorsed/xml-apis.jar tomcat/common/endorsed/xml-apis.jar echo GET MySQL CONNECTOR JAR echo cp ../aw_apps/mysql_connector/mysql-connector-java-$MYSQLCONN/mysql-connector-java-$MYSQLCONN-bin.jar tomcat/common/lib/mysql-connector-java-$MYSQLCONN-bin.jar echo ADD SAKAI PROPERTIES FILES echo cd tomcat mkdir sakai cd .. cp tomcat_sakai.properties/sakai.properties tomcat/sakai/sakai.properties cp tomcat_sakai.properties/placeholder.properties tomcat/sakai/placeholder.properties echo ADD SAKAI ADMIN TO TOMCAT-USERS.XML echo # Add line <user username="admin" password="admin" roles="sakaiuser"/> cp tomcat_conf/tomcat-users.xml tomcat/conf/tomcat-users.xml echo UPDATE TOMCAT SERVER.XML echo cd tomcat/conf pwd echo cp server.xml server.sav cat server.sav | sed s/8080/$TC_PORT/ | sed s/8005/$TC_SHUT/ > server.xml diff server.sav server.xml echo GET AXIS echo cd ~/aw_dev pwd echo # copy entire directory (-R) cp -R ../aw_apps/axis/axis-$AXIS/webapps/axis tomcat/webapps/axis echo ADD ACTIVATION, MAIL AND XMLSEC JARS TO tomcat/webapps/axis/WEB-INF/lib echo cp ../aw_apps/axis/axis_missingjars/activation.jar tomcat/webapps/axis/WEB-INF/lib/activation.jar cp ../aw_apps/axis/axis_missingjars/mail.jar tomcat/webapps/axis/WEB-INF/lib/mail.jar cp ../aw_apps/axis/axis_missingjars/xmlsec.jar tomcat/webapps/axis/WEB-INF/lib/xmlsec.jar echo GET SAKAI FROM SVN echo cd ~/aw_dev/svnsakai pwd echo svn co https://source.sakaiproject.org/svn/$TYPE/$TAG cd $TAG # pwd # echo # maven -i maven sakai # maven sakai -Dmaven.tomcat.home=/Users/arwhyte/aw_dev/tomcat/ -Dmaven.repo.remote=http://www.ibiblio.org/maven/,http://cvs.sakaiproject.org/maven/ # maven sakai -Dmaven.tomcat.home=$MYPATH/tomcat/ -D maven.repo.remote=http://www.ibiblio.org/maven/,http://cvs.sakaiproject.org/maven/
Comments (3)
Aug 24, 2005
Thomas Amsler says:
When you checkout the code via SVN, the top level Sakai directory, e.g. sakai201...When you checkout the code via SVN, the top level Sakai directory, e.g. sakai_2-0-1, has an eclipse .project file, which will not let you add all the projects a once.
Solution, delete the .project in that top level Sakai folder and you are good to go.
Nov 05, 2005
Mike Osterman says:
Thomas thanks for confirming this. I thought I was the only one that had this pr...Thomas - thanks for confirming this. I thought I was the only one that had this problem. Not sure why that .project file is there in the first place...
Jan 11, 2006
Parker Morse says:
It looks like that .project file is gone in 2.1.It looks like that .project file is gone in 2.1.