maven的settings.xml里设置aliyun镜像阿里云maven私库以及jdk1.8版本编译

demo:

<?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:/root/apache-maven-3.6.3/repository</localRepository>

  <mirrors>
    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>        
    </mirror>
  </mirrors>

  <profiles>
         <profile>    
            <id>jdk8</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>

  <activeProfiles>
        <activeProfile>jdk8</activeProfile>
  </activeProfiles>

</settings>

记得设置maven环境变量,在系统变量里添加:

MAVEN_HOME = D:\root\apache-maven-3.6.3

end.

posted on 2020-07-04 07:48  梦幻朵颜  阅读(2147)  评论(1编辑  收藏  举报