Browse Source
* pr/22918: Fix custom image name example and documentation Closes gh-22918pull/23585/head
4 changed files with 24 additions and 13 deletions
@ -1,16 +1,18 @@
@@ -1,16 +1,18 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar |
||||
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage |
||||
|
||||
plugins { |
||||
java |
||||
id("org.springframework.boot") version "{gradle-project-version}" |
||||
} |
||||
|
||||
tasks.getByName<BootJar>("bootJar") { |
||||
mainClassName = "com.example.ExampleApplication" |
||||
} |
||||
|
||||
// tag::image-name[] |
||||
tasks.getByName<BootBuildImage>("bootBuildImage") { |
||||
imageName = "example.com/library/${project.artifactId}" |
||||
imageName = "example.com/library/${project.name}" |
||||
} |
||||
// end::image-name[] |
||||
|
||||
tasks.register("bootBuildImageName") { |
||||
doFirst { |
||||
println(tasks.getByName<BootBuildImage>("bootBuildImage").imageName) |
||||
} |
||||
} |
||||
|
||||
Loading…
Reference in new issue