[ERROR] Error executing Maven. [ERROR] The specified user settings file does not exist: C:\Users\xxxxxx\.m2\settings.xml
1. Navigate to the directory where Maven is installed - e.g. F:\apache-maven-2.2.1. Copy the absolute path. Create a new environment variable M2_HOME and modify the PATH variable
M2_Home=F:\apache-maven-2.2.1 PATH=%M2_HOME%\bin;...
2. Create a new folder 'repository' under M2_HOME.
3. Edit the file settings.xml present under M2_HOME\conf directory. The localRepository tag element would be commented by default. Uncomment this and modify the value to point to the absolute path of the repository folder u just created ( When a jar file is referenced, Maven first looks for it in the local repository, if not found, it downloads the same from the online repository. )
F:\apache-maven-2.2.1\repository
4. Next Eclipse needs to be told the path to the local maven repository. Select Window -> Preferences. On the LHS pane of the popup, select Java -> Build Path -> Classpath Variables. Check if the value under M2_REPO is the same as the localRepository defined in settings.xml. If not, from the LHS pane, select Maven -> User Settings and change the path to the settings.xml under M2_HOME i.e. F:\apache-maven-2.2.1\conf\settings.xml
That's it.
No comments:
Post a Comment