欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Maven配置settings(阿里镜像)

程序员文章站 2022-06-05 18:35:42
...

1.先在 C:\Users\东\.m2 路径下创建settings.xml
2.里面的内容如下

<?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:\Maven\Maven_Repository</localRepository>
  
    <mirrors>
		<mirror>
			<id>nexus-aliyun</id>
			<mirrorOf>*</mirrorOf>
			<name>Nexus aliyun</name>
			<url>http://maven.aliyun.com/nexus/content/groups/public</url>
		</mirror> 
    </mirrors>
	<profiles>
		<profile>       
			 <id>jdk-1.8</id>       
			 <activation>       
					 <activeByDefault>true</activeByDefault>       
					 <jdk>1.8</jdk>       
			 </activation>       
			 <properties>       
					 <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>

3.修改仓库所在的地址
每个人放的地址不同 <localRepository>D:\Maven\Maven_Repository</localRepository>