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"

之后就能正常安装了

相关推荐
还是奇怪1 分钟前
Simon Willison 用 DSPy 优化 Datasette Agent 提示词:提示工程正在变成可测试的软件工程
java·开发语言·软件工程
zfoo-framework16 分钟前
1.ansible安装 2.虚拟机克隆
java
码上解惑26 分钟前
从 Dify 工作流说起:常用节点怎么选、怎样组合?
java·人工智能·ai·agent·dify·智能体·spring ai
青山木1 小时前
Hot 100 --- 岛屿数量
java·数据结构·算法·leetcode·深度优先·广度优先
程序员-珍2 小时前
报错下载android sdk失败
android·java
糖果店的幽灵2 小时前
langgraph分支之 - 动态分支(Dynamic Branch)
java·前端·javascript·人工智能·langgraph
吃饱了得干活2 小时前
亿级订单表分库分表设计,从0到1全流程
java·数据库·面试
唐青枫2 小时前
Java Spring Security 实战详解:从登录认证到 JWT 权限控制
java
曹牧3 小时前
文档格式:OFD
java
豆角焖肉3 小时前
Maven进阶与搭建私服
java·maven