Fail with Gradle bootBuildImage and war packaging

Prior to this commit, running the bootBuildImage Gradle task on a
project configured for war packaging would result in a jar file being
built and used in the image instead of the war file. With this commit
an error will be thrown from the plugin in this case.

Fixes gh-24521
This commit is contained in:
Scott Frederick
2020-12-15 17:13:33 -06:00
parent 29300530c6
commit 0e5df2296e
6 changed files with 61 additions and 1 deletions

View File

@@ -0,0 +1,11 @@
plugins {
id 'war'
id 'org.springframework.boot' version '{version}'
}
bootBuildImage {
jar = bootWar.archiveFile
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'

View File

@@ -3,5 +3,9 @@ plugins {
id 'org.springframework.boot' version '{version}'
}
if (project.hasProperty('applyWarPlugin')) {
apply plugin: 'war'
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'