Unable to build due to parent relative path
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 1.2k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 52
Description
### Description
I faced an build issue when I build the serverless application on my local machine. The pom error show
> [ERROR] Non-resolvable parent POM for tally.expense:aws-lambda-get-expenses:49-SNAPSHOT: Could not find artifact tally.
However, this is not a maven issue, because I am able to build my project successfully manually with the maven command.
### Steps to reproduce
1. Clone repository: git@github.com:francis-pang/expense-tally.git
2. Check out branch _feature/aws-sam_
2. Navigate to ./aws-lambda/get-expenses
3. Build application via command `sam build --use-container --template-file template.yaml`
### Observed result
> Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
> 'build' command is called
> Starting Build inside a container
> No Parameters detected in the template
> 2 resources found in the template
> Found Serverless function with name='GetDiscrepantExpensesFunction' and CodeUri='.'
> No Parameters detected in the template
> Building function 'GetDiscrepantExpensesFunction'
> Looking for a supported build workflow in following directories: ['/d/code/expense-tally/aws-lambda/get-expenses', '/d/code/expense-tally/> aws-lambda/get-expenses']
>
> Fetching amazon/aws-sam-cli-build-image-java11 Docker container image......
> Mounting /d/code/expense-tally/aws-lambda/get-expenses as /tmp/samcli/source:ro,delegated inside runtime container
> Using the request object from command line argument
> Loading workflow module 'aws_lambda_builders.workflows'
> Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip', application_framework=None)'
> Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm', application_framework=None)'
> Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)> '
> Registering workflow 'GoDepBuilder' with capability 'Capability(language='go', dependency_manager='dep', application_framework=None)'
> Registering workflow 'GoModulesBuilder' with capability 'Capability(language='go', dependency_manager='modules', application_framework=None)'
> Registering workflow 'JavaGradleWorkflow' with capability 'Capability(language='java', dependency_manager='gradle', application_framework=None)'
> Registering workflow 'JavaMavenWorkflow' with capability 'Capability(language='java', dependency_manager='maven', application_framework=None)'
> Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package', > application_framework=None)'
> Registering workflow 'CustomMakeBuilder' with capability 'Capability(language='provided', dependency_manager=None, application_framework=None)'
> Found workflow 'JavaMavenWorkflow' to support capabilities 'Capability(language='java', dependency_manager='maven', application_framework=None)'
> Running workflow 'JavaMavenWorkflow'
> Running JavaMavenWorkflow:CopySource
> JavaMavenWorkflow:CopySource succeeded
> Running JavaMavenWorkflow:MavenBuild
> Maven logs: [INFO] Scanning for projects...
> [ERROR] [ERROR] Some problems were encountered while processing the POMs:
> [FATAL] Non-resolvable parent POM for tally.expense:aws-lambda-get-expenses:49-SNAPSHOT: Could not find artifact tally.> expense:aws-lambda:pom:49-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 13
> @
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR]
> [ERROR] The project tally.expense:aws-lambda-get-expenses:49-SNAPSHOT (/tmp/samcli/scratch/pom.xml) has 1 error
> [ERROR] Non-resolvable parent POM for tally.expense:aws-lambda-get-expenses:49-SNAPSHOT: Could not find artifact tally.> expense:aws-lambda:pom:49-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 13 -> [Help 2]
> [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/ProjectBuildingException
> [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
> JavaMavenWorkflow:MavenBuild failed
> Traceback (most recent call last):
> File "/usr/local/opt/sam-cli/lib64/python3.7/site-packages/aws_lambda_builders/workflows/java_maven/actions.py", line 36, in execute
> self.subprocess_maven.build(self.scratch_dir)
> File "/usr/local/opt/sam-cli/lib64/python3.7/site-packages/aws_lambda_builders/workflows/java_maven/maven.py", line 34, in build
> raise MavenExecutionError(message=stdout.decode("utf8").strip())
> aws_lambda_builders.workflows.java_maven.maven.MavenExecutionError: Maven Failed: [INFO] Scanning for projects...
> [ERROR] [ERROR] Some problems were encountered while processing the POMs:
> [FATAL] Non-resolvable parent POM for tally.expense:aws-lambda-get-expenses:49-SNAPSHOT: Could not find artifact tally.> expense:aws-lambda:pom:49-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 13
> @
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR]
> [ERROR] The project tally.expense:aws-lambda-get-expenses:49-SNAPSHOT (/tmp/samcli/scratch/pom.xml) has 1 error
> [ERROR] Non-resolvable parent POM for tally.expense:aws-lambda-get-expenses:49-SNAPSHOT: Could not find artifact tally.> expense:aws-lambda:pom:49-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 13 -> [Help 2]
> [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/ProjectBuildingException
> [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
> File "/usr/local/opt/sam-cli/lib64/python3.7/site-packages/aws_lambda_builders/workflow.py", line 269, in run
> action.execute()
> File "/usr/local/opt/sam-cli/lib64/python3.7/site-packages/aws_lambda_builders/workflows/java_maven/actions.py", line 38, in execute
> raise ActionFailedError(str(ex))
> aws_lambda_builders.actions.ActionFailedError: Maven Failed: [INFO] Scanning for projects...
> [ERROR] [ERROR] Some problems were encountered while processing the POMs:
> [FATAL] Non-resolvable parent POM for tally.expense:aws-lambda-get-expenses:49-SNAPSHOT: Could not find artifact tally.> expense:aws-lambda:pom:49-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 13
> @
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR]
> [ERROR] The project tally.expense:aws-lambda-get-expenses:49-SNAPSHOT (/tmp/samcli/scratch/pom.xml) has 1 error
> [ERROR] Non-resolvable parent POM for tally.expense:aws-lambda-get-expenses:49-SNAPSHOT: Could not find artifact tally.> expense:aws-lambda:pom:49-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 13 -> [Help 2]
> [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/ProjectBuildingException
> [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
> Builder workflow failed
> Traceback (most recent call last):
> File "/usr/local/opt/sam-cli/lib64/python3.7/site-packages/aws_lambda_builders/workflows/java_maven/actions.py", line 36, in execute
> self.subprocess_maven.build(self.scratch_dir)
> File "/usr/local/opt/sam-cli/lib64/python3.7/site-packages/aws_lambda_builders/workflows/java_maven/maven.py", line 34, in build
> raise MavenExecutionError(message=stdout.decode("utf8").strip())
> aws_lambda_builders.workflows.java_maven.maven.MavenExecutionError: Maven Failed: [INFO] Scanning for projects...
> [ERROR] [ERROR] Some problems were encountered while processing the POMs:
> [FATAL] Non-resolvable parent POM for tally.expense:aws-lambda-get-expenses:49-SNAPSHOT: Could not find artifact tally.> expense:aws-lambda:pom:49-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 13
> @
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR]
> [ERROR] The project tally.expense:aws-lambda-get-expenses:49-SNAPSHOT (/tmp/samcli/scratch/pom.xml) has 1 error
> [ERROR] Non-resolvable parent POM for tally.expense:aws-lambda-get-expenses:49-SNAPSHOT: Could not find artifact tally.> expense:aws-lambda:pom:49-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 13 -> [Help 2]
> [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/ProjectBuildingException
> [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
> File "/usr/local/opt/sam-cli/lib64/python3.7/site-packages/aws_lambda_builders/workflow.py", line 269, in run
> action.execute()
> File "/usr/local/opt/sam-cli/lib64/python3.7/site-packages/aws_lambda_builders/workflows/java_maven/actions.py", line 38, in execute
> raise ActionFailedError(str(ex))
> aws_lambda_builders.actions.ActionFailedError: Maven Failed: [INFO] Scanning for projects...
> [ERROR] [ERROR] Some problems were encountered while processing the POMs:
> [FATAL] Non-resolvable parent POM for tally.expense:aws-lambda-get-expenses:49-SNAPSHOT: Could not find artifact tally.> expense:aws-lambda:pom:49-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 13
> @
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR]
> [ERROR] The project tally.expense:aws-lambda-get-expenses:49-SNAPSHOT (/tmp/samcli/scratch/pom.xml) has 1 error
> [ERROR] Non-resolvable parent POM for tally.expense:aws-lambda-get-expenses:49-SNAPSHOT: Could not find artifact tally.> expense:aws-lambda:pom:49-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 13 -> [Help 2]
> [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/ProjectBuildingException
> [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
> File "/usr/local/opt/sam-cli/lib64/python3.7/site-packages/aws_lambda_builders/__main__.py", line 126, in main
> mode=params.get("mode", None),
> File "/usr/local/opt/sam-cli/lib64/python3.7/site-packages/aws_lambda_builders/builder.py", line 125, in build
> return workflow.run()
> File "/usr/local/opt/sam-cli/lib64/python3.7/site-packages/aws_lambda_builders/workflow.py", line 76, in wrapper
> func(self, *args, **kwargs)
> File "/usr/local/opt/sam-cli/lib64/python3.7/site-packages/aws_lambda_builders/workflow.py", line 276, in run
> raise WorkflowFailedError(workflow_name=self.NAME, action_name=action.NAME, reason=str(ex))
> aws_lambda_builders.exceptions.WorkflowFailedError: JavaMavenWorkflow:MavenBuild - Maven Failed: [INFO] Scanning for projects...
> [ERROR] [ERROR] Some problems were encountered while processing the POMs:
> [FATAL] Non-resolvable parent POM for tally.expense:aws-lambda-get-expenses:49-SNAPSHOT: Could not find artifact tally.> expense:aws-lambda:pom:49-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 13
> @
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR]
> [ERROR] The project tally.expense:aws-lambda-get-expenses:49-SNAPSHOT (/tmp/samcli/scratch/pom.xml) has 1 error
> [ERROR] Non-resolvable parent POM for tally.expense:aws-lambda-get-expenses:49-SNAPSHOT: Could not find artifact tally.> expense:aws-lambda:pom:49-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 13 -> [Help 2]
> [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/ProjectBuildingException
> [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
> Build inside container returned response {"jsonrpc": "2.0", "id": 1, "error": {"code": 400, "message": "JavaMavenWorkflow:MavenBuild - Maven > Failed: [INFO] Scanning for projects...\n[ERROR] [ERROR] Some problems were encountered while processing the POMs:\n[FATAL] Non-resolvable > parent POM for tally.expense:aws-lambda-get-expenses:49-SNAPSHOT: Could not find artifact tally.expense:aws-lambda:pom:49-SNAPSHOT and 'parent.> relativePath' points at wrong local POM @ line 5, column 13\n @ \n[ERROR] The build could not read 1 project -> [Help 1]\n[ERROR] \n[ERROR] > The project tally.expense:aws-lambda-get-expenses:49-SNAPSHOT (/tmp/samcli/scratch/pom.xml) has 1 error\n[ERROR] Non-resolvable parent POM > for tally.expense:aws-lambda-get-expenses:49-SNAPSHOT: Could not find artifact tally.expense:aws-lambda:pom:49-SNAPSHOT and 'parent.> relativePath' points at wrong local POM @ line 5, column 13 -> [Help 2]\n[ERROR] \n[ERROR] To see the full stack trace of the errors, re-run > Maven with the -e switch.\n[ERROR] Re-run Maven using the -X switch to enable full debug logging.\n[ERROR] \n[ERROR] For more information about > the errors and possible solutions, please read the following articles:\n[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/> ProjectBuildingException\n[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException"}}
>
> Build Failed
> Sending Telemetry: {'metrics': [{'commandRun': {'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam > build', 'duration': 6984, 'exitReason': 'BuildInsideContainerError', 'exitCode': 1, 'requestId': '775eb3b0-a26a-41a4-8579-5401d79ea5a2', > 'installationId': '64dc910d-76cc-4269-b045-fbd8f21825bb', 'sessionId': 'c1531b71-4de3-4e4d-85ee-74c61a35f8d9', 'executionEnvironment': 'CLI', > 'pyversion': '3.8.5', 'samcliVersion': '1.4.0'}}]}
> HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
> Error: JavaMavenWorkflow:MavenBuild - Maven Failed: [INFO] Scanning for projects...
> [ERROR] [ERROR] Some problems were encountered while processing the POMs:
> [FATAL] Non-resolvable parent POM for tally.expense:aws-lambda-get-expenses:49-SNAPSHOT: Could not find artifact tally.> expense:aws-lambda:pom:49-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 13
> @
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR]
> [ERROR] The project tally.expense:aws-lambda-get-expenses:49-SNAPSHOT (/tmp/samcli/scratch/pom.xml) has 1 error
> [ERROR] Non-resolvable parent POM for tally.expense:aws-lambda-get-expenses:49-SNAPSHOT: Could not find artifact tally.> expense:aws-lambda:pom:49-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 13 -> [Help 2]
> [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/ProjectBuildingException
> [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
### Expected result
It is expected that the build will be successful. An execution of the successful run via maven command is uploaded to [pastebin:https://pastebin.pl/view/0408a9f8](https://pastebin.pl/view/0408a9f8)
### Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
OS Name Microsoft Windows 10 Pro
Version 10.0.19041 Build 19041
Execute this on WSL:
WSL build: 4.4.0-19041-Microsoft #488-Microsoft Mon Sep 01 13:43:00 PST 2020 x86_64 x86_64 x86_64 GNU/Linux
WSL Distribution information
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
Java version: 11
Maven version: 3.6
2. `sam --version`: 1.4.0
Contributor guide
Assessment
This issue has not been assessed yet.