Idea配置Maven阿里云镜像加速

如果没有安装过maven,是用的idea自带的maven,那就是idea的安装目录下 /plugins/maven/lib/maven3这个目录。
Idea配置Maven阿里云镜像加速_第1张图片
然后在conf下打开settings.xml,加入如下代码:

  <mirrors>
	<mirror>
		<id>aliyunmavenid>
		<mirrorOf>*mirrorOf>
		<name>阿里云公共仓库name>
		<url>https://maven.aliyun.com/repository/publicurl>
	mirror>
  mirrors>

如果默认用1.8jdk,可以添加:

<profile>
	<id>jdk-1.8id>
	<activation>
		<activeByDefault>trueactiveByDefault>
		<jdk>1.8jdk>
	activation>
	<properties>
		<maven.compiler.source>1.8maven.compiler.source>
		<maven.compiler.target>1.8maven.compiler.target>
		<maven.compiler.compilerVersion>1.8maven.compiler.compilerVersion>
	properties>
profile>

全部代码如下:






<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">
  

  

  

  
  <pluginGroups>
    
  pluginGroups>

  
  <proxies>
    
  proxies>

  
  <servers>
    

    
  servers>

  
  <mirrors>
	<mirror>
		<id>aliyunmavenid>
		<mirrorOf>*mirrorOf>
		<name>阿里云公共仓库name>
		<url>https://maven.aliyun.com/repository/publicurl>
	mirror>
    
  mirrors>

  
  <profiles>
    
	<profile>
		<id>jdk-1.8id>
		<activation>
			<activeByDefault>trueactiveByDefault>
			<jdk>1.8jdk>
		activation>
		<properties>
			<maven.compiler.source>1.8maven.compiler.source>
			<maven.compiler.target>1.8maven.compiler.target>
			<maven.compiler.compilerVersion>1.8maven.compiler.compilerVersion>
		properties>
	profile>

    
  profiles>

  
settings>

你可能感兴趣的:(全栈,后端,maven)