JavaGradleWorkflow fails with Gradle sub-project dependency
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java
- Domain
- build-system
Research direction
Start with aws_lambda_builders/workflows/java_gradle/actions.py and gradle.py, focusing on JavaGradleWorkflow:GradleBuild and the Gradle invocation. Reproduce the two-module setup described with sam build on moduleB, then verify that the shared commons.jar is available and the SAM build completes successfully.
Written by the indexing model from the issue text.
Description
Description:
I have a repo of multiple Gradle modules. One module contains all shared code, and all other modules depend on the single shared module.
Prior to moving the shared code into it's own module, sam build and deploy were working fine. Now that the module of shared code is split out, same build is failing.
Steps to reproduce the issue:
- Setup 2 Gradle modules(moduleA and moduleB)
- Let moduleB be deployed to a Lambda function and depend on moduleA
- Run
sam buildon moduleB and the build will fail
Observed result:
2021-01-03 18:50:45,589 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2021-01-03 18:50:45,716 | 'build' command is called
2021-01-03 18:50:45,720 | No Parameters detected in the template
2021-01-03 18:50:45,743 | 1 resources found in the template
2021-01-03 18:50:45,743 | Found Serverless function with name='DailyUpdateFunction' and CodeUri='.'
2021-01-03 18:50:45,744 | No Parameters detected in the template
2021-01-03 18:50:45,770 | Instantiating build definitions
2021-01-03 18:50:45,773 | Same function build definition found, adding function (Previous: BuildDefinition(java11, ., Zip, , a50fb9b9-79f6-48f1-a4dc-51818ab36e50, {}, []), Current: BuildDefinition(java11, ., Zip, , e9cb278a-418b-4322-b626-eaca6512385c, {}, []), Function: Function(name='DailyUpdateFunction', functionname='DailyUpdateFunction', runtime='java11', memory=512, timeout=20, handler='lechads.fantasybball.LambdaHandler::handleRequest', imageuri=None, packagetype='Zip', imageconfig=None, codeuri='.', environment={'Variables': {'ENV': 'PROD'}}, rolearn=None, layers=[], events={'NoonDailyUpdate': {'Type': 'Schedule', 'Properties': {'Schedule': 'cron(0, 17, *, *, ?, *)', 'Name': 'noon-daily-update', 'Enabled': True}}}, metadata=None, codesign_config_arn=None))
2021-01-03 18:50:45,774 | Building codeuri: . runtime: java11 metadata: {} functions: ['DailyUpdateFunction']
2021-01-03 18:50:45,774 | Building to following folder /Users/cschafer/Desktop/fantasy_bball_slack_integration/components/daily_update/.aws-sam/build/DailyUpdateFunction
2021-01-03 18:50:45,774 | Looking for a supported build workflow in following directories: ['/Users/cschafer/Desktop/fantasy_bball_slack_integration/components/daily_update', '/Users/cschafer/Desktop/fantasy_bball_slack_integration/components/daily_update']
2021-01-03 18:50:45,775 | Loading workflow module 'aws_lambda_builders.workflows'
2021-01-03 18:50:45,779 | Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip', application_framework=None)'
2021-01-03 18:50:45,780 | Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm', application_framework=None)'
2021-01-03 18:50:45,782 | Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'
2021-01-03 18:50:45,783 | Registering workflow 'GoDepBuilder' with capability 'Capability(language='go', dependency_manager='dep', application_framework=None)'
2021-01-03 18:50:45,784 | Registering workflow 'GoModulesBuilder' with capability 'Capability(language='go', dependency_manager='modules', application_framework=None)'
2021-01-03 18:50:45,787 | Registering workflow 'JavaGradleWorkflow' with capability 'Capability(language='java', dependency_manager='gradle', application_framework=None)'
2021-01-03 18:50:45,790 | Registering workflow 'JavaMavenWorkflow' with capability 'Capability(language='java', dependency_manager='maven', application_framework=None)'
2021-01-03 18:50:45,792 | Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package', application_framework=None)'
2021-01-03 18:50:45,794 | Registering workflow 'CustomMakeBuilder' with capability 'Capability(language='provided', dependency_manager=None, application_framework=None)'
2021-01-03 18:50:45,794 | Found workflow 'JavaGradleWorkflow' to support capabilities 'Capability(language='java', dependency_manager='gradle', application_framework=None)'
2021-01-03 18:50:46,549 | Running workflow 'JavaGradleWorkflow'
2021-01-03 18:50:46,550 | Running JavaGradleWorkflow:GradleBuild
2021-01-03 18:50:56,643 | JavaGradleWorkflow:GradleBuild failed
Traceback (most recent call last):
File "/usr/local/Cellar/aws-sam-cli/1.15.0/libexec/lib/python3.8/site-packages/aws_lambda_builders/workflows/java_gradle/actions.py", line 47, in _build_project
self.subprocess_gradle.build(
File "/usr/local/Cellar/aws-sam-cli/1.15.0/libexec/lib/python3.8/site-packages/aws_lambda_builders/workflows/java_gradle/gradle.py", line 45, in build
raise GradleExecutionError(message=stderr.decode("utf8").strip())
aws_lambda_builders.workflows.java_gradle.gradle.GradleExecutionError: Gradle Failed: FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':jar'.
> Cannot expand ZIP '/var/folders/90/ytzb7jbs72q6x6_zklk09tlm0000gr/T/tmpa7zgkyzw/7c0bdfb5795645b1a06a4b13758f35c5eca150e7/build/libs/commons.jar' as it does not exist.
Expected result:
Successful SAM build!!
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
Reproduced this both on MacOS and Linux(Fedora)
- 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
-
area: harness bug status: needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Human-Agent-Society/reef#625 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
learningequality/kolibri#15351 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Name consistency Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
eellak/triplestore#65 · 1 comment ·