Skip to content

Commit cbab239

Browse files
jnizetsnicoll
authored andcommitted
Fix property name in gradle plugin documentation
See gh-25454
1 parent aa032e0 commit cbab239

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-publish.gradle

+6
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,9 @@ bootBuildImage {
2121
}
2222
}
2323
// end::publish[]
24+
25+
task bootBuildImagePublish {
26+
doFirst {
27+
println(tasks.bootBuildImage.publish)
28+
}
29+
}

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-publish.gradle.kts

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ tasks.getByName<BootJar>("bootJar") {
1313
// tag::publish[]
1414
tasks.getByName<BootBuildImage>("bootBuildImage") {
1515
imageName = "docker.example.com/library/${project.name}"
16-
publish = true
16+
isPublish = true
1717
docker {
1818
publishRegistry {
1919
username = "user"
@@ -24,3 +24,9 @@ tasks.getByName<BootBuildImage>("bootBuildImage") {
2424
}
2525
}
2626
// end::publish[]
27+
28+
tasks.register("bootBuildImagePublish") {
29+
doFirst {
30+
println(tasks.getByName<BootBuildImage>("bootBuildImage").isPublish)
31+
}
32+
}

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.java

+7
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,13 @@ void bootBuildImageWithCustomImageName() throws IOException {
242242
assertThat(result.getOutput()).contains("example.com/library/" + this.gradleBuild.getProjectDir().getName());
243243
}
244244

245+
@TestTemplate
246+
void bootBuildImagePublish() throws IOException {
247+
BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-publish")
248+
.build("bootBuildImagePublish");
249+
assertThat(result.getOutput()).contains("true");
250+
}
251+
245252
protected void jarFile(File file) throws IOException {
246253
try (JarOutputStream jar = new JarOutputStream(new FileOutputStream(file))) {
247254
jar.putNextEntry(new ZipEntry("META-INF/MANIFEST.MF"));

0 commit comments

Comments
 (0)