IDEA设置本地maven仓库

时间:2021-02-21 03:40:17

IDEA设置本地maven仓库

1.下载apache-maven-3.3.9,解压

IDEA设置本地maven仓库

2.在系统”环境变量“,”系统变量“设置MVN_HOME,如图:

IDEA设置本地maven仓库

3.在PATH设置,如: %M2_HOME%\bin, 这样就可以在命令中的任何目录下运行 Maven 命令了。

4.在CMD命令查配置:mvn -version

IDEA设置本地maven仓库

5.指定本地的仓库,在\apache-maven-3.3.9\conf\settings.xml 找到

<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:\myelipseworkspace\maven\repository</localRepository>

  

6.在IDEA配置本地maven:

Settings--->Maven---->设置为如图:

IDEA设置本地maven仓库

7.注意,配置oralce需要手工放置jar包

1)在pom.xml加入依赖:

        <!-- oracle -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0</version>
</dependency> <!-- jdbc -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>

2)在本地仓库放置oracle包:\repository\com\oracle\

IDEA设置本地maven仓库

8.在我的文件里下载oralce附件。