Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven plugin in Eclipse - Settings.xml file is missing

I installed the maven plugin for eclipse. Then tried updating the index and got the following error:

Unable to update index for central|http://repo1.maven.org/maven2

While trying to edit the proxy settings through windows-preferences-maven-user settings, I realise there is no such file. I don't have separate maven installation and only the plugin. Please someone could help resolving the problem? Thank you very much.

Cheers A

Config: Helios Service Release 1 org.maven.ide.eclipse.feature (0.12.0.20101115-1102) "Maven Integration for Eclipse"

like image 470
emeralddove Avatar asked Jan 07 '11 14:01

emeralddove


People also ask

Where is my Maven settings xml file?

The Maven settings file, settings. xml , is usually kept in the . m2 directory inside your home directory.

Where is settings xml in Eclipse?

Open your Eclipse and navigate to Window -> Preferences. Click on the Browse button of User Settings( or Global Settings), and select the settings. xml. Click on the “Update Settings” to update the maven settings.


1 Answers

The settings file is never created automatically, you must create it yourself, whether you use embedded or "real" maven.

Create it at the following location <your home folder>/.m2/settings.xml e.g. C:\Users\YourUserName\.m2\settings.xml on Windows or /home/YourUserName/.m2/settings.xml on Linux

Here's an empty skeleton you can use:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0                       http://maven.apache.org/xsd/settings-1.0.0.xsd">   <localRepository/>   <interactiveMode/>   <usePluginRegistry/>   <offline/>   <pluginGroups/>   <servers/>   <mirrors/>   <proxies/>   <profiles/>   <activeProfiles/> </settings> 

If you use Eclipse to edit it, it will give you auto-completion when editing it.

And here's the Maven settings.xml Reference page

like image 168
Sean Patrick Floyd Avatar answered Sep 19 '22 04:09

Sean Patrick Floyd