sam build is unable to locate the pom.xml file
Asked Answered
H

1

6

I have a Maven Project which has a module 'AddUser'. This module is basically a sam application. When trying to run the command 'sam build' from the project root path. I am getting the below error:-

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

The Complete Code can be found here - https://github.com/training-session-101/UserPlanning

Can anyone who has faced similar issue help me in this!

Thanks!

Hypermetropia answered 14/7, 2019 at 11:27 Comment(1)
add your pom and your module configuration file directly in your postPediatrics
P
10

I had this problem. First I ran mvn clean install, then I changed the SAM template so that it didn't point to the jar but to the location of the pom.xml file, like so:

CodeUri: .

and then ran sam build.

Plank answered 24/4, 2020 at 0:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.