Setting up AndoMDA Environment ( Fixing Maven Repository )

Install Maven

Maven a tool used for building and deploying applications generated by AndroMDA. Based on the concept
of a project object model (POM), Maven can manage a project's build, reporting,
and documentation from a central piece of information. Install Maven by following
the steps below:

Click here to
point your browser to the Maven download page. Download the file called maven-2.0.5-bin.zip.

Unzip this file at C:\Program Files\Apache Software Foundation. A directory
called maven-2.0.5 will be created which contains the Maven program.

Setting up Maven environment variables

Set M2_HOME, and M2_REPO up like JAVA_HOME

Property

Value

M2_HOME

Maven installation directory, e.g. /home/aabdelaziz/maven-2.0.5

M2_REPO

Maven local repository, e.g. /home/aabdelaziz/.m2/repository

MAVEN_OPTS

Parameters to pass to the Java VM when running Maven. Set this value to: -XX:MaxPermSize=128m
-Xmx512m (required to build large Maven projects)

PATH

This makes sure the system will search for console commands in the directories listed
here. If this property already exists you should simply add $M2_HOME/bin

Test Maven and create a local repository

Open a Command Prompt and change the current directory to any temporary directory,
such as C:\temp.

Execute the following command to make sure you can run Maven:

mvn --version

Maven should display the following output:

Maven version: 2.0.5.

Now execute the following command to create a temporary project:

mvn archetype:create -DgroupId=testapp -DartifactId=testapp

Make sure that you get a BUILD SUCCESSFUL message at the end. Sometimes
due to bad Internet connectivity, Maven may not be able to download all dependencies.
If your build fails due to this reason, try to issue the command again until you
get a successful build.

Verify that Maven created a temporary project called testapp in the
current directory and also a local repository at the default location mentioned
above. If both these results are achieved successfully, you can delete the temporary
project that was just created.

Install AndroMDA Application plugin

Next we will download and install the AndroMDA Application plugin into your Maven
repository. This plugin allows creation of Java starter applications that use AndroMDA.
This is the only AndroMDA artifact that we will install explicitly. All other artifacts,
such as AndroMDA cartridges, will be automatically downloaded by the Maven scripts
generated by the plugin. Install the plugin by following the steps below.