简体   繁体   English

为什么Eclipse / Maven项目没有从settings.xml中获取值?

[英]Why is Eclipse/Maven project not picking up the values from settings.xml?

I have saved the configuration at the bottom in c:\\users\\username\\.m2\\settings.xml but pom.xml created as part of Maven Project in Eclipse is not picking up the values. 我将配置保存在c:\\ users \\ username \\ .m2 \\ settings.xml的底部,但是在Eclipse中作为Maven Project的一部分创建的pom.xml并没有获取这些值。 The effective POM still has 有效的POM仍然有

  <repositories>  
    <repository>  
      <snapshots>  
        <enabled>false</enabled>  
      </snapshots>  
      <id>central</id>  
      <name>Maven Repository Switchboard</name>  
      <url>http://repo1.maven.org/maven2</url>  
    </repository>  
  </repositories>  

And what should be the http://ebr.springsource.com/respository equivalent of 什么是http://ebr.springsource.com/respository等价的

  <pluginRepositories>  
    <pluginRepository>  
      <releases>  
        <updatePolicy>never</updatePolicy>  
      </releases>  
      <snapshots>  
        <enabled>false</enabled>  
      </snapshots>  
      <id>central</id>  
      <name>Maven Plugin Repository</name>  
      <url>http://repo1.maven.org/maven2</url>  
    </pluginRepository>  
  </pluginRepositories>  

settings.xml 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">  
  <repositories>  
      <repository>  
        <id>com.springsource.repository.bundles.release</id>  
        <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>  
        <url>http://repository.springsource.com/maven/bundles/release</url>  
      </repository>  

      <repository>  
        <id>com.springsource.repository.bundles.external</id>  
        <name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>  
        <url>http://repository.springsource.com/maven/bundles/external</url>  
      </repository>  
  </repositories>  
</settings>  

you should add it to the home folder of the user who executes mvn command 您应该将其添加到执行mvn命令的用户的主文件夹中

By default your settings.xml is being looked up in: 默认情况下,正在以下位置查找您的settings.xml:

  • The Maven install: $M2_HOME/conf/settings.xml Maven安装:$ M2_HOME / conf / settings.xml
  • A user's install: ${user.home}/.m2/settings.xml 用户的安装:$ {user.home} /。m2 / settings.xml

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM