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"

之后就能正常安装了

相关推荐
m0_480502649 分钟前
Rust 入门 KV存储HashMap (十七)
java·开发语言·rust
杨DaB30 分钟前
【SpringBoot】Swagger 接口工具
java·spring boot·后端·restful·swagger
YA33330 分钟前
java基础(九)sql基础及索引
java·开发语言·sql
桦说编程1 小时前
方法一定要有返回值 \ o /
java·后端·函数式编程
小李是个程序1 小时前
登录与登录校验:Web安全核心解析
java·spring·web安全·jwt·cookie
David爱编程1 小时前
Java 创建线程的4种姿势,哪种才是企业级项目的最佳实践?
java·后端
hrrrrb2 小时前
【Java Web 快速入门】十一、Spring Boot 原理
java·前端·spring boot
Java微观世界2 小时前
Object核心类深度剖析
java·后端
MrSYJ2 小时前
为什么HttpSecurity会初始化创建两次
java·后端·程序员
hinotoyk3 小时前
TimeUnit源码分享
java