Chapter 2 Install the XMA Development Environment

XMA applications are built by Ant scripts, but its library dependencies are managed by Maven. This is done by the use of Ant Tasks for Maven. All XMA libraries itself are deployed to a Maven 2 repository. An openXMA project's dependencies are described in a pom.xml in the project's root directory. For are short introduction to the Maven dependency mechanism see: http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

For starting XMA development, you need the following tools installed on your workstation:

  • Java SDK 1.4.2 or newer.

  • XMA-BootRuntime

    You need to install an XMA-BootRuntime for running openXMA applications, even when they are started from Eclipse. For XMA-BootRuntime installation issues see: XMA Boot-Runtime Installation

  • Eclipse IDE 3.2.2 (the IDE for openXMA).

    You need exactly this version, since the XMA plugins are not ported yet to newer versions. It can be found here: http://archive.eclipse.org/eclipse/downloads/index.php

  • Eclipse EMF Runtime 2.2.2 or newer (needed for the openXMA Eclipse plugins).

    It can be found here: http://archive.eclipse.org/modeling/emf/emf/downloads/drops/2.2.2/R200702131851/.

    Note: If you load the openXMA Eclipse plugins by their update site the EMF Runtime 2.2.2 is loaded as dependency by the Eclipse update mechanism automatically.

  • openXMA Eclipse plugins (needed for openXMA application design)

    The openXMA plugins can be get via an Eclipse plugin update site: http://dist.codehaus.org/openxma/eclipse_plugins/update_site/.

    If you prefer manual installation then the openXMA plugins can be downloaded from: openXMA plugins distribution. I

  • Tomcat 4.1.30 or newer (for local openXMA application testing).

    For the automatic deployment of XMA applications you have to configure a user in the role manager. This can be done by adding the following line into your tomcat conf/tomcat-users.xml file

    <user username="admin" password="admin" roles="admin,manager"/>

  • Ant

    Apache Ant is needed to run the build.xml scripts. It usually comes installed within Eclipse.

  • Maven 2

    Be aware, when installing Maven, that some environment variables have to be set (M2_HOME, M2, JAVA_HOME, add Maven to PATH).

    Also in the M2_HOME/conf/settings.xml file you have to do some configurations, for example you should set your local repository location (otherwise it is created under your user directory), e.g.:

    <localRepository>yourPath/.m2/repository</localRepository> 

    For Maven details, see the Maven documentation:

    http://maven.apache.org/download.html (Maven installation)

    http://maven.apache.org/settings.html (Maven settings)

  • Ant Tasks for Maven 2

    Copy maven-ant-tasks-2.0.8.jar to M2_HOME/lib. This version can be downloaded from the Maven Central repository: maven-ant-tasks-2.0.8.jar

  • Eclipse Adaption for Maven (see the original documentation at maven-eclipse-plugin)

    Eclipse must have the classpath variable M2_REPO pointing to the local maven repository. This is done executing this command from the command line (restart Eclipse afterward):

    mvn -Declipse.workspace=<path-to-eclipse-workspace> eclipse:add-maven-repo

    From the Eclipse menu bar, select Window > Preferences. Select the Run/Debug > String Substitution. Add a new variable maven_exec=<M2_HOME>\bin\mvn.bat

    An openXMA Eclipse project normally use the Maven Eclipse Plugin for managing the project's .classpath and .project file, which are created from the project's pom.xml. To update the .classpath and .project file from the pom.xml you can run this command from the project directory:

    mvn eclipse:eclipse

    As such a command might be cumbersome to issue from the command line, every openXMA project has a launch script to do this. This is started by Menu Bar > Run > External Tools > Select launch script.These scripts are named <projectname> mvn eclipse_eclipse.launch.

  • Eclipse Adaption for Tomcat launching

    Each openXMA project comes with a generated script to start a tomcat server instance called start_<projectName>Server. If you use this script to start Tomcat you have to set two variables pointing to your Tomcat installation:

    • TOMCAT_HOME - as Eclipse classpath variable (Window > Preferences. Java > Build Path >Classpath Variable > New)

    • TOMCAT_HOME - as Eclipse string substitution variable (Window > Preferences. Run/Debug > String Substitution > New)

    Alternatively to starting the Tomcat by the project's server launch script and deploying new versions to Tomcat by the project's build.xml you can use the Tomcat Eclipse plugin. See the documentation there for details.

  • Subclipse

    If you want to check out sources from the openXMA repository (e.g. the openXMA sample application) you need some Subversion client. For Eclipse Subclipse is available as plugin, see the documentation there for details.

For developing openXMA applications several Eclipse plugins are needed. The openXMA plugins can be get via an Eclipse plugin update site: http://dist.codehaus.org/openxma/eclipse_plugins/update_site/

If you prefer manual installation then the openXMA plugins can be downloaded from: openXMA plugins distribution. In this case please extract all the zipped plugins into your Eclipse plugin directory (normally "plugins" in your Eclipse base directory where your Eclipse executable is).

In detail these 3 plugins are used:

  • at.spardat.xma.guidesigner - for creating the components and pages of an openXMA application

  • at.spardat.xma.mapper - for mapping JavaBeans attributes to openXMA GUI elements

  • at.spardat.xma.prjcreationwizzard - for creating an openXMA Eclipse project