Maven配置使用阿里云镜像
在settings.xml文件中的mirrors下添加mirror标签
<!-- 阿里云仓库 -->
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
<!-- 中央仓库1 -->
<mirror>
<id>repo1</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo1.maven.org/maven2/</url>
</mirror>
<!-- 中央仓库2 -->
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo2.maven.org/maven2/</url>
</mirror>
据说在pom文件里也可以用下面这种方式
<repositories>
<repository>
<id>maven-ali</id>
<url>http://maven.aliyun.com/nexus/content/groups/public//</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</repository>
</repositories>
设置本地仓库路径
<localRepository>D:\repository</localRepository>
maven中央仓库,访问速度还可以
https://mvnrepository.com/
pom.xml中,老是变红,提示not found
org.springframework.bootspring-boot-maven-plugin
解决办法,上maven中央仓库,找到Spring Boot Maven Plugin,找个最新版本,添加依赖就行。
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platfor
Maven 打包时有标题中警告,需要在pom.xml文件中添加UTF-8
maven正确配置阿里云的镜像,一定要多阅读阿里云的配置说明文件
Maven 配置
打开 Maven 的配置文件(windows机器一般在maven安装目录的conf/settings.xml),在标签中添加 mirror 子节点:
aliyunmaven
*
阿里云公共仓库
https://maven.aliyun.com/repository/public
如果想使用其它代理仓库,可在节点中加入对应的仓库使用地址。以使用spring代理仓为例:注意一下配置要写在一个之内
spring
https://maven.aliyun.com/repository/spring
true
true
gradle 配置
在 build.gradle 文件中加入以下代码:
allprojects {
repositories {
maven { url 'https://maven.aliyun.com/repository/public/' }
mavenLocal()
mavenCentral()
}
}
如果想使用 maven.aliyun.com 提供的其它代理仓,以使用 spring 仓为例,代码如下:
allprojects {
repositories {
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/spring/'}
mavenLocal()
mavenCentral()
}
}
mac 中不能重装启动IDEA的坑
找到下面目录,干掉
~/Library/Application Support/JetBrains/