Use app…DefaultJvmArgs as convention for start script's defaultJvmOpts
Closes gh-12631
This commit is contained in:
@@ -73,6 +73,14 @@ public class ApplicationPluginActionIntegrationTests {
|
||||
.contains("bootStartScripts exists = true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void createsBootStartScriptsTaskUsesApplicationPluginsDefaultJvmOpts() {
|
||||
assertThat(this.gradleBuild
|
||||
.build("startScriptsDefaultJvmOpts", "-PapplyApplicationPlugin")
|
||||
.getOutput()).contains(
|
||||
"bootStartScripts defaultJvmOpts = [-Dcom.example.a=alpha, -Dcom.example.b=bravo]");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void zipDistributionForJarCanBeBuilt() throws IOException {
|
||||
assertThat(
|
||||
|
||||
@@ -8,6 +8,7 @@ apply plugin: 'org.springframework.boot'
|
||||
|
||||
if (project.hasProperty('applyApplicationPlugin')) {
|
||||
apply plugin: 'application'
|
||||
applicationDefaultJvmArgs = ['-Dcom.example.a=alpha', '-Dcom.example.b=bravo']
|
||||
}
|
||||
|
||||
task('taskExists') {
|
||||
@@ -31,3 +32,11 @@ task('javaCompileEncoding') {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task('startScriptsDefaultJvmOpts') {
|
||||
doFirst {
|
||||
tasks.withType(org.springframework.boot.gradle.tasks.application.CreateBootStartScripts) {
|
||||
println "$name defaultJvmOpts = $defaultJvmOpts"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user