Use application plugin properties by convention when it is applied
bootRun's main and jvmArgs properties use mainClassName and applicationDefaultJvmArgs respectively by convention. bootJar and bootWar's mainClass property uses mainClassName by convention.pull/8686/merge
parent
188c9e0f42
commit
1dc5c484f0
@ -0,0 +1,11 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'application'
|
||||
|
||||
mainClassName = 'com.example.CustomMain'
|
@ -0,0 +1,11 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'war'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'application'
|
||||
|
||||
mainClassName = 'com.example.CustomMain'
|
@ -0,0 +1,14 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
applicationDefaultJvmArgs = ['-Dcom.foo=bar', '-Dcom.bar=baz']
|
||||
|
||||
task echoJvmArguments {
|
||||
println 'JVM arguments = ' + bootRun.jvmArgs
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
mainClassName = 'com.example.CustomMainClass'
|
||||
|
||||
task echoMainClassName {
|
||||
println 'Main class name = ' + bootRun.main
|
||||
}
|
Loading…
Reference in New Issue