一、使用本地jar包
在项目中创建一个lib文件夹,将想要使用的本地jar包放进去

然后直接在pom.xml中添加下列依赖(项目协作推荐)
<dependency>
<groupId>com.fpl</groupId>
<artifactId>spring</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/spring.jar</systemPath>
</dependency>

二、同样在项目中创建一个lib文件夹,将想要使用的本地jar包放进去

然后在项目结构中引用lib文件夹(个人练习推荐)
三、将本地jar包导入到咱们的本地maven仓库中
同样在项目中创建一个lib文件夹,将想要使用的本地jar包放进去

使用命令将本地jar包导入到咱们的本地maven仓库中
mvn install:install-file -Dfile=spring.jar -Dartifactld=spring -DgroupId=com.fpl -Dversion=1.0-SNAPSHOT -Dpackaging=jar
对上面命令进行解释如下
mvn install:install-file
-Dfile=spring.jar //jar包名称
-Dartifactld=spring //jar包源项目的artifactid
-DgroupId=com.fpl //jar包源项目的groupid
-Dversion=1.0-SNAPSHOT //jar包源项目的version
-Dpackaging=jar
右击jar包,进入咱们jar包的文件夹内
在该路径打开命令行,运行上面的代码

然后按照正常的依赖导入在pom.xml中进行依赖导入
<dependency>
<groupId>com.fpl</groupId>
<artifactId>spring</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>