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"

之后就能正常安装了

相关推荐
Lucky小小吴19 分钟前
ClamAV扫描速度提升6.5倍:服务器杀毒配置优化实战指南
java·服务器·网络·clamav
handsome_sai6 小时前
【Java 线程池】记录
java
大学生资源网7 小时前
基于springboot的唐史文化管理系统的设计与实现源码(java毕业设计源码+文档)
java·spring boot·课程设计
guslegend7 小时前
SpringSecurity源码剖析
java
roman_日积跬步-终至千里7 小时前
【人工智能导论】02-搜索-高级搜索策略探索篇:从约束满足到博弈搜索
java·前端·人工智能
大学生资源网8 小时前
java毕业设计之儿童福利院管理系统的设计与实现(源码+)
java·开发语言·spring boot·mysql·毕业设计·源码·课程设计
JasmineWr8 小时前
JVM栈空间的使用和优化
java·开发语言
Hello.Reader8 小时前
Flink SQL DELETE 语句批模式行级删除、连接器能力要求与实战避坑(含 Java 示例)
java·sql·flink
爱笑的眼睛118 小时前
从 Seq2Seq 到 Transformer++:深度解构与自构建现代机器翻译核心组件
java·人工智能·python·ai
Spring AI学习8 小时前
Spring AI深度解析(10/50):多模态应用开发实战
java·spring·ai