Repositories in Maven

Maven searches for artifacts in 3 repositories.
  • Local ( userHomeDirectory/.m2/repository )
  • Central (
  • Remote repositories (if any specified)
When you first time build your project, maven downloads all required artifacts from central and remote repositories and stores them in local repository. So in subsequent builds, maven uses artifacts stored in local repository. From where maven gets that artifact? Well- the answer is simple. Maven stores all popular artifacts at central location (also called as maven central repository) The url is and it is maintained by You can also search for artifacts at So what if certain artifact is not there on central repository? In that scenario, maven will throw error saying

could not find the artifact.
[ERROR] Failed to execute goal on project xyz: Could not resolve 
dependencies for project xyz:jar:1.0-SNAPSHOT: Could not find artifact 
org.seleniumhq.selenium:selenium-java1:jar:2.52.0 in repository1
But if that artifact is available in different repository, you can add that repository in POM file using repository tag so that maven will search there. Please note that you can also add repositories in settings.xml file

Web development and Automation testing

solutions delivered!!