Java_maven配置阿里云仓库配置
阿里云仓库地址已经由http改成https
以前:http://maven.aliyun.com/repository/public
现在:https://maven.aliyun.com/repository/public
(1/3)完成的setings.xml配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<!-- 本地仓库地址 -->
<localRepository>D:\repository</localRepository>
<servers></servers>
<pluginGroups></pluginGroups>
<mirrors>
<mirror>
<id>aliyunmaven</id>
<mirrorOf>*</mirrorOf>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
</mirrors>
<profiles>
<!-- 全局JDK1.8配置 -->
<profile>
<id>jdk1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>
</profiles>
</settings>
修改完成上面的内容后,为了使下载依赖更加流畅需要修改IDEA配置
(2/3)分别点击File--Settings 搜索框输入maven (如下图) 然后点击Importing ,在VM options for imorter
中输入配置:
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
(3/3)继续点击Maven--Runner ,在VM options 中输入配置:
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true
最后Apply--OK 完成配置,尽情享受丝滑吧~~
单项目配置时,需要修改pom文件。pom文件中,没有mirror元素。在pom文件中,通过覆盖默认的中央仓库的配置,实现中央仓库地址的变更。
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>conifg</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<repositories>
<repository>
<id>central</id>
<name>aliyun maven</name>
<url>https://maven.aliyun.com/nexus/content/groups/public/</url>
<layout>default</layout>
<!-- 是否开启发布版构件下载 -->
<releases>
<enabled>true</enabled>
</releases>
<!-- 是否开启快照版构件下载 -->
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。