我正在尝试使用 spring boot 和 maven 设置一个简单的 java rest 服务,我已经下载了 maven,并且我的 pom.xml 与 src 位于同一文件夹中,所以它是 src & pom.xml -> main -> java ->你好
当我在 hello 文件夹中并尝试运行 maven clean package 来构建我的 jar 文件时,它说找不到命令 maven。
我对 java web dev 还是比较陌生,所以确保一切都正确配置对我来说很困难。我已经下载了 maven,但我需要在我的项目中有实际的 maven 文件吗?
任何帮助都非常感谢。
-亚当
更新:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.124s
[INFO] Finished at: Fri Oct 04 11:47:08 PDT 2013
[INFO] Final Memory: 4M/89M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/Users/adam419/Desktop/Programming/Java/dd-servlet/src). 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
编辑:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/adam419/Desktop/Programming/Java/dd-servlet/src/main/java/hello/GreetingController.java:[3,7] error: class Greeting is public, should be declared in a file named Greeting.java
[ERROR] /Users/adam419/Desktop/Programming/Java/dd- servlet/src/main/java/hello/Greeting.java:[3,7] error: duplicate class: hello.Greeting
[INFO] 2 errors