Note
Follow these instructions carefully to setup your development environment.
For each of the applications below, make sure to use the latest release.

Install Maven

  • Download the latest version of Maven here
  • Extract to "C:\tools\maven-binaries\maven-#.#.#"

Setup the M2 directory

Create a directory in your user home directory (C:\users\USERNAME, C:\docume~1\USERNAME, or \home\USERNAME) called ".m2". On Windows you may not be able to create a directory which starts with a '.' in Windows Explorer so you will have to create it as m2 and rename it from the command prompt:

rename m2 .m2

Setup the settings.xml

  • Create a file named settings.xml in your .m2 directory using this template.
  • Replace MAVEN_USERNAME and MAVEN_ENCRYPTED_PASSWORD where appropriate with your username and an encrypted password. Instructions for encrypting your password can be found here.

Setup the metovaMobilePlugin.xml

  • Create a file named metovaMobilePlugin.xml in your .m2 directory using this template. This is for configuring the metova-maven-mobile-plugin. See Configuring the Metova Mobile Plugin for more details.
  • Update the <metovaMobilePluginSettings /> in your settings.xml to point to your .m2 directory:
    <settings>
        <profiles>
            <profile>
                ...
                <properties>
                    <metovaMobilePluginSettings>/Users/username/.m2/metovaMobilePlugin.xml</metovaMobilePluginSettings>
                </properties>
            </profile>
        </profiles>
        ...
    </settings>

Set the OS environment variables:

  • Set M2_REPO to "C:\Users\username\.m2\repository"
    Be Careful
    If you are using XP and there are spaces in your home directory use the short directory name. IE: C:\DOCUME~1\username\.m2\repository
  • Set MVN_HOME to "C:\tools\maven-binaries\maven-#.#.#"
  • Set MAVEN_OPTS to "-Djava.endorsed.dirs=%M2_REPO%/javax/xml/bind/jaxb-api/2.1"
  • Add "%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;%MVN_HOME%/bin" to the beginning of the PATH variable.

Add M2_REPO to the Eclipse classpath

  • Go to Java -> Build Path -> Classpath Variables
    • Add M2_REPO as "C:\Users\username\.m2\repository"
    • Click OK to go back to preferences

Update the Eclipse preferences

  • Go to Run/Debug -> String Substitution
    • Select New
    • Set Name to "mvn"
    • Set Value to "C:\tools\maven-binaries\maven-#.#.#\bin\mvn.bat"
  • Go to Team -> Ignored Resources
    • Add the following patterns: "jde", "target", "~*"
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© 2011 Metova, Inc.