Eclipse中的Maven插件 - Settings.xml文件丢失 [英] Maven plugin in Eclipse - Settings.xml file is missing
问题描述
我安装了eclipse的maven插件。然后尝试更新索引并收到以下错误:
无法更新中心的索引| http://repo1.maven.org/maven2
在尝试通过Windows-preferences-maven-user设置编辑代理设置时,我意识到没有这样的文件。我没有单独的maven安装,只有插件。有人可以帮忙解决问题吗?非常感谢。
Cheers
A
配置:Helios服务版本1
org.maven.ide.eclipse.feature(0.12.0.20101115-1102)Maven Integration for Eclipse
设置文件永远不会自动创建,您必须自己创建,无论是使用嵌入式还是真实maven。
在以下位置创建文件 ;你的主文件夹> /。m2 / settings.xml
eg在Windows上的 C:\Users\YourUserName\.m2\settings.xml
/home/YourUserName/.m2/settings.xml在Linux上
这是一个可以使用的空骨架:
< 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 />
<代理/>
< profiles />
< activeProfiles />
< / settings>
如果您使用Eclipse进行编辑,则会在编辑时自动完成。 p>
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"
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
这篇关于Eclipse中的Maven插件 - Settings.xml文件丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!