简体   繁体   中英

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. The effective POM still has

  <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

  <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 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

By default your settings.xml is being looked up in:

  • The Maven install: $M2_HOME/conf/settings.xml
  • A user's install: ${user.home}/.m2/settings.xml

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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