32

What command can I use to ask Maven for a list of the default repositories that it searches for its dependencies? If no such command exists, where else may I look to find this default list?

Sean Patrick Floyd
  • 292,901
  • 67
  • 465
  • 588
Derek Mahar
  • 27,608
  • 43
  • 124
  • 174

4 Answers4

43

on the command line, execute

mvn help:evaluate

then, when prompted, enter

${project.repositories}

see http://maven.apache.org/plugins/maven-help-plugin/evaluate-mojo.html

Sean Patrick Floyd
  • 292,901
  • 67
  • 465
  • 588
11

You can output the effective pom with the command

mvn help:effective-pom

There the default repositories are listed.

tangens
  • 39,095
  • 19
  • 120
  • 139
7

Use the Maven Dependency Plugin to show repositories for a specific build:

mvn dependency:list-repositories

or the full path, if you still use a very old version (<2.2)

mvn org.apache.maven.plugins:maven-dependency-plugin:2.6:list-repositories
Adrian
  • 2,233
  • 1
  • 22
  • 33
  • 7
    Note that this won't work if you can't get past `validate`, which is likely to be why you're trying to debug the repositories in the first place. – OrangeDog Oct 24 '16 at 13:50
  • Moreover, the `dependency:list-repositories` goal will list ALL the repositories used by the entire dependency tree, not only the repositories visible by the POM file. – Gabriel Petrovay Apr 07 '20 at 23:43
2

As a side-effect of displaying newer versions, the versions:display-dependency-updates goal of the Versions Maven Plugin also displays the names of the repositories that it searches. To display the newer versions and the repository names, run

mvn versions:display-dependency-updates
Adrian
  • 2,233
  • 1
  • 22
  • 33
Derek Mahar
  • 27,608
  • 43
  • 124
  • 174