JavaMavenWorkflow fails Required target/classes directory was not produced from 'mvn package'
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- aws, java
- Domain
- build-system, cloud
Research direction
Start by reproducing sam build --use-container --template-file template.yaml from aws-lambda/get-expenses, then inspect aws-lambda/get-expenses/template.yaml, its pom.xml, and the generated target/classes directory. Done means the Java Maven workflow produces the required directory and the SAM build completes successfully.
Written by the indexing model from the issue text.
Description
Description:
Steps to reproduce
- Clone repository: git@github.com:francis-pang/expense-tally.git
- Check out branch feature/aws-sam
- Navigate to ./aws-lambda/get-expenses
- 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
.
├── LICENSE
├── README.md
├── aws-lambda
│ ├── get-expenses
│ │ ├── pom.xml
│ │ ├── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── expense_tally
│ │ │ └── views
│ │ │ └── aws
│ │ │ └── lambda
│ │ │ └── HttpGetExpensesHandler.java
│ │ └── template.yaml
│ ├── pom.xml
│ └── s3-db-file-update
│ ├── pom.xml
│ └── src
│ └── main
│ └── java
│ └── expense_tally
│ └── views
│ └── aws
│ └── lambda
│ └── NewSqlDbFileS3Handler.java
├── docs
│ ├── expenses.yaml
│ └── use-case.txt
├── expense-tally.iml
├── pom.xml
└── sonar-project.properties
Contents of template.yaml:
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
expense-tally Get Discrepant Expenses Function
Globals:
Function:
Timeout: 15
MemorySize: 256
Runtime: java11
Resources:
GetDiscrepantExpensesFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
Description: 'Retrieve all the mismatching transactions'
CodeUri: ../../
Handler: expense_tally.views.aws.lambda.HttpGetExpensesHandler::handleRequest
Events:
GetDiscrepantExpensesApi:
Type: Api
Properties:
Path: '/getDiscrepantExpenses'
Method: get
Outputs:
GetDiscrepantExpensesFunction:
Description: "Get Discrepant Expenses Function ARN"
Value: !GetAtt GetDiscrepantExpensesFunction.Arn
HelloWorldFunctionIamRole:
Description: "Implicit IAM Role created for Get Discrepant Expenses Function function"
Value: !GetAtt GetDiscrepantExpensesFunction.Arn
- Dominant language
- Python
- Stars
- 381
- Forks
- 162
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws/aws-lambda-builders
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
aws/aws-lambda-builders#925 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 64/100
aws/aws-lambda-builders#924 · 1 comment · 1 reaction ·
-
Bug: PythonUvBuilder fails to build app with dependencies on editable installs in the workspace Openstage/needs-triage
Difficulty 3/5 1-2 days Newbie friendliness 25/100
aws/aws-lambda-builders#892 ·
-
stage/needs-triage type/feature
Difficulty 4/5 3-5 days Newbie friendliness 38/100
aws/aws-lambda-builders#839 · 2 comments · 1 reaction ·
-
area/build contributors/good-first-issue contributors/welcome type/feature
Difficulty 4/5 3-5 days Newbie friendliness 38/100
aws/aws-lambda-builders#831 · 3 comments ·
All issues in aws/aws-lambda-builders
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stephrobert/dsoxlab#238 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
sublimehq/package_control#1780 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
nwg-piotr/nwg-displays#145 ·