idea配置maven记录

  • 首先找到maven下conf下的settings.xml文件,进行配置修改,如我本地路径D:\maven\apache-maven-3.5.4\conf\settings.xml

  • 修改settings.xml文件主要三个地方

    1. 本地仓库地址修改,修改为本地的repository包下
    <localRepository>D:\maven\apache-maven-3.5.4\repository</localRepository>
    
    1. 镜像仓库修改为阿里云
    <!--阿里云镜像-->
      <mirror>
          <id>alimaven</id>
          <name>aliyun maven</name>
          <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
          <mirrorOf>central</mirrorOf>
      </mirror>
      
      <!--中央仓库在中国的位置-->
      <mirror>
          <id> maven-net-cn </id>
          <name>Maven China Mirror</name>
          <url>http://maven.net.cn/content/groups/public/</url>
          <mirrorOf>central</mirrorOf>
      </mirror>
    
    1. jdk版 设置为1.8
    <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>
    
  • 配置idea的maven配置(前提:已装好jdk并配置)

  • 最后配置一下环境变量,同java配置一样path配置到bin

posted @ 2021-09-28 19:30  叔,我告诉婶儿去  阅读(43)  评论(0编辑  收藏  举报