The goal you specified requires a project to execute but there is no POM in this directory

编程入门 行业动态 更新时间:2024-10-21 10:04:55

将一个非maven项目的jar包安装到本地maven仓库,遇到报错:

The goal you specified requires a project to execute but there is no POM in this directory

当你以为是自己jar包有问题时,才发现是powershell的坑。

运行命令如下:

 mvn install:install-file -Dfile=avatica-core-1.17.0-SNAPSHOT.jar  \
 -DgroupId=org.apache.calcite.avatica -DartifactId=avatica-core \
 -Dversion=1.17.0-SNAPSHOT -Dpackaging=jar -DgeneratePom=true

报错如下:

然而同样的命令,在黑框命令行ok


如何让powershell也可以运行?
参数加引号

mvn install:install-file "-Dfile=avatica-core-1.17.0-SNAPSHOT.jar" \
"-DgroupId=org.apache.calcite.avatica" "-DartifactId=avatica-core" \
"-Dversion=1.17.0-SNAPSHOT" "-Dpackaging=jar" "-DgeneratePom=true"

这也是我为啥不喜欢windows的原因,抱歉我对powershell不熟,你非要解析成函数调用,还非要整2套。

更多推荐

The goal you specified requires a project to execute but there is no POM in this

本文发布于:2023-06-14 08:49:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1458463.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:project   requires   goal   directory   POM

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!