sam build无法找到pom.xml文件。

6

我有一个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 有没有遇到类似问题的人可以帮助我!
谢谢!

请直接在您的帖子中添加您的POM和模块配置文件。 - sam3131
1个回答

10

我曾经遇到过这个问题。首先运行 mvn clean install,然后更改SAM模板,使其不指向jar文件,而是指向pom.xml文件的位置,如下所示:

CodeUri: .

然后运行sam build


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接