gpt4 book ai didi

java - sam build 无法定位 pom.xml 文件

转载 作者:行者123 更新时间:2023-12-04 13:18:37 26 4
gpt4 key购买 nike

我有一个 Maven 项目,它有一个模块“AddUser”。这个模块基本上是一个 sam 应用程序。
尝试从项目根路径运行命令“sam build”时。我收到以下错误:-

in-iftekhar-04eb:UserPlanning iftekhar.khan$ sam build
2019-07-14 16:55:00 Building resource 'AddUserFunction'
2019-07-14 16:55:00 Running JavaMavenWorkflow:CopySource
2019-07-14 16:55:00 Running JavaMavenWorkflow:MavenBuild

Build Failed
Error: JavaMavenWorkflow:MavenBuild - Maven Failed: [INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.054 s
[INFO] Finished at: 2019-07-14T16:55:01+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/private/var/folders/f8/jgg9tzq97q39c_c2z1sn4blm0000gn/T/tmprn_uvw70). 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

完整代码可以在这里找到 - https://github.com/training-session-101/UserPlanning

任何遇到类似问题的人都可以帮助我吗!

谢谢!

最佳答案

我有这个问题。首先我跑了mvn clean install ,然后我更改了 SAM 模板,使其不指向 jar 而是指向 pom.xml 的位置文件,像这样:
CodeUri: .
然后跑 sam build .

关于java - sam build 无法定位 pom.xml 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57026995/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com