Maven 的下载、IDEA操作、依赖、继承、聚合、常用构建命令说明

Maven下载

https://maven.apache.org/
下载之后解压到非中文无空格目录
在这里插入图片描述
在这里插入图片描述


maven自身的配置

在你的解压目录下的conf->setting.xml
在这里插入图片描述

指定本地仓库

Maven会把它替我们下载的 jar 包保存到本地仓库。默认这个本地仓库是在C盘,如果不介意的话,可以不用改。

| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
 <!-- conf/settings.xml 55行 -->
  <localRepository>D:\Program Files\Maven\repository</localRepository>

指定国内镜像仓库地址

这里是要放在这一对标签里面

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

设置Maven工程的 JDK 版本

默认的版本是jdk5 <profiles>在这个标签里面</profiles>
<!--在profiles节点(标签)下添加jdk编译版本 268行附近-->
<profile>
    <id>jdk-17</id>
    <activation>
      <activeByDefault>true</activeByDefault>
      <jdk>17</jdk>
    </activation>
    <properties>
      <maven.compiler.source>17</maven.compiler.source>
      <maven.compiler.target>17</maven.compiler.target>
      <maven.compiler.compilerVersion>17</maven.compiler.compilerVersion>
    </properties>
</profile>

Maven配置环境变量

MAVEN_HOME

XXX_HOME 指向 bin 目录的上一级 (也就是没有到bin)
在这里插入图片描述

Path

Path 指向 bin 目录本身
你也可以直接配置到bin目录
在这里插入图片描述

测试

mvn -v

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

今天你学golang了吗

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值