maven手动安装jar包到本地仓库时遇到there is no POM in this directory

这几天处理的项目遇到了maven无法下载的jar包,此时要手动加到本地maven仓库中,但是报错:

powershell 复制代码
PS D:\> mvn install:install-file   -Dfile=D:\olap4j-0.9.7.309-JS-3.jar  -DgroupId=org.olap4j  -DartifactId=olap4j -Dversion=0.9.7.309-JS-3  -Dpackaging=jar
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.045 s
[INFO] Finished at: 2024-09-14T14:02:18+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (D:\). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException

该错误从字面意思来理解好像是找不到pom文件,经过万能的百度, 找到一个解决方法就是将相关参数加上引号,如下:

powershell 复制代码
mvn install:install-file  "-Dfile=D:\olap4j-0.9.7.309-JS-3.jar"  "-DgroupId=org.olap4j"  "-DartifactId=olap4j" "-Dversion=0.9.7.309-JS-3"  "-Dpackaging=jar"

之后就能正常安装了

相关推荐
齐 飞13 分钟前
使用jackson将xml和对象、List相互转换
xml·java·spring boot·后端·list
liwulin050613 分钟前
java-在ANTLR中BaseListner的方法和词法规则的关系0.5.0
java·开发语言
SofterICer28 分钟前
PE-PINCodes 规则
java
归去来兮★33 分钟前
c++面向对象
java·开发语言·c++
Aimyon_3634 分钟前
DockerFile
java·开发语言
wrx繁星点点44 分钟前
创建型模式-单例模式
java·开发语言·单例模式
guangzhi06331 小时前
JAVA执行引擎详细介绍
java·jvm
解孔明2 小时前
IDEA2023.1添加java虚拟机启动参数,打开断言
java·开发语言
关关不烦恼2 小时前
【Java数据结构】二叉树
java·开发语言·数据结构
苹果酱05672 小时前
使用 React Testing Library 测试自定义 React Hooks
java·开发语言·spring boot·后端·中间件