What is settings.xml  or  Why is it needed?

Need of settings.xml for resolving dependencies in pom.xml 
[ .m2/users/settings.xml (or) maven/conf/settings.xml  ]

  • Even if you don’t have settings.xml file defined in eclipse-maven settings, still you will be able to add dependencies when working with pom.xml in eclipse project.
  • But this works for all dependencies referred from maven central repository.
  • The moment you add some dependency where the repository is different from maven central repo, you will notice an error in pom.xml saying ‘missing artifact’.
  • The reason is that now you need to define your new repo which has your dependency also.
  • So let’ create a settings.xml from scratch by referring here – https://maven.apache.org/settings.html

OR

  • Go to your location of maven – eg: D:\maven\apache-maven-3.3.9\conf  and
  • edit your settings.xml to add the new repository, and
  • refer this settings.xml under Eclipse-maven settings.