设置Maven中央仓库 国内镜像 [本地仓库]
2017-10-18 00:50
549 查看
https://www.iteblog.com/archives/2022.html
实测可行,,
然后使用Maven编译你的代码,这时候Maven会从阿里云上面下载Jar依赖,速度明显要比默认的快多了!
替换上最上面阿里云Maven仓库地址即可。以下的地址也可以使用:
实测可行,,
ali maven仓库
找到 .m2文件夹,新建文件settings.xml,粘贴复制以下代码C:\Users\当前计算机用户名\.m2
<?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"> <localRepository>D:\XXXXXX\_maven_repository_</localRepository> <!-- 本地仓库地址,可存放于非C盘 --> <pluginGroups> <pluginGroup>org.mortbay.jetty</pluginGroup> </pluginGroups> <proxies> </proxies> <servers> <server> <id>releases</id> <username>ali</username> <password>ali</password> </server> <server> <id>Snapshots</id> <username>ali</username> <password>ali</password> </server> </servers> <mirrors> <mirror> <!--This sends everything else to /public --> <id>nexus</id> <mirrorOf>*</mirrorOf> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> </mirror> <mirror> <!--This is used to direct the public snapshots repo in the profile below over to a different nexus group --> <id>nexus-public-snapshots</id> <mirrorOf>public-snapshots</mirrorOf> <url>http://maven.aliyun.com/nexus/content/repositories/snapshots/</url> </mirror> </mirrors> <profiles> <profile> <id>development</id> <repositories> <repository> <id>central</id> <url>http://central</url> <releases> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>central</id> <url>http://central</url> <releases> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </pluginRepository> </pluginRepositories> </profile> <profile> <!--this profile will allow snapshots to be searched when activated--> <id>public-snapshots</id> <repositories> <repository> <id>public-snapshots</id> <url>http://public-snapshots</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>public-snapshots</id> <url>http://public-snapshots</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> <activeProfiles> <activeProfile>development</activeProfile> <activeProfile>public-snapshots</activeProfile> </activeProfiles> </settings>
然后使用Maven编译你的代码,这时候Maven会从阿里云上面下载Jar依赖,速度明显要比默认的快多了!
其他Maven仓库
我们还可以设置以下的Maven仓库地址,如下:<mirrors> <mirror> <id>wso2maven</id> <name>wso2 maven</name> <url>http://maven.wso2.org/nexus/content/groups/public/</url> <mirrorof>central</mirrorof> </mirror> </mirrors>
替换上最上面阿里云Maven仓库地址即可。以下的地址也可以使用:
http://maven.wso2.org/nexus/content/groups/public/ http://jcenter.bintray.com/ http://maven.antelink.com/content/repositories/central/ http://maven.springframework.org/release/ http://maven.antelink.com/content/repositories/central/ http://mavensync.zkoss.org/maven2/ http://repository.jboss.com/maven2/ http://maven.aliyun.com/nexus/content/groups/public http://uk.maven.org/maven2/ http://repo1.maven.org/maven2/ http://maven.springframework.org/milestone http://maven.jeecg.org/nexus/content/repositories/ https://repository.apache.org/content/groups/public/ https://repository.jboss.org/nexus/content/repositories/releases/ http://repo.maven.apache.org/maven2 https://oss.sonatype.org/content/repositories http://repo.spring.io/release/ http://repo.spring.io/snapshot/[/code]
end
相关文章推荐
- maven设置本地仓库地址和设置国内镜像
- maven 阿里云 国内镜像 中央仓库 亲测可用
- Maven 本地仓库,远程仓库,中央仓库,Nexus私服,镜像 详解
- maven本地仓库和国内镜像的配置
- Maven settings.xml配置(指定本地仓库、阿里云镜像设置)
- maven+阿里云创建国内镜像的中央仓库(亲测可用)
- maven 阿里云 国内镜像 中央仓库 亲测可用
- maven 阿里云 国内镜像 中央仓库
- maven 阿里云 国内镜像 中央仓库 亲测可用
- maven国内快速镜像,国内maven中央仓库地址
- maven 阿里云 国内镜像 中央仓库 亲测可用
- Maven下载、配置、目录结构、代理、本地仓库、中央仓库、远程仓库、镜像
- maven 阿里云 国内镜像 中央仓库 亲测可用
- maven国内快速镜像,国内maven中央仓库地址
- Maven阿里云国内镜像中央仓库(亲测可用)
- 阿里云提供的maven中央仓库镜像设置
- MAVEN设置本地仓库
- maven如何修改本地仓库与中央仓库
- 设置Maven的本地仓库与远程仓库
- maven连接国内仓库setting设置