我想安裝一個簡單的java休息服務與春季啓動和maven,我已經下載maven,並有我的pom.xml位於與src相同的文件夾,所以它是 src & pom.xml - > main - > java - > hello無法找到項目與春季啓動命令maven
當我進入hello文件夾並嘗試運行maven clean package來構建我的jar文件時它說找不到命令maven。
我還是比較新的java web開發,所以確保一切正確配置對我來說很困難。我已經下載了maven,但是我需要在項目中使用實際的maven文件嗎?
任何幫助是真正的讚賞。
- 亞當
UPDATE:
[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
這就是它所在的位置。我應該從哪個目錄調用mvn,比如當我執行mvn clean install時? –
在pom所在的目錄 – Ralph