一、阿里云仓库
jar包搜索地址:http://maven.aliyun.com/nexus/
maven中setting.xml中<url>中的远程仓库地址:http://maven.aliyun.com/nexus/content/groups/public/
二、sonatype仓库
jar包搜索地址:https://repository.sonatype.org/
maven中setting.xml中<url>中的远程仓库地址:https://repository.sonatype.org/content/groups/public/
三、mvnrepository仓库
jar包搜索地址:http://mvnrepository.com/
四、
jar包搜索地址:http://search.maven.org/
其它maven中setting.xml中<url>中的远程仓库地址:https://repo.maven.apache.org/maven2/
中央仓库 http://repo1.maven.org/maven2 ,在中国有它的镜像仓库http://maven.net.cn/content/groups/public
共有的仓库
http://repo1.maven.org/maven2/http://repository.jboss.com/maven2/
http://repository.sonatype.org/content/groups/public/
http://mirrors.ibiblio.org/pub/mirrors/maven2/org/acegisecurity/
http://download.java.net/maven/2/
http://mvnrepository.com/
私有的仓库
http://repository.codehaus.org/
http://snapshots.repository.codehaus.org/
http://people.apache.org/repo/m2-snapshot-repository
http://people.apache.org/repo/m2-incubating-repository/
http://www.findjar.com/jar/mule/dependencies/maven2/
五、setting.xml文件
eclipse中选window--》preferences---》maven----》User settings点击open file 如果没有文件则在对应的目录创建settings.xml文件讲下面的内容复制到文件里然后点检Update Settings再点apply and close重启
<?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <pluginGroups> </pluginGroups> <proxies> </proxies> <servers> </servers> <mirrors> <mirror> <id>alimaven</id> <name>aliyun maven</name> <url>https://repository.sonatype.org/content/groups/public/</url> <!--http://maven.aliyun.com/nexus/content/groups/public/--> <mirrorOf>central</mirrorOf> <!--表明为central中央仓库配置镜像仓库--> </mirror> </mirrors> <profiles> </profiles> <activeProfiles> </activeProfiles> </settings>
<?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <mirrors> <mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>central</id> <name>Maven Repository Switchboard</name> <url>http://repo1.maven.org/maven2/</url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>repo2</id> <mirrorOf>central</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://repo2.maven.org/maven2/</url> </mirror> <mirror> <id>ibiblio</id> <mirrorOf>central</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url> </mirror> <mirror> <id>jboss-public-repository-group</id> <mirrorOf>central</mirrorOf> <name>JBoss Public Repository Group</name> <url>http://repository.jboss.org/nexus/content/groups/public</url> </mirror> <!-- 中央仓库在中国的镜像 --> <mirror> <id>maven.net.cn</id> <name>oneof the central mirrors in china</name> <url>http://maven.net.cn/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors> </settings>
引申
java项目中的pom.xml可以覆盖如上的远程仓库配置。如下实例
<repositories> <repository> <!-- Maven 自带的中央仓库使用的Id为central 如果其他的仓库声明也是用该Id 就会覆盖中央仓库的配置 --> <id>mvnrepository</id> <name>mvnrepository</name> <url>http://www.mvnrepository.com/</url> <layout>default</layout> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories>