Product
|
Planning
|
Teams
|
Developers
|
Notes
E
dit
A
ttach
Wiki Help
r5 - 07 Aug 2007 - 15:30:30 - TedLeung
You are here:
OSAF
>
Developers Web
>
ChandlerServerSource
<!-- do not erase the basic template % entries --> %OSAFTEMPLATE% ---+ !!Get the Chandler Server Source %TOC% --- ---++ Prerequisites These instructions help you set up your platform for hacking on OSAF's Java server projects. These projects utilize specific versions of particular Java tools. Only use the versions that are explicitly listed here. Using other versions will likely cause problems that we might not know how to help you solve. ---+++ Java SDK If your operating system does not already provide it (try running =java -version= and/or echoing =$JAVA_HOME=), download and install a Java SDK (only use version 1.5 which is labeled as "5.0" on Sun's site): 1 Download a J2SE SDK release from http://java.sun.com/j2se/ * Windows or Linux: the 1.5 SDK is available at http://java.sun.com/j2se/1.5.0/download.jsp -- don't get the NetBeans edition, get "JDK 5.0 Update n" * OS X: find Apple's version of the SDK at http://www.apple.com/support/downloads/java2se50release3.html 1 Install the J2SE SDK according to the instructions included with the release. 1 Set an environment variable =JAVA_HOME= to the pathname of the directory into which you installed the J2SE SDK release. 1 On OS X, you may have to change the symlink for =/System/Library/Frameworks/JavaVM.framework/Versions/Current= (and <nop>CurrentJDK</nop>) to the 1.5.x version of the JDK. ---+++ Maven If your operating system does not already provide it (try running =mvn -v=), download and install the Maven build tool: 1 Download Maven 2.0.4 from http://maven.apache.org/download.html 1 Install Maven according to the instructions displayed at the bottom of the download page. ---+++ Subversion The source code is stored in a Subversion repository. See Projects.SubversionGuidelines for more information about OSAF's Subversion repositories. ---+++ Source code If you have commit priviledges to the Cosmo repository you will need to check out the source as read/write =svn co svn+ssh://svn.osafoundation.org/svn/server/cosmo/trunk cosmo= otherwise you can check it out as read-only =svn co http://svn.osafoundation.org/server/cosmo/trunk cosmo= ---++ Building Chandler Server Cosmo is a Tomcat web application so when it is "built" what is generated is either an =inplace= debugging target or a =war= file used to install into a Tomcat container. At anytime if you want to force Maven to update the SNAPSHOT jar files, use the -U option. This is needed because, by default, Maven 2 will only check for updates once a day. ---+++ Dependencies Cosmo is built on top of many external frameworks, libraries, and tools. Most are pulled straight from [[http://www.ibiblio.org/maven/][Ibiblio's Maven repository]] (or a mirror), but some are found in [[http://builds.osafoundation.org/maven2/][OSAF's Maven repository]] which contains dependencies that we build ourselves or which are not found on Ibiblio. ---+++ Maven targets ---++++ war:inplace To build the =inplace= debugging target, do the following: * =cd cosmo/= * =mvn clean compile war:inplace= This will cause the various webapp pieces to be inserted into the =src/main/webapp/= part of the Cosmo source tree. ---++++ package To generate the Cosmo war file, do the following: * =cd cosmo/= * =mvn package= You will now find a Cosmo-*.war file located in the =target/= sub-directory. ---++++ clean You can remove all of the compiled source code and generated helper files with =mvn clean=. ---++++ test To ask Maven to run the unit tests (and compile if necessary), do the following: * =cd cosmo/= * =mvn test= Detailed test output is generated in text and XML format to =target/surefire-reports=. This, and the brief console output it generates, should be more than enough to debug test failures. You can run a single test by specifying the name of the test class as a command line option: =mvn -Dtest=DavMkTicketTest test= ---+++ Using the release-mode packed dojo.js Normally during the edit/compile/test dev cycle the uncompressed dojo.js file is used so any javascript references for cosmo are pulled from the source tree, but if you are not working on the javascript side you may want to use the compressed dojo.js * =cd dojo= * =mvn -Prelease install= This will generate the dojo jar file using the compressed bits. The next time you compile/test cosmo use the -U command line option with Maven to force it to update the jar dependency. Or to *really* force it, delete the =~/.m2/repository/org/osaf/cosmo/dojo= directory tree *before* you build the release-mode dojo jar. To verify you are using the proper jar, when you next do a =mvn war:inplace= grep for "cosmo" in the dojo.js file - if it worked you will see results. ---+++ Building the Chandler Server distribution, aka Snarf Snarf is the short, fun name for the "OSAF server bundle", which is essentially a Tomcat servlet engine pre-configured to run Cosmo. The Snarf source is located in the =snarf/= sub-project directory. There's no actual Java code, so you don't have to worry about compiling or testing anything. *Note*: If you want to include the migration tools you need to run =mvn package= in =cosmo/migration= before doing the below steps. To generate a tarball of Snarf, which contains Tomcat and the Cosmo war file bundled together: * =cd snarf/= * =mvn package= Snarf can also be generated in a form that makes debugging easier for a developer doing web-side UI work. To do this we need to tell Maven to generate an "exploded" directory: * =cd snarf/= * =mvn assembly:directory= This creates in the =dist/= directory a working image of what would be bundled. Due to the oddities of Maven, you will see the project name listed twice in the directory structure, e.g. =dist/osaf-server-bundle-0.6-SNAPSHOT/osaf-server-bundle-0.6-SNAPSHOT/= ---++ Hack some code You are now set up to write code. You will probably want to observe code changes in the browser or at the command line very frequently. How you do this depends on what code you're modifying: * If you make a change to a JSP, you should be able to reload the corresponding web page and observe the change in your browser without any further steps. * If you make a change to a Java class or to a configuration file, you'll need to run =maven war:inplace= again (probably with =-Dmaven.test.skip=true= so that you skip the unit tests). Because you made the webapp reloadable, Tomcat will automatically sense the recompiled class or modified config file and will redeploy the webapp after a few seconds. You can see it doing this by watching =$OSAFSRV_HOME/logs/osafsrv.log= and looking for the startup message (the timestamp should be more recent than when you ran =maven war:inplace=). ---++ Generate a release There's a lot more to making a Cosmo release than just building a binary package. See Projects.CosmoReleaseProcess for more information. ---++ Customize your build Maven downloads Tomcat 5.5.17 to build the Snarf package. If you want to use a different version then you need to edit the apache-tomcat dependency in =snarf/pom.xml= <pre> <dependency> <groupId>org.osaf</groupId> <artifactId>apache-tomcat</artifactId> <version>5.5.17</version> <type>zip</type> </dependency> </pre> %RED% Needs to be updated %ENDCOLOR% *Note*: The following was valid when Cosmo was being built using Maven 1 but now with Maven 2 the property names and values reside in ~/.m2/settings.xml and the following has not been updated. All customizations are made in =build.properties=, overriding those properties set in =project.properties=. Some common development customizations: * =maven.compile.debug=on= * =maven.compile.deprecation=on= * =maven.compile.optimize=off= ---++ Archive Previous [[ChandlerServerReleases][Chandler Server Releases]] %OSAFTEMPLATEEND%
E
dit
|
W
YSIWYG
|
A
ttach
|
P
rintable
|
V
iew topic
|
Backlinks: We
b
, A
l
l Webs
|
H
istory: r5 <
r4
<
r3
<
r2
<
r1
|
M
ore topic actions
Developers.ChandlerServerSource moved from Projects.ChandlerServerSource on 13 Jul 2007 - 17:32 by MimiYin
- put it back
chandlerproject.org
VISION
TOUR
Download Desktop
Get a Hub Account
Get Chandler Server
FAQ
Get Started
Blog
Mailing Lists
Chat on IRC
Report a Bug
Get Involved
OSAF Community
About OSAF
Developers Wiki Changes
Open Source Applications Foundation
Dansk
Deutsch
English
Español
Finnis
Français
Italiano
Nederlands
Polski
Português
Svenska
简体中文
繁體中文
Except where otherwise noted, this site and its content are licensed by OSAF under an Creative Commons License, Attribution Only 3.0.
See
list of page contributors
for attributions.