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"

之后就能正常安装了

相关推荐
Black_Cat_yyds11 分钟前
rabbitmq
java·rabbitmq·java-rabbitmq
摆烂且佛系25 分钟前
FastByteArrayOutputStream和ByteArrayInputStream有什么区别
java·开发语言
hie988941 小时前
使用Spring Boot集成Nacos
java·spring boot·后端
珹洺1 小时前
Jsp技术入门指南【十四】实现基于MySQL+JDBC+JSP数据库验证的登录界面与登录跳转功能
java·运维·数据库·mysql·servlet
像风一样自由20201 小时前
MQTT协议技术详解:深入理解物联网通信基础
java·物联网·struts
oneDay++1 小时前
# IntelliJ IDEA企业版开发入门:包、类与项目结构详解
java·经验分享·学习·intellij-idea·学习方法
程序员阿鹏1 小时前
Git的安装和配置(idea中配置Git)
java·开发语言·ide·git·intellij-idea·idea
Musennn2 小时前
102. 二叉树的层序遍历详解:队列操作与层级分组的核心逻辑
java·数据结构·算法·leetcode
越来越无动于衷2 小时前
java数组题(5)
java·算法
Mikey_n2 小时前
Spring Boot 注解详细解析:解锁高效开发的密钥
java·spring boot·后端