Update BootWar to support Gradle's configuration cache

See gh-22922
This commit is contained in:
Andy Wilkinson
2020-10-01 15:34:00 +01:00
parent 081ef2d905
commit 83cfd3b2e6
11 changed files with 77 additions and 19 deletions

View File

@@ -23,7 +23,7 @@ import org.springframework.boot.gradle.junit.GradleCompatibility;
*
* @author Andy Wilkinson
*/
@GradleCompatibility
@GradleCompatibility(configurationCache = true)
class BootWarIntegrationTests extends AbstractBootArchiveIntegrationTests {
BootWarIntegrationTests() {

View File

@@ -4,4 +4,4 @@ plugins {
id 'org.springframework.boot' version '{version}'
}
mainClassName = 'com.example.CustomMain'
mainClass = 'com.example.CustomMain'

View File

@@ -0,0 +1,8 @@
plugins {
id 'war'
id 'org.springframework.boot' version '{version}'
}
bootWar {
mainClass = 'com.example.Application'
}

View File

@@ -0,0 +1,27 @@
plugins {
id 'war'
id 'org.springframework.boot' version '{version}'
}
bootWar {
mainClass = 'com.example.CustomMain'
duplicatesStrategy = "exclude"
}
configurations {
provided
}
sourceSets.all {
compileClasspath += configurations.provided
runtimeClasspath += configurations.provided
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.apache.commons:commons-lang3:3.6")
provided "org.apache.commons:commons-lang3:3.6"
}

View File

@@ -4,7 +4,7 @@ plugins {
}
bootWar {
mainClassName = 'com.example.Application'
mainClass = 'com.example.Application'
launchScript {
properties 'prop' : '{launchScriptProperty}'
}

View File

@@ -4,6 +4,6 @@ plugins {
}
bootWar {
mainClassName = 'com.example.Application'
mainClass = 'com.example.Application'
{launchScript}
}

View File

@@ -4,6 +4,6 @@ plugins {
}
bootWar {
mainClassName = 'com.example.Application'
mainClass = 'com.example.Application'
{launchScript}
}

View File

@@ -0,0 +1,8 @@
plugins {
id 'war'
id 'org.springframework.boot' version '{version}'
}
bootWar {
mainClass = 'com.example.Application'
}

View File

@@ -0,0 +1,9 @@
plugins {
id 'war'
id 'org.springframework.boot' version '{version}'
}
bootWar {
mainClass = 'com.example.Application'
launchScript()
}

View File

@@ -1,13 +0,0 @@
plugins {
id 'war'
id 'org.springframework.boot' version '{version}'
}
bootWar {
mainClass = 'com.example.Application'
if (project.hasProperty('includeLaunchScript') ? includeLaunchScript : false) {
launchScript {
properties 'prop' : project.hasProperty('launchScriptProperty') ? launchScriptProperty : 'default'
}
}
}