Created
July 31, 2017 18:47
-
-
Save netrebel/72966d39d81ccfd158e0d40063beab7e to your computer and use it in GitHub Desktop.
Gradle fatJar and ZIP (lambda)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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