IntelliJ IDEA + Maven

1、下载maven

下载地址:http://maven.apache.org/download.cgi

2、解压

3、配置

        变量名:M2_HOME

        变量值:c:\zz\maven\apache-maven-3.5.0

        找到Path在环境变量值尾部加入:;%M2_HOME%\bin;  //前面注意分号  

4、C:\Users\zz>mvn -v
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-15T01:37:52+08:00)
Maven home: D:\zz\apache-maven-3.2.1
Java version: 1.8.0_181, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_181\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"

5、奉劝你早点给maven配置个国内镜像。配置方法很简单,修改setting.xml(eg:D:\data\maven\apache-maven-3.2.3\conf)文件,配置国内镜像(例如阿里云镜像),配置代码如下:

<mirrors>
  <!-- mirror
    Specifies a repository mirror site to use instead of a given repository. The repository that
    this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
    for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
  <mirror>
    <id>mirrorId</id>
    <mirrorOf>repositoryId</mirrorOf>
    <name>Human Readable Name for this Mirror.</name>
    <url>http://my.repository.com/repo/path</url>
  </mirror>
   -->

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

  <mirror> 
    <id>uk</id>  
    <mirrorOf>central</mirrorOf>  
    <name>Human Readable Name for this Mirror.</name>  
    <url>http://uk.maven.org/maven2/</url> 
  </mirror>

   <mirror>
    <id>CN</id>
    <name>OSChina Central</name>
    <url>http://maven.oschina.net/content/groups/public/</url>
    <mirrorOf>central</mirrorOf>
  </mirror>

  <mirror>
    <id>nexus</id>
    <name>internal nexus repository</name>
    <url>http://repo.maven.apache.org/maven2</url>
    <mirrorOf>central</mirrorOf>
  </mirror>

</mirrors>

6、IntelliJ IDEA更新maven file--setting---build--build---maven 可以选择自动导入 源码 说明等

7、导入springboot工程,一定要选择类型maven,这样他就会自动加载。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值