Reputation: 2591
I have been using maven in eclipse (with m2e) just fine, until recently when I renamed one of the folders on my hard drive where maven is installed.
The folder was renamed from Computer local
to ComputerLocal
After renaming the folder I received the following error in eclipse when I attempted to do a maven build:
Can't find Maven installation C:\Computer local\apache-maven-3.0.4
Which of course makes perfect sense.
The problem is that when I re-named the folder on the installation directory path back to it's original name I kept receiving the same error as before:
Can't find Maven installation C:\Computer local\apache-maven-3.0.4
When I copy-past the directory path from the error into a explorer window it finds the directory just fine.
So what I'd really like to know is where can I find the configuration in eclipse where I can see path to the maven installation that is being used? Perhaps from there I can re-set it or re-configure it?
Upvotes: 0
Views: 5804
Reputation: 97
"Can't find Maven installation EMBEDDED" means it is that you are facing the issue with your eclipse version.
You just need to restart the and Check your eclipse settings Windows-->Preferences-->Maven-->Installations You can find the Embedded version of Maven.
This can be done by selecting your project and setting up with few goals in "Runtime Configurations" and few settings for Java and Environemnt Variables.
Right clicking on your parent POM file.
Select "Run As"-->"Maven Build"
In the Run Configurations window,
a) Enter project name, b) select your parent-project, c) provide some goals eg., clean install
Choose your External Maven from the dropdown. If you can not find your External Maven (other than embedded maven), Clicking on Configure and click on Add button and add your maven home location folder.
Setup your environmental variables with variable M2_HOME to your maven home location folder and also set PATH variable to %M2_HOME%\bin
In Eclipse, goto Window-> Preference -> Java -> Installed JREs -> Edit and pass VM Arguments as -Dmaven.multiModuleProjectDirectory=M2_HOME for windows and -Dmaven.multiModuleProjectDirectory=$M2_HOME for Linux and Mac OS X.
For versions Maven 3.x, and above, the variable can also be named as $MAVEN_HOME. -Dmaven.multiModuleProjectDirectory=MAVEN_HOME for Windows -Dmaven.multiModuleProjectDirectory=$MAVEN_HOME for Linux and Mac OS X
However, It is better to use M2_HOME as it supports for both Maven 2 and 3.
Upvotes: 1