提问者:小点点

mvn干净包不起作用,缺少项目


我正在学习这个教程:http://www.adeveloperdiary.com/java/spring-boot/create-spring-boot-application-step-step/

我已经安装了maven,我去运行目录\SpringBoot\src\main\java\com\ad开发目录中的mvn清洁包,但它一直在说

[INFO] Scanning for projects...
[INFO] ---------------------------------------------------------------------     ---
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.059 s
[INFO] Finished at: 2016-12-07T11:45:06-05:00
[INFO] Final Memory: 6M/310M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no   POM in this directory   (C:\Users\kbultman\Downloads\SpringBoot\src\main\java\com\adeveloperdiary).   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

这是我的mvn版本

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T11:41:47-05:00)
Maven home: C:\Users\kbultman\Downloads\apache-maven-3.3.9\apache-maven-3.3.9
Java version: 1.7.0_79, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_79\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "windows

共1个答案

匿名用户

您想在项目的顶级目录中运行maven命令。为此,您需要使用“cd”命令,如下所示:

cd\path\to\目录

在你的情况下,目录可能是

C:\用户\k bult man\下载\Spring Boot

而不是

C:\用户\k bult man\下载\Spring Boot\s rc\main\java\com\a开发者日记