0

Have a few Maven projects in our environment, and currently it is downloading the required dependencies mentioned in the pom.xml file from Maven central.

I was trying to figure out where the URL for Maven central is provided in pom file or project level, and unable to find out. I thought it could be in settings.xml, and found the below script:

  <pluginRepository>
      <id>central</id>
      <url>http://central</url>
       <releases>
          <enabled>true</enabled>
       </releases>
       <snapshots>
          <enabled>false</enabled>
       </snapshots>
  </pluginRepository>

Can someone provide inputs on the details of providing the Maven central URL in project/pom file level or where do we mention it ? Thanks !

Kivi
  • 485
  • 1
  • 9
  • 26

1 Answers1

0

It is defined by maven core, more accurate in maven-model-builder (so called super pom).

If you like to change that which means usually to redirect everything via an internal repository manager the way to go is via the user settings.xml see for details: https://maven.apache.org/settings.html

The user settings is located in users home directory $HOME/.m2/settings.xml.

You should prevent to define repositories in pom.xml files, because it happens that the location of such repositories (repo managers) may change which would result in pom.xml which can not being built anymore after a time.

khmarbaise
  • 92,914
  • 28
  • 189
  • 235