开发者社区> 问答> 正文

shell 脚本执行mvn clean install 报错?报错

[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工程下,然后进行编译打包,结果执行错误,但是我在另一个脚本里面执行是没有问题的

展开
收起
爱吃鱼的程序员 2020-06-22 19:01:27 642 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    看日志是没有进入工程目录。

    cd后打印下你的目录试试。

    Shell里面使用cd是没有用处的。建议你在bash中使用

    mvn-f$YOUR_PROJECT_DIR/pom.xmlcleaninstall或者继续在bash中使用cd,然后这样执行(记住前面还有个点) ../your_shell_script_file.sh


    ok,thanks,the problemhasbeenresolvedthepinyinisbroken
    2020-06-22 19:01:44
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Shell 脚本速查手册 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载