我为Eclipse安装了Maven插件。然后尝试更新索引并得到以下错误:
无法更新中央索引| http://repo1.maven.org/maven2
尝试通过Windows-preferences-maven-user设置编辑代理设置时,我意识到没有这样的文件。我没有单独的Maven安装,只有插件。请有人可以帮助解决问题吗?非常感谢你。
干杯
一种
配置:Helios Service Release 1
org.maven.ide.eclipse.feature(0.12.0.20101115-1102)“Eclipse的Maven集成”
最佳答案
设置文件永远不会自动创建,无论您使用嵌入式还是“真实” Maven,都必须自己创建。
在以下位置创建它<your home folder>/.m2/settings.xml
例如在Windows上为C:\Users\YourUserName\.m2\settings.xml
,在Linux上为/home/YourUserName/.m2/settings.xml
您可以使用以下空骨架:
<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>
如果使用Eclipse编辑它,它将在编辑时自动完成。
这是Maven settings.xml Reference page
关于eclipse - Eclipse中的Maven插件-缺少Settings.xml文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4626609/