@TOC
当我们在idea中无法下载maven依赖的时候,可以使用本地安装的方式,将远程jar拉取到本地进行本地安装,
例如:当我的项目拉取 e-iceblue ppt解析依赖jar
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.presentation</artifactId>
<version>9.4.5</version>
</dependency>
结果报错如下:
Could not find artifact e-iceblue:spire.presentation:pom:9.4.5 in nexus-aliyun
说明我们在某个仓库拉取不到目标jar,这个时候我们可以去maven中心仓库下载jar到本地,例如:maven中心仓库链接https://mvnrepository.com/repos/central
选择目标版本
将下载到本地的jar安装到maven仓库:
# 指令格式如下:
# mvn -s 本地setting.xml路径 install:install-file -DgroupId=G坐标 -DartifactId=A坐标 -Dversion=V坐标 -Dpackaging=jar -Dfile=本地jar路径
mvn -s C:\dev-tools\maven\apache-maven-3.8.4\conf\aliyun\settings.xml install:install-file -DgroupId=e-iceblue -DartifactId=spire.presentation -Dversion=9.4.5 -Dpackaging=jar -Dfile=./spire.presentation-9.4.5.jar
出现上图标识即代表成功