Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Read the Guide to Building Maven.
  2. Read Getting Started with Maven.
  3. For your convenience, here is a script getting you up and running on Unix/Linux/Mac OS with the trunk. You need to have Ant and Subversion installed.
No Format
#!/bin/bash
which java 1>/dev/null 2>&1
if [[ $? != 0 ]]; then
    echo "Could not find java executable. Please install and add it to your PATH"
    exit 1
fi

which ant 1>/dev/null 2>&1
if [[ $? != 0 ]]; then
    echo "Could not find ant executable. Please install and add it to your PATH"
    exit 1
fi

if [[ ! -d "maven-dev/.svn" ]]; then
    svn co https://svn.apache.org/repos/asf/maven/trunks maven-dev
    if [[ $? != 0 ]]; then
        echo "Error checking out Maven source code"
        exit 1
    fi
fi

dir="$PWD"

cd "maven-dev/components"

if [ -e "$M2_HOME" ]; then
    version=$(cat pom.xml|sed -e "/<parent>/,/<\/parent>/ d"|grep -m1 "<version>"|sed -e "s/ *<version>\(.*\)<\/version> */\1/g")
    export M2_HOME="$dir/target/maven-$version"
fi

mkdir -p "$M2_HOME"
echo "Using M2_HOME=$M2_HOME"

ant
if [[ $? != 0 ]]; then
    echo "Error building Maven"
    exit 1
fi

echo "Done. You might want to set the following variables:"
echo "export M2_HOME=$M2_HOME"
echo "export PATH=$M2_HOME/bin:$PATH"

...