Skip to content

Instantly share code, notes, and snippets.

@netrebel
Created July 31, 2017 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netrebel/72966d39d81ccfd158e0d40063beab7e to your computer and use it in GitHub Desktop.
Save netrebel/72966d39d81ccfd158e0d40063beab7e to your computer and use it in GitHub Desktop.
Gradle fatJar and ZIP (lambda)
apply plugin: 'java'
version = '1.0.0-SNAPSHOT'
// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
compile 'com.amazonaws:aws-lambda-java-events:1.3.0'
compile 'com.amazonaws:aws-lambda-java-core:1.1.0'
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
}
task buildZip(type: Zip) {
from compileJava
from processResources
into('lib') {
from configurations.runtime
}
}
build.dependsOn buildZip
task fatjar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'AWS Lambda PoC',
'Implementation-Version': version
}
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment