requires a project to execute but there is no POM in this directory

来源:3-13 对接项目数据到日志服务器

酱汁怪兽

2021-12-06

步骤一:
log-generator-1.0.jar放置到:
C:\Users\jieqiong\Desktop/log-generator-1.0.jar

步骤二:
执行以下命令
[C:\Users\jieqiong\IdeaProjects]$ mvn install:install-file
-Dfile=C:\Users\jieqiong\Desktop/log-generator-1.0.jar
-DgroupId=com.imooc.bigdata
-DartifactId=log-gen
-Dversion=1.0
-Dpackaging=jar

还是报错:
[INFO] Scanning for projects…
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.046 s
[INFO] Finished at: 2021-12-06T15:16:04+08:00
[INFO] Final Memory: 7M/243M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Users\jieqiong\IdeaProjects). 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

图片描述

我的理解是log-generator-1.0.jar需要和主pom文件放在一起。
但是放在一起的话,也报错:
The parameters ‘file’ for goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file are missing or invalid

写回答

1回答

Michael_PK

2021-12-08

这只是个jar包而已,和主pom没有关系的,任意一个路径下执行就可以。

0
0

Spark3实时处理-Streaming+StructuredStreaming实战

实战Spark3实时处理,掌握两套企业级处理方案

347 学习 · 238 问题

查看课程