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

  • Post author:
  • Post category:其他

1.maven找不到pom.xml文件报错

Microsoft Windows [版本 10.0.17134.829]
(c) 2018 Microsoft Corporation。保留所有权利。

F:\gitsource\test2\guns\MagicToe-master\guns_project>mvn clean compile
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.066 s
[INFO] Finished at: 2019-06-27T10:32:53+08:00
[INFO] Final Memory: 6M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (F:\gitsource\test2\guns\MagicToe-master\guns_project). 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

2.解决方案

进入到pom.xml目录下执行 mvn install命令即可


 F:\gitsource\test2\guns\MagicToe-master\guns_project\myguns 的目录

2019/06/27  10:31    <DIR>          .
2019/06/27  10:31    <DIR>          ..
2019/06/27  10:31            15,902 myguns.iml
2019/06/27  10:10             9,984 pom.xml
2019/06/27  09:56    <DIR>          src
2019/06/27  10:24    <DIR>          target
               2 个文件         25,886 字节
               4 个目录 303,556,747,264 可用字节

F:\gitsource\test2\guns\MagicToe-master\guns_project\myguns>mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building myguns 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ myguns ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 793 resources
[INFO] Copying 6 resources
[INFO] Copying 11 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ myguns ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 150 source files to F:\gitsource\test2\guns\MagicToe-master\guns_project\myguns\target\classes
[WARNING] /F:/gitsource/test2/guns/MagicToe-master/guns_project/myguns/src/main/java/cn/stylefeng/guns/core/common/node/MenuNode.java: 某些输入文件使用了未经检查或不安全的操作。
[WARNING] /F:/gitsource/test2/guns/MagicToe-master/guns_project/myguns/src/main/java/cn/stylefeng/guns/core/common/node/MenuNode.java: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ myguns ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory F:\gitsource\test2\guns\MagicToe-master\guns_project\myguns\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ myguns ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ myguns ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:3.1.0:jar (default-jar) @ myguns ---
[INFO] Building jar: F:\gitsource\test2\guns\MagicToe-master\guns_project\myguns\target\myguns.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.1.1.RELEASE:repackage (repackage) @ myguns ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- spring-boot-maven-plugin:2.1.1.RELEASE:repackage (default) @ myguns ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ myguns ---
[INFO] Installing F:\gitsource\test2\guns\MagicToe-master\guns_project\myguns\target\myguns.jar to D:\m2_repository\com\guns\demo\myguns\1.0-SNAPSHOT\myguns-1.0-SNAPSHOT.jar
[INFO] Installing F:\gitsource\test2\guns\MagicToe-master\guns_project\myguns\pom.xml to D:\m2_repository\com\guns\demo\myguns\1.0-SNAPSHOT\myguns-1.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.745 s
[INFO] Finished at: 2019-06-27T10:43:06+08:00
[INFO] Final Memory: 68M/461M
[INFO] ------------------------------------------------------------------------

F:\gitsource\test2\guns\MagicToe-master\guns_project\myguns>mvn clean compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building myguns 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ myguns ---
[INFO] Deleting F:\gitsource\test2\guns\MagicToe-master\guns_project\myguns\target
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ myguns ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 793 resources
[INFO] Copying 6 resources
[INFO] Copying 11 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ myguns ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 150 source files to F:\gitsource\test2\guns\MagicToe-master\guns_project\myguns\target\classes
[WARNING] /F:/gitsource/test2/guns/MagicToe-master/guns_project/myguns/src/main/java/cn/stylefeng/guns/core/common/node/MenuNode.java: 某些输入文件使用了未经检查或不安全的操作。
[WARNING] /F:/gitsource/test2/guns/MagicToe-master/guns_project/myguns/src/main/java/cn/stylefeng/guns/core/common/node/MenuNode.java: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.608 s
[INFO] Finished at: 2019-06-27T10:43:31+08:00
[INFO] Final Memory: 45M/453M
[INFO] ------------------------------------------------------------------------

问题得到解决

 


版权声明:本文为LuckFairyLuckBaby原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。