shell 腳本執行mvn clean install 報錯 --MissingProjectException


12月12日北京OSC源創會 —— 開源技術的年終盛典 »  

[INFO] Scanning for projects... 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 0.324s 
[INFO] Finished at: Tue Jun 11 11:02:07 CST 2013 
[INFO] Final Memory: 2M/59M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/root). 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 

我在shell里面寫入cd 到我的mvn工程下,然后進行編譯打包,結果執行錯誤,但是我在另一個腳本里面執行是沒有問題的

 
解決辦法:
 
Shell 里面使用 cd 是沒有用處的。建議你在 bash 中使用
mvn -f $YOUR_PROJECT_DIR/pom.xml clean install

或者繼續在 bash 中使用 cd,然后這樣執行(記住前面還有個點)

. ./your_shell_script_file.sh

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM