maven的settings.xml里設置aliyun鏡像以及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.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM