Dashboard > Community Wiki > ... > Developing with Magnolia > Introduction to building Magnolia
Introduction to building Magnolia Log In View a printable version of the current page.

Added by Grégory Joseph , last edited by Grégory Joseph on Aug 28, 2008  (view change)
Labels: 

Building Magnolia

A simple mvn clean install from the root of the project will be Magnolia. The final artifact will be magnolia-empty-webapp-x.y.z.war, which is the skeleton webapp projects can use to build Magnolia site. Note that it does not contain the DMS nor the workflow modules.

Maven and Eclipse (Magnolia module dependencies issues)

mvn eclipse:eclise excludes the magnolia module descriptors form the resources: META-INF/magnolia/*

This leads to startup error messages similar to this:

ERROR  info.magnolia.cms.beans.config.ModuleRegistration
ModuleRegistration.java(checkDependency:237) 26.09.2007 20:19:57
missing dependency: module \[dms\] needs \[adminInterface\]

You have to fix that manually by going to Project Properties --> Build Path of each module and then deleting the exclusion.
Else the Magnolia module descriptor is missed and the deployed code/jar is not recognized.

Building Magnolia 3.5 with support for Eclipse WTP

See also Developer information
See below for building 3.0 and 2.1

Requirements:

  • Java 1.5
  • Maven 2.0.9
  • Eclipse 3.2
  • WTP 1.5
  • Tomcat 5.5
    Maybe older versions will work too, but this has worked for me...
  • Java 5 is required for building. The reason is we use it for unit tests.
    This has no impact on production code, which is compiled for Java 1.4.
    See the main pom.xml for details on how this is done.

1. Clean up old traces

% rm -r ~/.m2

2. Check out Magnolia trunk

% svn checkout http://svn.magnolia.info/svn/magnolia/trunk/
rename it:
% mv trunk magnolia-trunk
Do this on the command line, not in Eclipse. If you do it in Eclipse, you'll end up with one big project with subfolders for each module. Eclipse WTP the will not recognize that the "magnolia" subfolder is a Dynamic Web Project.

3. Add the dms module

check it out
% svn checkout http://svn.magnolia.info/svn/modules/community/magnolia-module-dms/trunk/
rename it and move it to the magnolia-trunk folder
% mv trunk magnolia-trunk/magnolia-module-dms

4. Turn it into an Eclipse WTP project

% cd magnolia-trunk
% mvn -P webapp eclipse:eclipse -Dwtpversion=1.5

5. Install JCR

% mvn install:install-file -DgroupId=javax.jcr -DartifactId=jcr -Dversion=1.0 -Dpackaging=jar -Dfile=/path/to/jcr.jar

6. Do the eclipse stuff again

% mvn eclipse:eclipse -Dwtpversion=1.5
This seems to be necessary according to http://www.mail-archive.com/user-list@magnolia.info/msg05425.html

7. Import it into Eclipse

  • Add a classpath variable "M2_REPO" pointing to your .m2 folder (Windows > Preference > Java > Build Path > Classpath Variable)
  • In the "Project Explorer" view right-click in the empty space and select Import > Import...
  • In the Import window select General > Existing Projects into Workspace
  • Select your magnolia-trunk root directory
  • Hit "Finish"

8. Replace project variables (${project.version}, maybe others...?)

  • Go into the magnolia directory, do % mvn resources:resources
  • Go into the dms module directory, do mvn resources:resources
  • Open eclipse and refresh the workspace

9. Add it to the server

Assuming that you've set up your server (see WTP tutorials for info) control-click on the server and select "Add and Remove Projects...". You should be able to select the "magnolia" project and add it. Check if the dms module is included, if it's not, go in the properties of the magnolia project in the J2EE module dependency, tick the checkbox of the dms module.

10. Start the server

This will take a long time since magnolia is bootstrapping. When the server is running, you'll need to restart it. Afterwards, you should be able to access Magnolia here:
http://127.0.0.1:8080/magnolia
(Assuming that you're server is running on port 8080)


Building Magnolia 3.0

See also Developer information, http://magnolia.sourceforge.net/22/developer/eclipseWTP.html

Requires maven 2, WTP 1.0 and Eclipse 3.1.

Step 1

Do a clean checkout of

into a dir like

magnolia-all/

Step 2

Go into magnolia-all/magnolia-project/ and run

mvn install

Note: There is no magnolia-project in the current trunk (April 2007). I guess this folder is simply called magnolia now.

If you don't want to run the project from within Eclipse, stop here.

Step 3

Wait till the build is successfull. Then inside the same dir, run

mvn eclipse:eclipse

Wait till the build is successful.

Step 4

Start eclipse, register your tomcat installation. Dedicate at least
256MB memory to the tomcat in the server config.

Make sure that you aren't running any other tomcat on port 8080 locally.

Set the variable M2_REPO to refer to your maven repository directory (typically in $HOME/.m2/repository).

In Eclipse 3.2

  • Window -> Preferences
  • Then Java -> Build Path -> Classpath
  • Create the M2_REPO variable heree.

Step 5

Import projects. Choose the dir magnolia-all/ and import all the projects inside.

Wait till eclipse has built all the projects successfully.

Step 5

Right click on the magnolia-all/magnolia project (the webapp project)
and Run As.. on server.

Wait atleast 10 minutes while the installation is bootstrapping.

Verify that the bootstrapping and setup went well. Keep an eye on the logs.

Step 6

Browse away on http://localhost:8080/magnolia


Building Magnolia 2.1

Any Development environment

Magnolia can now easily be built using maven (the "official" magnolia build system):

Also see the official Magnolia documentation http://magnolia.sourceforge.net/install/build.html

Eclipse WTP

Source code from version control

If you are using Eclipse WTP as your IDE, you can follow the instructions from the official Magnolia documentation http://magnolia.sourceforge.net/developer/eclipseWTP.html

Note: These instructions only seem to work with Maven 1.0.2 and Eclipse WTP 0.7.

Source code zipped download

If you downloaded a source archive from sourceforge:

  1. unzip it
  2. run maven eclipse
  3. register the MAVEN_REPO variable in Eclipse as described in the docs
  4. import the unzipped folder as an existing project
  5. Register a Tomcat Server as described

Some extra (unverified) notes for linux users:

  • make sure to remove any gcj binding (as root do) :
  1. rm /usr/bin/java*
  • make sure to set your JAVA_HOME correctly

$ export JAVA_HOME=/path/to/your/java

  • the maven build process will call the 'java' command so you have
    to make sure that your PATH points to the right 'java'

$ export PATH=$PATH:$JAVA_HOME/bin/

(you have to make sure there's no other 'java_home bin' in your PATH)

In its previous incarnation on JspWiki, this page was last edited on Nov 20, 2007 10:59:10 AM by GregoryJoseph
Other known authors include :

  • AndreasWeder
  • MarkusStrickler
  • FerrisNicolaisen
  • AlainHoang
  • Kmilev
  • Magnolia
  • Olli
  • OrtwinGlueck

maven 2.0.9 is required to build the magnolia project

Thanks Ruben, I edited this - note however that most of the information here needs a serious review, I am not sure how up to date it is.

Powered by a free Atlassian Confluence Open Source Project License granted to Magnolia International. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators