diff --git a/build.gradle b/build.gradle
index c3b7e91b1a32ed3db5170289cb249e73cdcd848e..5110420ec842862e0bd7b7d6eaf1ac1d5913095c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -6,6 +6,7 @@ plugins {
   id "com.github.spotbugs" version "${spotbugsVersion}"
   id "com.palantir.git-version" version "${gitVersionVersion}" apply false
   id "com.star-zero.gradle.githook" version "${githooksVersion}"
+  id "de.undercouch.download" version "${downloadVersion}"
   id "eclipse-wtp"
   id "jacoco"
   id "maven-publish"
@@ -17,6 +18,7 @@ apply from: "${projectDir}/gradle/ext.gradle"
 apply from: "${projectDir}/gradle/jar.gradle"
 apply from: "${projectDir}/gradle/git-hooks.gradle"
 apply from: "${projectDir}/gradle/node.gradle"
+apply from: "${projectDir}/gradle/nshm.gradle"
 apply from: "${projectDir}/gradle/repositories.gradle"
 apply from: "${projectDir}/gradle/spotbugs.gradle"
 apply from: "${projectDir}/gradle/spotless.gradle"
@@ -52,6 +54,7 @@ tasks.withType(JavaCompile) {
 }
 
 tasks.withType(JavaExec) {
+  dependsOn downloadNshms
   jvmArgs(
       '-noverify',
       '-Xms2g',
@@ -71,11 +74,6 @@ tasks.withType(com.github.spotbugs.snom.SpotBugsTask) {
   }
 }
 
-task libsClean(type: Delete) {
-  delete libsDir
-}
-clean.dependsOn libsClean
-
 test {
   useJUnitPlatform()
 
diff --git a/gradle.properties b/gradle.properties
index 3f48835359cf223a3a469c892eb0c628d133a517..789fef82635d525ec15cb0815ee37fec9cc2ec62 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -2,6 +2,7 @@ awsEc2Version = 1.11.619
 awsLambdaCoreVersion = 1.1.0
 awsLambdaVersion = 1.11.461
 awsS3Version = 1.11.579
+downloadVersion = 5.1.0
 githooksVersion = 1.2.0
 gitVersionVersion = 0.15.0
 jacksonVersion = 2.9.0