Welcome to the Daisy CMS! http://www.daisycms.org === BUILDING DAISY FROM SOURCE === There are two scenarios: 1. You only want to build a Daisy binary distribution (= the same as can be downloaded) 2. You want to set up a development environment (= for incremental buidling and testing) The second scenario is a bit more work the first time (you need to create databases, set up configuration, ...) but once that's done you can make changes to the code, quickly rebuild and test. So this scenario is intended for people who want to work on Daisy itself. >>> If you (only) want to build a binary distribution: - first build the repository server by following the instructions in this file, skip all sections marked "[skip when building dist only]" - then build the frontend by following the instructions in applications/daisywiki/README.txt - then assemble the distribution by following the instructions in distro/core/README.txt >>> If you run into problems during the source build: - You are welcome to ask for help on the Daisy mailing list. (please mention applicable details such as Daisy version, operating system, ...) - General feedback on confusing instructions (even if you found out how to do it in the end) is also welcome. +---------------------------------------------------------------+ | Conventions | +---------------------------------------------------------------+ Throughout these instructions we use to refer to the root of the source tree. +---------------------------------------------------------------+ | Maven installation | +---------------------------------------------------------------+ Maven is the tool used to build Daisy. >> download version 1.1 from http://maven.apache.org/maven-1.x/ Note: - Maven 1.0 or Maven 2 will not work - to install Maven, just extract the download somewhere and add its bin directory to the PATH environment variable +---------------------------------------------------------------+ | Compiling | +---------------------------------------------------------------+ >> Go to >> Execute: maven Notes: - if downloading of dependencies is slow, consider using a Maven repository mirror (instead of repo1.maven.org), do this by specifying the repositories explicitely: maven -Dmaven.repo.remote=http://cocoondev.org/repository,http://repo1.maven.org/maven/ - Background info: Daisy is separated in a number of different subprojects, executing maven builds them all and put the result of them (an "artifact" jar) in your local maven repository (~/.maven/repository/) +---------------------------------------------------------------+ | Creating the MySQL database | | [skip when building dist only] | +---------------------------------------------------------------+ Required MySQL version: 4.1.7 or higher, or 5 final or higher MySQL version 4.0 and earlier will not work correctly! >> login as root user to MySQL: mysql -uroot -pYourSecretPassword (drop the -p if the root user has no password) >> on the MySQL prompt, execute: DROP DATABASE daisydev_repository; CREATE DATABASE daisydev_repository charset utf8; GRANT ALL ON daisydev_repository.* TO daisy@"%" IDENTIFIED BY "daisy"; GRANT ALL ON daisydev_repository.* TO daisy@localhost IDENTIFIED BY "daisy"; DROP DATABASE daisydev_activemq; CREATE DATABASE daisydev_activemq charset utf8; GRANT ALL ON daisydev_activemq.* TO activemq@"%" IDENTIFIED BY "activemq"; GRANT ALL ON daisydev_activemq.* TO activemq@localhost IDENTIFIED BY "activemq"; (The localhost entries are necessary because otherwise the default access rights for anonymous users @localhost will take precedence.) +---------------------------------------------------------------+ | Configuring and initializing the repository server | | [skip when building dist only] | +---------------------------------------------------------------+ >> Go to /install/target >> Execute: daisy-repository-init-dev (linux: ./daisy-repository-init-dev) Note the "-dev" suffix !!! This program will ask a number of parameters, which for a development environment you can best leave to their defaults, thus simply press enter on each question. +---------------------------------------------------------------+ | Running the Repository server | | [skip when building dist only] | +---------------------------------------------------------------+ >> Change to the directory /repository/server >> Execute: On Linux: ./start-repository On Windows: start-repository.bat Note: on Linux, if your Maven repository directory is in a non-standard location, you will have to edit the start-repository script and modify the value of the -r argument. Note: this script: - opens a debug port on port 8001 - allows JMX access using jconsole +---------------------------------------------------------------+ | Running testcases | | > optional, requires dev environment scenario | | > just FYI, not needed to do this right now | +---------------------------------------------------------------+ There is a set of automated testcasing verifying various parts of the repository functionality. For information on running these, see the file repository/test/README.txt +---------------------------------------------------------------+ | Daisy API documentation | | [skip when building dist only] | +---------------------------------------------------------------+ To view the Daisy API documentation, execute the following command in the root of the daisy source tree: maven daisy-javadoc Then you can view the javadoc by opening /target/javadoc/index.html in your browser. +---------------------------------------------------------------+ | Building and running the Cocoon-based DaisyWiki Application | +---------------------------------------------------------------+ Once you have successfully build the repository server (and in case of the development setup scenario, have also run it), you can go on to build the Daisy Wiki web fronted: See applications/daisywiki/README.txt +---------------------------------------------------------------+ | More build hints | +---------------------------------------------------------------+ Performing a clean build ------------------------ If things don't work even when starting over (e.g. errors about methods not being found etc.) doing a clean build is the solution. To do a clean build: Go to and execute maven clean What this actually does is removing all 'target' subdirectories. After doing "maven clean", perform the build in the usual way. Generating IDE project files ---------------------------- [ not perfect yet ] First build Daisy (including the Wiki), then run: For eclipse: maven eclipse:multiproject -Dmaven.multiproject.excludes=project.xml,applications/sync/**,runtime-dependencies/**,repository/project.xml,distro/** -Dmaven.eclipse.src.download=false -Dmaven.eclipse.javadoc.download=false -Dmaven.compile.target=1.5 -Dmaven.compile.source=1.5 -Dmaven.gen.src=maven.build.dir/generated-java For Intellij IDEA: maven idea:multiproject -Dmaven.idea.jdk=1.5 -Dmaven.multiproject.excludes=project.xml,applications/sync/**,runtime-dependencies/**,repository/project.xml,distro/** -Dmaven.compile.target=1.5 -Dmaven.compile.source=1.5 -Dmaven.idea.generated.source=generated-java If you are working on a subversion checkout, you can avoid the .project etc. files showing up when doing "svn status" by editing ~/.subversion/conf and adding the following to the global-ignores property: *.iml *.ipr *.iws .classpath .project .settings What to rebuild/restart when making changes ------------------------------------------- If you make changes to code used in the repository server: * execute 'maven' in * restart the repository server If you are making changes only in one specific subproject, you can also execute 'maven jar:install' in that specific subproject. If you make Java-code changes to the Wiki: * execute 'maven' in /applications/daisywiki/frontend * restart the wiki If you make resource-only (= XSLT, CSS, images, ...) changes to the Wiki: * execute 'maven deployResources' in /applications/daisywiki/frontend * restart the wiki Quick building -------------- If you are often rebuilding, you can do maven console and simply press enter to perform a build. (seems like there's a memory leak in there though, so you might want to quit from time to time)