diff --git a/src/main/groovy/com/palantir/gradle/javadist/DistributionExtension.groovy b/src/main/groovy/com/palantir/gradle/javadist/DistributionExtension.groovy index fccf5183..982ad7bb 100644 --- a/src/main/groovy/com/palantir/gradle/javadist/DistributionExtension.groovy +++ b/src/main/groovy/com/palantir/gradle/javadist/DistributionExtension.groovy @@ -17,6 +17,8 @@ package com.palantir.gradle.javadist; class DistributionExtension { + private static final List requiredJvmOpts = ['-Djava.security.egd=file:/dev/./urandom'] + private String serviceName private String mainClass private List args = [] @@ -61,7 +63,7 @@ class DistributionExtension { } public List getDefaultJvmOpts() { - return defaultJvmOpts + return requiredJvmOpts + defaultJvmOpts } public boolean isEnableManifestClasspath() { diff --git a/src/test/groovy/com/palantir/gradle/javadist/JavaDistributionPluginTests.groovy b/src/test/groovy/com/palantir/gradle/javadist/JavaDistributionPluginTests.groovy index dd29d535..5557ac7f 100644 --- a/src/test/groovy/com/palantir/gradle/javadist/JavaDistributionPluginTests.groovy +++ b/src/test/groovy/com/palantir/gradle/javadist/JavaDistributionPluginTests.groovy @@ -206,7 +206,7 @@ class JavaDistributionPluginTests extends Specification { // check start script uses default JVM options new File(projectDir, 'dist/service-name-0.1/service/bin/service-name').exists() String startScript = readFully('dist/service-name-0.1/service/bin/service-name') - startScript.contains('DEFAULT_JVM_OPTS=\'"-Xmx4M" "-Djavax.net.ssl.trustStore=truststore.jks"\'') + startScript.contains('DEFAULT_JVM_OPTS=\'"-Djava.security.egd=file:/dev/./urandom" "-Xmx4M" "-Djavax.net.ssl.trustStore=truststore.jks"\'') } def 'produce distribution bundle that populates config.sh' () {