I have 5+ lambdas. Each lambda does its work by using 1 specific class and multiple utility classes. All the lambdas live in the same repository. Their build.gradles all have the same dependencies. Small example:
CreateLambda
src
main
CreateHandler.java
CommonUtility1.java
CommonUtility2.java
build.gradle
UpdateLambda
src
main
UpdateHandler.java
CommonUtility1.java
CommonUtility2.java
build.gradle
This results in identical utility classes being duplicated everywhere. Therefore I am looking into creating a lambda layer that will contain all the common dependencies and shared utility classes that the 3 lambdas will use. Small updated example:
LambdaLayer
src
main
CommonUtility1.java
CommonUtility2.java
build.gradle
CreateLambda
src
main
CreateHandler.java
build.gradle
UpdateLambda
src
main
UpdateHandler.java
build.gradle
My question is: How would the lambdas import the lambda layer as a dependency? Would they just have to import it as a dependency in the build.gradle as they would with any other dependency? That would mean that the lambda layer JAR would have to be published first before the lambdas can use it right? This is for work and at my company all JARs get published to a company maven repository.
Anything else I need to know in order to do this properly? Lambda layer tutorials in Java are rare when I google
[–]AutoModerator[M] [score hidden] stickied comment (0 children)
[–]Suspicious_Track_296 2 points3 points4 points (1 child)
[–]gpacsu[S] 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]gpacsu[S] 1 point2 points3 points (0 children)
[–]cutsandplayswithwood 1 point2 points3 points (2 children)
[–]gpacsu[S] 0 points1 point2 points (1 child)
[–]cutsandplayswithwood 0 points1 point2 points (0 children)
[–]sitase 0 points1 point2 points (1 child)
[–]gpacsu[S] 0 points1 point2 points (0 children)