eclipse - Eclipse中的Maven插件-缺少Settings.xml文件

标签 eclipse maven m2eclipse maven-3

我为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/

相关文章:

c++ - 将代码生成与 Eclipse C++ 构建集成

android - Eclipse/ADT 给出数百个错误 "resource entry is already defined"

java - "mvn clean install"和 "mvn clean verify install"有什么区别?

java - Maven 添加生成的文件夹(使用 Maven 插件)作为源文件夹,IntelliJ 无法识别

java - Maven 和单元测试 - 结合 Maven Surefire 插件和 testNG Eclipse 插件

android - 单击 ListAdapter 中的项目不会执行任何操作

java - Tomcat & Spring Web - 找不到类异常 org.springframework.web.context.ContextLoaderListener

java - SLF4J:没有Binder,然后多次绑定(bind),试图绑定(bind)到Log4J

java - 使用maven的java项目运行时出现NoClassDefFoundError

maven - 我应该在我的 pom.xml 中编写存储库吗?