mvn --version -Dmaven.multiModuleProjectDirectory system propery is not set

I have downloaded and installed maven3.3.3. on uBuntu 14.04 and when I run the command

mvn --version

I get this error

-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME `enter code here`environment variable and mvn script match.

I have tries to set the enviroment in /etc/environment

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/apache-maven-3.3.3/bin"
JAVA_HOME="/usr/lib/jvm/java-8-oracle/jre"
MAVEN_OPTS="-Xms1024m -Xmx2048m -Dmaven.surefire.debug=-Xmx2048m -XX:MaxPermSize=128m"
M2_HOME="/opt/apache-maven-3.3.3"

your help will be greatly appreciated

G

3

1 Answer

In a terminal

./mvn -Dmaven.multiModuleProjectDirectory=$M2_HOME --version

In Eclipse

Window > Preferences > Java > Installed JREs > Edit

Add the line below into Default VM arguments

-Dmaven.multiModuleProjectDirectory=$M2_HOME

Per default, there is nothing to do:

cd
wget
tar xf apache-maven-3.3.3-bin.tar.gz
cd apache-maven-3.3.3/bin
./mvn --version

Example output

$ ./mvn --version
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T13:57:37+02:00)
Maven home: /home/aboettger/Downloads/apache-maven-3.3.3
Java version: 1.7.0_79, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-i386/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "linux", version: "3.19.0-21-generic", arch: "i386", family: "unix"

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like