Maven

Maven

maven 下载地址

(Maven 官网)[https://maven.apache.org/]

https://maven.apache.org/
maven 本地仓库
  • 配置maven文件下的 conf/setting.xml 文件
<localRepository>D:\开发\IDEA\maven\maven-repository</localRepository>
maven 镜像配置
注释掉:
<mirror>
  <id>maven-default-http-blocker</id>
  <mirrorOf>external:http:*</mirrorOf>
  <name>Pseudo repository to mirror external repositories initially using HTTP.</name>
  <url>http://0.0.0.0/</url>
  <blocked>true</blocked>
</mirror>

添加上:
<mirror>
    <id>aliyun</id>
    <mirrorOf>central</mirrorOf>
    <name>aliyun</name>
    <url>https://maven.aliyun.com/repository/public</url>
</mirror>
maven JDK配置
<!-- 配置项目开发编译的jdk版本 -->
<profiles>
    <profile>
        <!-- settings.xml中的id不能随便起的 -->
        <!-- 告诉maven我们用jdk1.8 -->
        <id>jdk-17</id>
        <!-- 开启JDK的使用 -->
        <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>
</profiles>
maven 环境变量
1、新建MAVEN_HOME环境变量,路径:D:\开发\IDEA\maven\apache-maven-3.9.3
2、编辑Path,%MAVEN_HOME%\bin
posted @ 2023-06-26 22:39  九秒钟的鱼  阅读(9)  评论(0编辑  收藏  举报