概述
Maven
在用户目录下打开.m2目录,新建settings.xml文件,内容填写如下
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 http://maven.apache.org/xsd/settings-1.2.0.xsd">
<mirrors>
<mirror>
<id>alimaven-central</id>
<name>alimaven-central</name>
<url>https://maven.aliyun.com/repository/central</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>alimaven-public</id>
<name>alimaven-public</name>
<url>https://maven.aliyun.com/repository/public</url>
<mirrorOf>public</mirrorOf>
</mirror>
<mirror>
<id>alimaven-google</id>
<name>alimaven-google</name>
<url>https://maven.aliyun.com/repository/google</url>
<mirrorOf>google</mirrorOf>
</mirror>
<mirror>
<id>alimaven-gradle-plugin</id>
<name>alimaven-gradle-plugin</name>
<url>https://maven.aliyun.com/repository/gradle-plugin</url>
<mirrorOf>gradle-plugin</mirrorOf>
</mirror>
<mirror>
<id>alimaven-spring</id>
<name>alimaven-spring</name>
<url>https://maven.aliyun.com/repository/spring</url>
<mirrorOf>spring</mirrorOf>
</mirror>
<mirror>
<id>alimaven-spring-plugin</id>
<name>alimaven-spring-plugin</name>
<url>https://maven.aliyun.com/repository/spring-plugin</url>
<mirrorOf>spring-plugin</mirrorOf>
</mirror>
<mirror>
<id>alimaven-grails-core</id>
<name>alimaven-grails-core</name>
<url>https://maven.aliyun.com/repository/grails-core</url>
<mirrorOf>grails-core</mirrorOf>
</mirror>
<mirror>
<id>alimaven-apache-snapshots</id>
<name>alimaven-apache-snapshots</name>
<url>https://maven.aliyun.com/repository/apache-snapshots</url>
<mirrorOf>apache-snapshots</mirrorOf>
</mirror>
</mirrors>
</settings>
在用户目录下打开.gradle目录,新建init.gradle文件,内容填写如下
allprojects {
repositories {
maven{ url 'https://maven.aliyun.com/repository/central'}
maven{ url 'https://maven.aliyun.com/repository/public' }
maven{ url 'https://maven.aliyun.com/repository/google' }
maven{ url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven{ url 'https://maven.aliyun.com/repository/spring' }
maven{ url 'https://maven.aliyun.com/repository/spring-plugin' }
maven{ url 'https://maven.aliyun.com/repository/grails-core' }
maven{ url 'https://maven.aliyun.com/repository/apache-snapshots' }
mavenLocal()
mavenCentral()
}
}
仓库服务https://developer.aliyun.com/mvn/guide
最后
以上就是强健人生为你收集整理的如何配置maven和gradle的国内镜像的全部内容,希望文章能够帮你解决如何配置maven和gradle的国内镜像所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复