0
点赞
收藏
分享

微信扫一扫

【Maven安装本地jar包】Cannot install artifact. Artifact is already in the local repository

瑾谋 2022-04-03 阅读 69
maven

项目场景:

本地项目启动,ide pom.xml文件提示报红,maven刷新本地缓存还是无效,所以将服务器中的jar文件放置到本地对应的目录中,并执行 mvn install 命令。


问题描述

执行命令如下:

mvn install:install-file -Dfile=D:\repository\com\genie\cloud\genie-common\1.0.2-SNAPSHOT\\ge
nie-common-1.0.2-SNAPSHOT.jar -DgroupId=com.genie.cloud -DartifactId=genie-common -Dversion=1.0.2-SNAPSHOT -Dpackaging=jar

执行命令后提示如下:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file (default-cli) on project acti
vity-service: Cannot install artifact. Artifact is already in the local repository.

原因分析:

通过提示信息发现,本地仓库路径下已经存在该jar;


解决方案:

1、将jar包放在不是仓库路径位置,重新install

结果如下:
在这里插入图片描述

举报

相关推荐

0 条评论