...
Make sure you have the Sun Java SE 5 JDK and Apache Ant installed on your system. Set the environment variable JAVA_HOME to point to your JDK directory.
...
No Format |
---|
% cd roller_trunk/apps/weblogger % chmod +x build.sh % build.sh buildant dist |
On Windows:
No Format |
---|
C> cd roller_trunk\\apps\\weblogger C> buildant builddist |
This will build Roller and will stage the Roller web application into the apps/weblogger/build/webapp subdirectory. The build subdirectory can be removed for a clean build by specifying the Ant target clean
. Examine the build.xml
file for additional targets.
...
Currently, unit tests run using mock contexts and use HSQLDB for the test database. They do not require actual container deployment, and can be run as soon as you have completed a full build. To run the tests, use the Ant target "tests". Using the build
script this is invoked by running
No Format |
---|
% build.shant tests |
or
No Format |
---|
C> buildant tests |
This will leave HTML test reports in files in directories under build/reports
.
...
- start-hsqldb: start the HSQLDB database (you should background it or run it in a separate window).
- init-hsqldb: drop and create all of the Roller tables (assumes HSQLDB is running)
- stop-hsqldb: stop the HSQLDB database
Ant-based Deployment
There are some Ant targets to support the repeated deployment that occurs for developer testing. These are not intended to be used for production deployment. This section describes how to set up the deploy-tomcat
target.
Using the deploy-tomcat
target
The deploy-tomcat
target will copy the webapp files from your build staging directory to the webapps subdirectory of your Tomcat catalina.home. It does not set up the Tomcat context (e.g. roller.xml) or server.xml files for you. You must do this once manually.
To setup to use the deploy-tomcat
target, perform the following steps:
- Copy
personal/sample.build.xml
topersonal/build.xml
. You may wish to edit thedeploy-tomcat
target that is within that. For my needs, I was able to just use the sample version verbatim. This target gets invoked by thedeploy-tomcat
target that is in the top-level build.xml. - Edit the
ant.properties
file at the top-level of the Roller tree. Make sure that the following properties are defined:
;staging
:The directory from which you wish to deploy. Generally the value of this should be "../build/roller"
;webapp.name
:The deployed webapp name. Typically this value is "roller". If you change it, make sure the names in your context descriptor, and the filename of the context descriptor agree.
;catalina.home
:Your catalina home directory. The Ant script assumes your web apps are deployed towebapps
under this directory.
...
Create and maintain a customized build
...
- svn co $ROLLERSVN roller-2.1
- cvs -d $YOURCVS co $YOURROLLERCUSTOM
- cd roller-2.1
- mv custom custom.orig
- ln -s ../$YOURROLLERCUSTOM custom./build.sh rebuild
- ant clean dist
This technique has been used to make changes to JSPs, velocity macros, themes, images, and "small bits" of code. The .xmlf files in the default custom
directory provide examples of customizations you can use. (Note: You'll need a solid understanding of Apache Ant to make these kind of changes.)