Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

JavaMavenWorkflow fails Required target/classes directory was not produced from 'mvn package'

Open
#203 3 comments 0 reactions 0 assignees View on GitHub

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

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

maintainer/need-response type/bug

Description:

Steps to reproduce
  1. Clone repository: git@github.com:francis-pang/expense-tally.git
  2. Check out branch feature/aws-sam
  3. Navigate to ./aws-lambda/get-expenses
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aws/aws-lambda-builders

All issues in aws/aws-lambda-builders

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.