You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build application via command sam build --use-container --template-file template.yaml
Observed result:
[INFO] Reactor Summary for expense-tally 49-SNAPSHOT:
[INFO]
[INFO] expense-tally ...................................... SUCCESS [01:40 min]
[INFO] expense-tally-model ................................ SUCCESS [01:03 min]
[INFO] csv-parser ......................................... SUCCESS [ 1.795 s]
[INFO] expense-manager .................................... SUCCESS [ 9.474 s]
[INFO] expense-reconciliator .............................. SUCCESS [ 2.932 s]
[INFO] expense-tally-cli .................................. SUCCESS [01:21 min]
[INFO] aws-lambda ......................................... SUCCESS [ 3.556 s]
[INFO] aws-lambda-get-expenses ............................ SUCCESS [ 0.373 s]
[INFO] aws-lambda-s3-db-file-update ....................... SUCCESS [01:10 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:34 min
[INFO] Finished at: 2020-10-18T06:37:37Z
[INFO] ------------------------------------------------------------------------
JavaMavenWorkflow:MavenBuild succeeded
Running JavaMavenWorkflow:MavenCopyDependency
JavaMavenWorkflow:MavenCopyDependency succeeded
Running JavaMavenWorkflow:MavenCopyArtifacts
JavaMavenWorkflow:MavenCopyArtifacts failed
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 69, in execute
self._copy_artifacts()
File "/usr/local/opt/sam-cli/lib64/python3.7/site-packages/aws_lambda_builders/workflows/java_maven/actions.py", line 76, in _copy_artifacts
raise ActionFailedError("Required target/classes directory was not produced from 'mvn package'")
aws_lambda_builders.actions.ActionFailedError: Required target/classes directory was not produced from 'mvn package'
Builder workflow failed
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 69, in execute
self._copy_artifacts()
File "/usr/local/opt/sam-cli/lib64/python3.7/site-packages/aws_lambda_builders/workflows/java_maven/actions.py", line 76, in _copy_artifacts
raise ActionFailedError("Required target/classes directory was not produced from 'mvn package'")
aws_lambda_builders.actions.ActionFailedError: Required target/classes directory was not produced from 'mvn package'
Expected result:
Build is successful after
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
Project directory is as below:
only showing the relevant one, full project directory is at aws-sam branch
AWSTemplateFormatVersion: '2010-09-09'Transform: AWS::Serverless-2016-10-31Description: > expense-tally Get Discrepant Expenses FunctionGlobals:
Function:
Timeout: 15MemorySize: 256Runtime: java11Resources:
GetDiscrepantExpensesFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunctionProperties:
Description: 'Retrieve all the mismatching transactions'CodeUri: ../../Handler: expense_tally.views.aws.lambda.HttpGetExpensesHandler::handleRequestEvents:
GetDiscrepantExpensesApi:
Type: ApiProperties:
Path: '/getDiscrepantExpenses'Method: getOutputs:
GetDiscrepantExpensesFunction:
Description: "Get Discrepant Expenses Function ARN"Value: !GetAtt GetDiscrepantExpensesFunction.ArnHelloWorldFunctionIamRole:
Description: "Implicit IAM Role created for Get Discrepant Expenses Function function"Value: !GetAtt GetDiscrepantExpensesFunction.Arn
The text was updated successfully, but these errors were encountered:
The problem is that the CodeUri referring the parent pom folder is also used as working directory in sam build. It would be useful to configure in the AWS Toolkit SAM options the base-dir options like in the CLI.
Here is my workaround in vscode:
In the template.yaml, set the CodeUri parameter to the local folder
CodeUri: .
Then, place the template.yaml close to the parent pom.xml (so that the parent and modules will be copied) and run the following command by replacing the module folder with one of the available one (the working directory to the aws lambda maven module so that sam could bind target classes and dependencies).
sam build -s ./module\ -t ./template.yaml
Prepare a event.json which contains the payload (body) of your lambda
run the sam package
sam local invoke -d 5870 -e ./event.json
In vscode, add a debug configuration (Java attach to process) and setup like this :
Description:
Steps to reproduce
sam build --use-container --template-file template.yaml
Observed result:
Expected result:
Build is successful after
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
Project directory is as below:
only showing the relevant one, full project directory is at aws-sam branch
Contents of template.yaml:
The text was updated successfully, but these errors were encountered: