How can I ask Maven for a list of the default repositories?

陌路散爱 提交于 2019-12-03 07:44:17

问题


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?


回答1:


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




回答2:


You can output the effective pom with the command

mvn help:effective-pom

There the default repositories are listed.




回答3:


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



回答4:


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


来源:https://stackoverflow.com/questions/2877436/how-can-i-ask-maven-for-a-list-of-the-default-repositories

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!