Migrate gradle-pluigin to Antora
See gh-33766
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
integrating-with-actuator=integrating-with-actuator
|
||||
integrating-with-actuator-build-info=integrating-with-actuator.build-info
|
||||
managing-dependencies=managing-dependencies
|
||||
managing-dependencies-dependency-management-plugin=managing-dependencies.dependency-management-plugin
|
||||
managing-dependencies-dependency-management-plugin-customizing=managing-dependencies.dependency-management-plugin.customizing
|
||||
managing-dependencies-dependency-management-plugin-using-in-isolation=managing-dependencies.dependency-management-plugin.using-in-isolation
|
||||
managing-dependencies-dependency-management-plugin-learning-more=managing-dependencies.dependency-management-plugin.learning-more
|
||||
managing-dependencies-gradle-bom-support=managing-dependencies.gradle-bom-support
|
||||
managing-dependencies-gradle-bom-support-customizing=managing-dependencies.gradle-bom-support.customizing
|
||||
build-image=build-image
|
||||
build-image-docker-daemon=build-image.docker-daemon
|
||||
build-image-docker-registry=build-image.docker-registry
|
||||
build-image-customization=build-image.customization
|
||||
build-image-examples=build-image.examples
|
||||
build-image-example-custom-image-builder=build-image.examples.custom-image-builder
|
||||
build-image-example-builder-configuration=build-image.examples.builder-configuration
|
||||
build-image-example-runtime-jvm-configuration=build-image.examples.runtime-jvm-configuration
|
||||
build-image-example-custom-image-name=build-image.examples.custom-image-name
|
||||
build-image-example-buildpacks=build-image.examples.buildpacks
|
||||
build-image-example-publish=build-image.examples.publish
|
||||
build-image-example-docker=build-image.examples.docker
|
||||
packaging-executable=packaging-executable
|
||||
packaging-executable-jars=packaging-executable.jars
|
||||
packaging-executable-wars=packaging-executable.wars
|
||||
packaging-executable-wars-deployable=packaging-executable.wars.deployable
|
||||
packaging-executable-and-plain=packaging-executable.and-plain-archives
|
||||
packaging-executable-configuring=packaging-executable.configuring
|
||||
packaging-executable-configuring-main-class=packaging-executable.configuring.main-class
|
||||
packaging-executable-configuring-including-development-only-dependencies=packaging-executable.configuring.including-development-only-dependencies
|
||||
packaging-executable-configuring-unpacking=packaging-executable.configuring.unpacking
|
||||
packaging-executable-configuring-launch-script=packaging-executable.configuring.launch-script
|
||||
packaging-executable-configuring-properties-launcher=packaging-executable.configuring.properties-launcher
|
||||
packaging-layered-archives=packaging-executable.configuring.layered-archives
|
||||
packaging-layers-configuration=packaging-executable.configuring.layered-archives.configuration
|
||||
publishing-your-application=publishing-your-application
|
||||
publishing-your-application-maven-publish=publishing-your-application.maven-publish
|
||||
publishing-your-application-maven=publishing-your-application.maven
|
||||
publishing-your-application-distribution=publishing-your-application.distribution
|
||||
reacting-to-other-plugins=reacting-to-other-plugins
|
||||
reacting-to-other-plugins-java=reacting-to-other-plugins.java
|
||||
reacting-to-other-plugins-kotlin=reacting-to-other-plugins.kotlin
|
||||
reacting-to-other-plugins-war=reacting-to-other-plugins.war
|
||||
reacting-to-other-plugins-dependency-management=reacting-to-other-plugins.dependency-management
|
||||
reacting-to-other-plugins-application=reacting-to-other-plugins.application
|
||||
running-your-application=running-your-application
|
||||
running-your-application-passing-arguments=running-your-application.passing-arguments
|
||||
running-your-application-passing-system-properties=running-your-application.passing-system-properties
|
||||
running-your-application-reloading-resources=running-your-application.reloading-resources
|
||||
@@ -0,0 +1,8 @@
|
||||
name: spring-boot
|
||||
ext:
|
||||
zip_contents_collector:
|
||||
include:
|
||||
- name: gradle-plugin
|
||||
classifier: catalog-content
|
||||
module: gradle-plugin
|
||||
destination: content-catalog
|
||||
@@ -0,0 +1 @@
|
||||
include::gradle-plugin:partial$nav-gradle-plugin.adoc[]
|
||||
@@ -0,0 +1,5 @@
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
id 'org.graalvm.buildtools.native' version '{version-native-build-tools}'
|
||||
id 'java'
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
plugins {
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
id("org.graalvm.buildtools.native") version "{version-native-build-tools}"
|
||||
java
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
plugins {
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
maven { url 'https://repo.spring.io/libs-snapshot' }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'org.springframework.boot:spring-boot-gradle-plugin:{version-spring-boot}'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
@@ -0,0 +1,6 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven { url 'https://repo.spring.io/milestone' }
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven { url = uri("https://repo.spring.io/milestone") }
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven { url 'https://repo.spring.io/milestone' }
|
||||
maven { url 'https://repo.spring.io/snapshot' }
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven { url = uri("https://repo.spring.io/milestone") }
|
||||
maven { url = uri("https://repo.spring.io/snapshot") }
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// tag::apply[]
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
// end::apply[]
|
||||
|
||||
task verify {
|
||||
doLast {
|
||||
plugins.getPlugin(org.gradle.api.plugins.JavaPlugin.class)
|
||||
plugins.getPlugin(io.spring.gradle.dependencymanagement.DependencyManagementPlugin.class)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// tag::apply[]
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
apply(plugin = "io.spring.dependency-management")
|
||||
// end::apply[]
|
||||
|
||||
tasks.register("verify") {
|
||||
doLast {
|
||||
project.plugins.getPlugin(JavaPlugin::class)
|
||||
project.plugins.getPlugin(io.spring.gradle.dependencymanagement.DependencyManagementPlugin::class)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
// tag::additional[]
|
||||
springBoot {
|
||||
buildInfo {
|
||||
properties {
|
||||
additional = [
|
||||
'a': 'alpha',
|
||||
'b': 'bravo'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
// end::additional[]
|
||||
@@ -0,0 +1,18 @@
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::additional[]
|
||||
springBoot {
|
||||
buildInfo {
|
||||
properties {
|
||||
additional.set(mapOf(
|
||||
"a" to "alpha",
|
||||
"b" to "bravo"
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
// end::additional[]
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
// tag::build-info[]
|
||||
springBoot {
|
||||
buildInfo()
|
||||
}
|
||||
// end::build-info[]
|
||||
@@ -0,0 +1,10 @@
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::build-info[]
|
||||
springBoot {
|
||||
buildInfo()
|
||||
}
|
||||
// end::build-info[]
|
||||
@@ -0,0 +1,17 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
// tag::custom-values[]
|
||||
springBoot {
|
||||
buildInfo {
|
||||
properties {
|
||||
artifact = 'example-app'
|
||||
version = '1.2.3'
|
||||
group = 'com.example'
|
||||
name = 'Example application'
|
||||
}
|
||||
}
|
||||
}
|
||||
// end::custom-values[]
|
||||
@@ -0,0 +1,17 @@
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::custom-values[]
|
||||
springBoot {
|
||||
buildInfo {
|
||||
properties {
|
||||
artifact.set("example-app")
|
||||
version.set("1.2.3")
|
||||
group.set("com.example")
|
||||
name.set("Example application")
|
||||
}
|
||||
}
|
||||
}
|
||||
// end::custom-values[]
|
||||
@@ -0,0 +1,12 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
// tag::exclude-time[]
|
||||
springBoot {
|
||||
buildInfo {
|
||||
excludes = ['time']
|
||||
}
|
||||
}
|
||||
// end::exclude-time[]
|
||||
@@ -0,0 +1,12 @@
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::exclude-time[]
|
||||
springBoot {
|
||||
buildInfo {
|
||||
excludes.set(setOf("time"))
|
||||
}
|
||||
}
|
||||
// end::exclude-time[]
|
||||
@@ -0,0 +1,31 @@
|
||||
import io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension
|
||||
|
||||
// tag::configure-bom[]
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}" apply false
|
||||
id("io.spring.dependency-management") version "{version-dependency-management-plugin}"
|
||||
}
|
||||
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
|
||||
}
|
||||
}
|
||||
// end::configure-bom[]
|
||||
|
||||
the<DependencyManagementExtension>().apply {
|
||||
resolutionStrategy {
|
||||
eachDependency {
|
||||
if (requested.group == "org.springframework.boot") {
|
||||
useVersion("TEST-SNAPSHOT")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("file:repository")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
// tag::configure-bom[]
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES
|
||||
}
|
||||
}
|
||||
// end::configure-bom[]
|
||||
|
||||
dependencyManagement {
|
||||
resolutionStrategy {
|
||||
eachDependency {
|
||||
if (it.requested.group == 'org.springframework.boot') {
|
||||
it.useVersion 'TEST-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven { url 'file:repository' }
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::configure-bom[]
|
||||
apply(plugin = "io.spring.dependency-management")
|
||||
|
||||
the<DependencyManagementExtension>().apply {
|
||||
imports {
|
||||
mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
|
||||
}
|
||||
}
|
||||
// end::configure-bom[]
|
||||
|
||||
the<DependencyManagementExtension>().apply {
|
||||
resolutionStrategy {
|
||||
eachDependency {
|
||||
if (requested.group == "org.springframework.boot") {
|
||||
useVersion("TEST-SNAPSHOT")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("file:repository")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
// tag::configure-platform[]
|
||||
dependencies {
|
||||
implementation platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
|
||||
}
|
||||
// end::configure-platform[]
|
||||
|
||||
dependencies {
|
||||
implementation "org.springframework.boot:spring-boot-starter"
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven { url 'file:repository' }
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
resolutionStrategy {
|
||||
eachDependency {
|
||||
if (it.requested.group == 'org.springframework.boot') {
|
||||
it.useVersion 'TEST-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::configure-platform[]
|
||||
dependencies {
|
||||
implementation(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES))
|
||||
}
|
||||
// end::configure-platform[]
|
||||
|
||||
dependencies {
|
||||
implementation("org.springframework.boot:spring-boot-starter")
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("file:repository")
|
||||
}
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
resolutionStrategy {
|
||||
eachDependency {
|
||||
if (requested.group == "org.springframework.boot") {
|
||||
useVersion("TEST-SNAPSHOT")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
|
||||
implementation "org.slf4j:slf4j-api"
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven { url 'file:repository' }
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
resolutionStrategy {
|
||||
eachDependency {
|
||||
if (it.requested.group == 'org.springframework.boot') {
|
||||
it.useVersion 'TEST-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// tag::custom-version[]
|
||||
configurations.all {
|
||||
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
|
||||
if (details.requested.group == 'org.slf4j') {
|
||||
details.useVersion '1.7.20'
|
||||
}
|
||||
}
|
||||
}
|
||||
// end::custom-version[]
|
||||
@@ -0,0 +1,35 @@
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES))
|
||||
implementation("org.slf4j:slf4j-api")
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("file:repository")
|
||||
}
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
resolutionStrategy {
|
||||
eachDependency {
|
||||
if (requested.group == "org.springframework.boot") {
|
||||
useVersion("TEST-SNAPSHOT")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// tag::custom-version[]
|
||||
configurations.all {
|
||||
resolutionStrategy.eachDependency {
|
||||
if (requested.group == "org.slf4j") {
|
||||
useVersion("1.7.20")
|
||||
}
|
||||
}
|
||||
}
|
||||
// end::custom-version[]
|
||||
@@ -0,0 +1,29 @@
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
|
||||
dependencyManagement {
|
||||
resolutionStrategy {
|
||||
eachDependency {
|
||||
if (it.requested.group == 'org.springframework.boot') {
|
||||
it.useVersion 'TEST-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// tag::custom-version[]
|
||||
ext['slf4j.version'] = '1.7.20'
|
||||
// end::custom-version[]
|
||||
|
||||
repositories {
|
||||
maven { url 'file:repository' }
|
||||
}
|
||||
|
||||
task slf4jVersion {
|
||||
doLast {
|
||||
println dependencyManagement.managedVersions['org.slf4j:slf4j-api']
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension
|
||||
|
||||
plugins {
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
apply(plugin = "io.spring.dependency-management")
|
||||
|
||||
// tag::custom-version[]
|
||||
extra["slf4j.version"] = "1.7.20"
|
||||
// end::custom-version[]
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("file:repository")
|
||||
}
|
||||
}
|
||||
|
||||
the<DependencyManagementExtension>().apply {
|
||||
resolutionStrategy {
|
||||
eachDependency {
|
||||
if (requested.group == "org.springframework.boot") {
|
||||
useVersion("TEST-SNAPSHOT")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("slf4jVersion") {
|
||||
doLast {
|
||||
println(project.the<DependencyManagementExtension>().managedVersions["org.slf4j:slf4j-api"])
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
maven { url 'https://repo.spring.io/libs-milestone' }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'org.springframework.boot:spring-boot-gradle-plugin:{version-spring-boot}'
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '{version-spring-boot}' apply false
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
plugins {
|
||||
id("org.springframework.boot") version "{version-spring-boot}" apply false
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
maven { url 'https://repo.spring.io/libs-snapshot' }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'org.springframework.boot:spring-boot-gradle-plugin:{version-spring-boot}'
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
|
||||
// tag::dependencies[]
|
||||
dependencies {
|
||||
implementation('org.springframework.boot:spring-boot-starter-web')
|
||||
implementation('org.springframework.boot:spring-boot-starter-data-jpa')
|
||||
}
|
||||
// end::dependencies[]
|
||||
@@ -0,0 +1,13 @@
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
apply(plugin = "io.spring.dependency-management")
|
||||
|
||||
// tag::dependencies[]
|
||||
dependencies {
|
||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||
}
|
||||
// end::dependencies[]
|
||||
@@ -0,0 +1,11 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
// tag::main-class[]
|
||||
application {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
// end::main-class[]
|
||||
@@ -0,0 +1,11 @@
|
||||
plugins {
|
||||
java
|
||||
application
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::main-class[]
|
||||
application {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
// end::main-class[]
|
||||
@@ -0,0 +1,36 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
// tag::caches[]
|
||||
tasks.named("bootBuildImage") {
|
||||
buildWorkspace {
|
||||
bind {
|
||||
source = "/tmp/cache-${rootProject.name}.work"
|
||||
}
|
||||
}
|
||||
buildCache {
|
||||
bind {
|
||||
source = "/tmp/cache-${rootProject.name}.build"
|
||||
}
|
||||
}
|
||||
launchCache {
|
||||
bind {
|
||||
source = "/tmp/cache-${rootProject.name}.launch"
|
||||
}
|
||||
}
|
||||
}
|
||||
// end::caches[]
|
||||
|
||||
tasks.register("bootBuildImageCaches") {
|
||||
doFirst {
|
||||
bootBuildImage.buildWorkspace.asCache().with { print "buildWorkspace=$source" }
|
||||
bootBuildImage.buildCache.asCache().with { println "buildCache=$source" }
|
||||
bootBuildImage.launchCache.asCache().with { println "launchCache=$source" }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::caches[]
|
||||
tasks.named<BootBuildImage>("bootBuildImage") {
|
||||
buildWorkspace {
|
||||
bind {
|
||||
source.set("/tmp/cache-${rootProject.name}.work")
|
||||
}
|
||||
}
|
||||
buildCache {
|
||||
bind {
|
||||
source.set("/tmp/cache-${rootProject.name}.build")
|
||||
}
|
||||
}
|
||||
launchCache {
|
||||
bind {
|
||||
source.set("/tmp/cache-${rootProject.name}.launch")
|
||||
}
|
||||
}
|
||||
}
|
||||
// end::caches[]
|
||||
|
||||
tasks.register("bootBuildImageCaches") {
|
||||
doFirst {
|
||||
println("buildWorkspace=" + tasks.getByName<BootBuildImage>("bootBuildImage").buildWorkspace.asCache().bind.source)
|
||||
println("buildCache=" + tasks.getByName<BootBuildImage>("bootBuildImage").buildCache.asCache().bind.source)
|
||||
println("launchCache=" + tasks.getByName<BootBuildImage>("bootBuildImage").launchCache.asCache().bind.source)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
// tag::builder[]
|
||||
tasks.named("bootBuildImage") {
|
||||
builder = "mine/java-cnb-builder"
|
||||
runImage = "mine/java-cnb-run"
|
||||
}
|
||||
// end::builder[]
|
||||
|
||||
tasks.register("bootBuildImageBuilder") {
|
||||
doFirst {
|
||||
println("builder=${tasks.bootBuildImage.builder.get()}")
|
||||
println("runImage=${tasks.bootBuildImage.runImage.get()}")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
|
||||
// tag::builder[]
|
||||
tasks.named<BootBuildImage>("bootBuildImage") {
|
||||
builder.set("mine/java-cnb-builder")
|
||||
runImage.set("mine/java-cnb-run")
|
||||
}
|
||||
// end::builder[]
|
||||
|
||||
tasks.register("bootBuildImageBuilder") {
|
||||
doFirst {
|
||||
println("builder=${tasks.getByName<BootBuildImage>("bootBuildImage").builder.get()}")
|
||||
println("runImage=${tasks.getByName<BootBuildImage>("bootBuildImage").runImage.get()}")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
// tag::buildpacks[]
|
||||
tasks.named("bootBuildImage") {
|
||||
buildpacks = ["file:///path/to/example-buildpack.tgz", "urn:cnb:builder:paketo-buildpacks/java"]
|
||||
}
|
||||
// end::buildpacks[]
|
||||
|
||||
tasks.register("bootBuildImageBuildpacks") {
|
||||
doFirst {
|
||||
bootBuildImage.buildpacks.get().each { reference -> println "$reference" }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::buildpacks[]
|
||||
tasks.named<BootBuildImage>("bootBuildImage") {
|
||||
buildpacks.set(listOf("file:///path/to/example-buildpack.tgz", "urn:cnb:builder:paketo-buildpacks/java"))
|
||||
}
|
||||
// end::buildpacks[]
|
||||
|
||||
tasks.register("bootBuildImageBuildpacks") {
|
||||
doFirst {
|
||||
for(reference in tasks.getByName<BootBuildImage>("bootBuildImage").buildpacks.get()) {
|
||||
print(reference)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
// tag::caches[]
|
||||
tasks.named("bootBuildImage") {
|
||||
buildCache {
|
||||
volume {
|
||||
name = "cache-${rootProject.name}.build"
|
||||
}
|
||||
}
|
||||
launchCache {
|
||||
volume {
|
||||
name = "cache-${rootProject.name}.launch"
|
||||
}
|
||||
}
|
||||
}
|
||||
// end::caches[]
|
||||
|
||||
tasks.register("bootBuildImageCaches") {
|
||||
doFirst {
|
||||
bootBuildImage.buildCache.asCache().with { println "buildCache=$name" }
|
||||
bootBuildImage.launchCache.asCache().with { println "launchCache=$name" }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::caches[]
|
||||
tasks.named<BootBuildImage>("bootBuildImage") {
|
||||
buildCache {
|
||||
volume {
|
||||
name.set("cache-${rootProject.name}.build")
|
||||
}
|
||||
}
|
||||
launchCache {
|
||||
volume {
|
||||
name.set("cache-${rootProject.name}.launch")
|
||||
}
|
||||
}
|
||||
}
|
||||
// end::caches[]
|
||||
|
||||
tasks.register("bootBuildImageCaches") {
|
||||
doFirst {
|
||||
println("buildCache=" + tasks.getByName<BootBuildImage>("bootBuildImage").buildCache.asCache().volume.name)
|
||||
println("launchCache=" + tasks.getByName<BootBuildImage>("bootBuildImage").launchCache.asCache().volume.name)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
// tag::docker-auth-token[]
|
||||
tasks.named("bootBuildImage") {
|
||||
docker {
|
||||
builderRegistry {
|
||||
token = "9cbaf023786cd7..."
|
||||
}
|
||||
}
|
||||
}
|
||||
// end::docker-auth-token[]
|
||||
|
||||
tasks.register("bootBuildImageDocker") {
|
||||
doFirst {
|
||||
println("token=${tasks.bootBuildImage.docker.builderRegistry.token.get()}")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
|
||||
// tag::docker-auth-token[]
|
||||
tasks.named<BootBuildImage>("bootBuildImage") {
|
||||
docker {
|
||||
builderRegistry {
|
||||
token.set("9cbaf023786cd7...")
|
||||
}
|
||||
}
|
||||
}
|
||||
// end::docker-auth-token[]
|
||||
|
||||
tasks.register("bootBuildImageDocker") {
|
||||
doFirst {
|
||||
println("token=${tasks.getByName<BootBuildImage>("bootBuildImage").docker.builderRegistry.token.get()}")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
// tag::docker-auth-user[]
|
||||
tasks.named("bootBuildImage") {
|
||||
docker {
|
||||
builderRegistry {
|
||||
username = "user"
|
||||
password = "secret"
|
||||
url = "https://docker.example.com/v1/"
|
||||
email = "user@example.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
// end::docker-auth-user[]
|
||||
|
||||
tasks.register("bootBuildImageDocker") {
|
||||
doFirst {
|
||||
println("username=${tasks.bootBuildImage.docker.builderRegistry.username.get()}")
|
||||
println("password=${tasks.bootBuildImage.docker.builderRegistry.password.get()}")
|
||||
println("url=${tasks.bootBuildImage.docker.builderRegistry.url.get()}")
|
||||
println("email=${tasks.bootBuildImage.docker.builderRegistry.email.get()}")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
|
||||
// tag::docker-auth-user[]
|
||||
tasks.named<BootBuildImage>("bootBuildImage") {
|
||||
docker {
|
||||
builderRegistry {
|
||||
username.set("user")
|
||||
password.set("secret")
|
||||
url.set("https://docker.example.com/v1/")
|
||||
email.set("user@example.com")
|
||||
}
|
||||
}
|
||||
}
|
||||
// end::docker-auth-user[]
|
||||
|
||||
tasks.register("bootBuildImageDocker") {
|
||||
doFirst {
|
||||
println("username=${tasks.getByName<BootBuildImage>("bootBuildImage").docker.builderRegistry.username.get()}")
|
||||
println("password=${tasks.getByName<BootBuildImage>("bootBuildImage").docker.builderRegistry.password.get()}")
|
||||
println("url=${tasks.getByName<BootBuildImage>("bootBuildImage").docker.builderRegistry.url.get()}")
|
||||
println("email=${tasks.getByName<BootBuildImage>("bootBuildImage").docker.builderRegistry.email.get()}")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
// tag::docker-host[]
|
||||
tasks.named("bootBuildImage") {
|
||||
docker {
|
||||
host = "unix://${System.properties['user.home']}/.colima/docker.sock"
|
||||
}
|
||||
}
|
||||
// end::docker-host[]
|
||||
|
||||
tasks.register("bootBuildImageDocker") {
|
||||
doFirst {
|
||||
println("host=${tasks.bootBuildImage.docker.host.get()}")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
|
||||
// tag::docker-host[]
|
||||
tasks.named<BootBuildImage>("bootBuildImage") {
|
||||
docker {
|
||||
host.set("unix://${System.getProperty("user.home")}/.colima/docker.sock")
|
||||
}
|
||||
}
|
||||
// end::docker-host[]
|
||||
|
||||
tasks.register("bootBuildImageDocker") {
|
||||
doFirst {
|
||||
println("host=${tasks.getByName<BootBuildImage>("bootBuildImage").docker.host.get()}")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
// tag::docker-host[]
|
||||
tasks.named("bootBuildImage") {
|
||||
docker {
|
||||
host = "unix:///run/user/1000/podman/podman.sock"
|
||||
bindHostToBuilder = true
|
||||
}
|
||||
}
|
||||
// end::docker-host[]
|
||||
|
||||
tasks.register("bootBuildImageDocker") {
|
||||
doFirst {
|
||||
println("host=${tasks.bootBuildImage.docker.host.get()}")
|
||||
println("bindHostToBuilder=${tasks.bootBuildImage.docker.bindHostToBuilder.get()}")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
|
||||
// tag::docker-host[]
|
||||
tasks.named<BootBuildImage>("bootBuildImage") {
|
||||
docker {
|
||||
host.set("unix:///run/user/1000/podman/podman.sock")
|
||||
bindHostToBuilder.set(true)
|
||||
}
|
||||
}
|
||||
// end::docker-host[]
|
||||
|
||||
tasks.register("bootBuildImageDocker") {
|
||||
doFirst {
|
||||
println("host=${tasks.getByName<BootBuildImage>("bootBuildImage").docker.host.get()}")
|
||||
println("bindHostToBuilder=${tasks.getByName<BootBuildImage>("bootBuildImage").docker.bindHostToBuilder.get()}")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
// tag::docker-host[]
|
||||
tasks.named("bootBuildImage") {
|
||||
docker {
|
||||
host = "tcp://192.168.99.100:2376"
|
||||
tlsVerify = true
|
||||
certPath = "/home/user/.minikube/certs"
|
||||
}
|
||||
}
|
||||
// end::docker-host[]
|
||||
|
||||
tasks.register("bootBuildImageDocker") {
|
||||
doFirst {
|
||||
println("host=${tasks.bootBuildImage.docker.host.get()}")
|
||||
println("tlsVerify=${tasks.bootBuildImage.docker.tlsVerify.get()}")
|
||||
println("certPath=${tasks.bootBuildImage.docker.certPath.get()}")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
|
||||
// tag::docker-host[]
|
||||
tasks.named<BootBuildImage>("bootBuildImage") {
|
||||
docker {
|
||||
host.set("tcp://192.168.99.100:2376")
|
||||
tlsVerify.set(true)
|
||||
certPath.set("/home/user/.minikube/certs")
|
||||
}
|
||||
}
|
||||
// end::docker-host[]
|
||||
|
||||
tasks.register("bootBuildImageDocker") {
|
||||
doFirst {
|
||||
println("host=${tasks.getByName<BootBuildImage>("bootBuildImage").docker.host.get()}")
|
||||
println("tlsVerify=${tasks.getByName<BootBuildImage>("bootBuildImage").docker.tlsVerify.get()}")
|
||||
println("certPath=${tasks.getByName<BootBuildImage>("bootBuildImage").docker.certPath.get()}")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
// tag::env[]
|
||||
tasks.named("bootBuildImage") {
|
||||
environment["HTTP_PROXY"] = "http://proxy.example.com"
|
||||
environment["HTTPS_PROXY"] = "https://proxy.example.com"
|
||||
}
|
||||
// end::env[]
|
||||
|
||||
tasks.register("bootBuildImageEnvironment") {
|
||||
doFirst {
|
||||
bootBuildImage.environment.get().each { name, value -> println "$name=$value" }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::env[]
|
||||
tasks.named<BootBuildImage>("bootBuildImage") {
|
||||
environment.set(mapOf("HTTP_PROXY" to "http://proxy.example.com",
|
||||
"HTTPS_PROXY" to "https://proxy.example.com"))
|
||||
}
|
||||
// end::env[]
|
||||
|
||||
tasks.register("bootBuildImageEnvironment") {
|
||||
doFirst {
|
||||
for((name, value) in tasks.getByName<BootBuildImage>("bootBuildImage").environment.get()) {
|
||||
print(name + "=" + value)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
// tag::env-runtime[]
|
||||
tasks.named("bootBuildImage") {
|
||||
environment["BPE_DELIM_JAVA_TOOL_OPTIONS"] = " "
|
||||
environment["BPE_APPEND_JAVA_TOOL_OPTIONS"] = "-XX:+HeapDumpOnOutOfMemoryError"
|
||||
}
|
||||
// end::env-runtime[]
|
||||
|
||||
tasks.register("bootBuildImageEnvironment") {
|
||||
doFirst {
|
||||
bootBuildImage.environment.get().each { name, value -> println "$name=$value" }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::env-runtime[]
|
||||
tasks.named<BootBuildImage>("bootBuildImage") {
|
||||
environment.set(mapOf(
|
||||
"BPE_DELIM_JAVA_TOOL_OPTIONS" to " ",
|
||||
"BPE_APPEND_JAVA_TOOL_OPTIONS" to "-XX:+HeapDumpOnOutOfMemoryError"
|
||||
))
|
||||
}
|
||||
// end::env-runtime[]
|
||||
|
||||
tasks.register("bootBuildImageEnvironment") {
|
||||
doFirst {
|
||||
for((name, value) in tasks.getByName<BootBuildImage>("bootBuildImage").environment.get()) {
|
||||
print(name + "=" + value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
// tag::env[]
|
||||
tasks.named("bootBuildImage") {
|
||||
environment["BP_JVM_VERSION"] = "17"
|
||||
}
|
||||
// end::env[]
|
||||
|
||||
tasks.register("bootBuildImageEnvironment") {
|
||||
doFirst {
|
||||
bootBuildImage.environment.get().each { name, value -> println "$name=$value" }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::env[]
|
||||
tasks.named<BootBuildImage>("bootBuildImage") {
|
||||
environment.set(environment.get() + mapOf("BP_JVM_VERSION" to "17"))
|
||||
}
|
||||
// end::env[]
|
||||
|
||||
tasks.register("bootBuildImageEnvironment") {
|
||||
doFirst {
|
||||
for((name, value) in tasks.getByName<BootBuildImage>("bootBuildImage").environment.get()) {
|
||||
print(name + "=" + value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
// tag::image-name[]
|
||||
tasks.named("bootBuildImage") {
|
||||
imageName = "example.com/library/${project.name}"
|
||||
}
|
||||
// end::image-name[]
|
||||
|
||||
tasks.register("bootBuildImageName") {
|
||||
doFirst {
|
||||
println(tasks.bootBuildImage.imageName.get())
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::image-name[]
|
||||
tasks.named<BootBuildImage>("bootBuildImage") {
|
||||
imageName.set("example.com/library/${project.name}")
|
||||
}
|
||||
// end::image-name[]
|
||||
|
||||
tasks.register("bootBuildImageName") {
|
||||
doFirst {
|
||||
println(tasks.getByName<BootBuildImage>("bootBuildImage").imageName.get())
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
// tag::publish[]
|
||||
tasks.named("bootBuildImage") {
|
||||
imageName.set("docker.example.com/library/${project.name}")
|
||||
publish = true
|
||||
docker {
|
||||
publishRegistry {
|
||||
username = "user"
|
||||
password = "secret"
|
||||
}
|
||||
}
|
||||
}
|
||||
// end::publish[]
|
||||
|
||||
tasks.register("bootBuildImagePublish") {
|
||||
doFirst {
|
||||
println(tasks.bootBuildImage.publish.get())
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
|
||||
// tag::publish[]
|
||||
tasks.named<BootBuildImage>("bootBuildImage") {
|
||||
imageName.set("docker.example.com/library/${project.name}")
|
||||
publish.set(true)
|
||||
docker {
|
||||
publishRegistry {
|
||||
username.set("user")
|
||||
password.set("secret")
|
||||
}
|
||||
}
|
||||
}
|
||||
// end::publish[]
|
||||
|
||||
tasks.register("bootBuildImagePublish") {
|
||||
doFirst {
|
||||
println(tasks.getByName<BootBuildImage>("bootBuildImage").publish.get())
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
// tag::classifiers[]
|
||||
tasks.named("bootJar") {
|
||||
archiveClassifier = 'boot'
|
||||
}
|
||||
|
||||
tasks.named("jar") {
|
||||
archiveClassifier = ''
|
||||
}
|
||||
// end::classifiers[]
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.Application'
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::classifiers[]
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
archiveClassifier.set("boot")
|
||||
}
|
||||
|
||||
tasks.named<Jar>("jar") {
|
||||
archiveClassifier.set("")
|
||||
}
|
||||
// end::classifiers[]
|
||||
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
mainClass.set("com.example.Application")
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
// tag::custom-launch-script[]
|
||||
tasks.named("bootJar") {
|
||||
launchScript {
|
||||
script = file('src/custom.script')
|
||||
}
|
||||
}
|
||||
// end::custom-launch-script[]
|
||||
@@ -0,0 +1,18 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
|
||||
// tag::custom-launch-script[]
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
launchScript {
|
||||
script = file("src/custom.script")
|
||||
}
|
||||
}
|
||||
// end::custom-launch-script[]
|
||||
@@ -0,0 +1,14 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
// tag::include-launch-script[]
|
||||
tasks.named("bootJar") {
|
||||
launchScript()
|
||||
}
|
||||
// end::include-launch-script[]
|
||||
@@ -0,0 +1,16 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
|
||||
// tag::include-launch-script[]
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
launchScript()
|
||||
}
|
||||
// end::include-launch-script[]
|
||||
@@ -0,0 +1,16 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
// tag::launch-script-properties[]
|
||||
tasks.named("bootJar") {
|
||||
launchScript {
|
||||
properties 'logFilename': 'example-app.log'
|
||||
}
|
||||
}
|
||||
// end::launch-script-properties[]
|
||||
@@ -0,0 +1,18 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
|
||||
// tag::launch-script-properties[]
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
launchScript {
|
||||
properties(mapOf("logFilename" to "example-app.log"))
|
||||
}
|
||||
}
|
||||
// end::launch-script-properties[]
|
||||
@@ -0,0 +1,31 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
// tag::layered[]
|
||||
tasks.named("bootJar") {
|
||||
layered {
|
||||
application {
|
||||
intoLayer("spring-boot-loader") {
|
||||
include "org/springframework/boot/loader/**"
|
||||
}
|
||||
intoLayer("application")
|
||||
}
|
||||
dependencies {
|
||||
intoLayer("application") {
|
||||
includeProjectDependencies()
|
||||
}
|
||||
intoLayer("snapshot-dependencies") {
|
||||
include "*:*:*SNAPSHOT"
|
||||
}
|
||||
intoLayer("dependencies")
|
||||
}
|
||||
layerOrder = ["dependencies", "spring-boot-loader", "snapshot-dependencies", "application"]
|
||||
}
|
||||
}
|
||||
// end::layered[]
|
||||
@@ -0,0 +1,33 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
|
||||
// tag::layered[]
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
layered {
|
||||
application {
|
||||
intoLayer("spring-boot-loader") {
|
||||
include("org/springframework/boot/loader/**")
|
||||
}
|
||||
intoLayer("application")
|
||||
}
|
||||
dependencies {
|
||||
intoLayer("application") {
|
||||
includeProjectDependencies()
|
||||
}
|
||||
intoLayer("snapshot-dependencies") {
|
||||
include("*:*:*SNAPSHOT")
|
||||
}
|
||||
intoLayer("dependencies")
|
||||
}
|
||||
layerOrder.set(listOf("dependencies", "spring-boot-loader", "snapshot-dependencies", "application"))
|
||||
}
|
||||
}
|
||||
// end::layered[]
|
||||
@@ -0,0 +1,16 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
// tag::layered[]
|
||||
tasks.named("bootJar") {
|
||||
layered {
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
// end::layered[]
|
||||
@@ -0,0 +1,18 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
|
||||
// tag::layered[]
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
layered {
|
||||
enabled.set(false)
|
||||
}
|
||||
}
|
||||
// end::layered[]
|
||||
@@ -0,0 +1,16 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
// tag::layered[]
|
||||
tasks.named("bootJar") {
|
||||
layered {
|
||||
includeLayerTools = false
|
||||
}
|
||||
}
|
||||
// end::layered[]
|
||||
@@ -0,0 +1,18 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
|
||||
// tag::layered[]
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
layered {
|
||||
includeLayerTools.set(false)
|
||||
}
|
||||
}
|
||||
// end::layered[]
|
||||
@@ -0,0 +1,10 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
// tag::main-class[]
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
// end::main-class[]
|
||||
@@ -0,0 +1,12 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::main-class[]
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
// end::main-class[]
|
||||
@@ -0,0 +1,12 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
// tag::main-class[]
|
||||
tasks.named("bootJar") {
|
||||
manifest {
|
||||
attributes 'Start-Class': 'com.example.ExampleApplication'
|
||||
}
|
||||
}
|
||||
// end::main-class[]
|
||||
@@ -0,0 +1,14 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::main-class[]
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
manifest {
|
||||
attributes("Start-Class" to "com.example.ExampleApplication")
|
||||
}
|
||||
}
|
||||
// end::main-class[]
|
||||
@@ -0,0 +1,22 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
runtimeOnly('org.jruby:jruby-complete:1.7.25')
|
||||
}
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
// tag::requires-unpack[]
|
||||
tasks.named("bootJar") {
|
||||
requiresUnpack '**/jruby-complete-*.jar'
|
||||
}
|
||||
// end::requires-unpack[]
|
||||
@@ -0,0 +1,24 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
runtimeOnly("org.jruby:jruby-complete:1.7.25")
|
||||
}
|
||||
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
|
||||
// tag::requires-unpack[]
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
requiresUnpack("**/jruby-complete-*.jar")
|
||||
}
|
||||
// end::requires-unpack[]
|
||||
@@ -0,0 +1,18 @@
|
||||
plugins {
|
||||
id 'war'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
tasks.named("bootWar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
developmentOnly files("spring-boot-devtools-1.2.3.RELEASE.jar")
|
||||
}
|
||||
|
||||
// tag::include-devtools[]
|
||||
tasks.named("bootWar") {
|
||||
classpath configurations.developmentOnly
|
||||
}
|
||||
// end::include-devtools[]
|
||||
@@ -0,0 +1,20 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootWar
|
||||
|
||||
plugins {
|
||||
war
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
tasks.named<BootWar>("bootWar") {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
"developmentOnly"(files("spring-boot-devtools-1.2.3.RELEASE.jar"))
|
||||
}
|
||||
|
||||
// tag::include-devtools[]
|
||||
tasks.named<BootWar>("bootWar") {
|
||||
classpath(configurations["developmentOnly"])
|
||||
}
|
||||
// end::include-devtools[]
|
||||
@@ -0,0 +1,16 @@
|
||||
plugins {
|
||||
id 'war'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
tasks.named("bootWar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
// tag::properties-launcher[]
|
||||
tasks.named("bootWar") {
|
||||
manifest {
|
||||
attributes 'Main-Class': 'org.springframework.boot.loader.launch.PropertiesLauncher'
|
||||
}
|
||||
}
|
||||
// end::properties-launcher[]
|
||||
@@ -0,0 +1,18 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootWar
|
||||
|
||||
plugins {
|
||||
war
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
tasks.named<BootWar>("bootWar") {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
|
||||
// tag::properties-launcher[]
|
||||
tasks.named<BootWar>("bootWar") {
|
||||
manifest {
|
||||
attributes("Main-Class" to "org.springframework.boot.loader.launch.PropertiesLauncher")
|
||||
}
|
||||
}
|
||||
// end::properties-launcher[]
|
||||
@@ -0,0 +1,14 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
// tag::disable-jar[]
|
||||
tasks.named("jar") {
|
||||
enabled = false
|
||||
}
|
||||
// end::disable-jar[]
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.Application'
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::disable-jar[]
|
||||
tasks.named<Jar>("jar") {
|
||||
enabled = false
|
||||
}
|
||||
// end::disable-jar[]
|
||||
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
mainClass.set("com.example.Application")
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
// tag::main-class[]
|
||||
springBoot {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
// end::main-class[]
|
||||
@@ -0,0 +1,10 @@
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::main-class[]
|
||||
springBoot {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
// end::main-class[]
|
||||
@@ -0,0 +1,13 @@
|
||||
plugins {
|
||||
id 'war'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
|
||||
// tag::dependencies[]
|
||||
dependencies {
|
||||
implementation('org.springframework.boot:spring-boot-starter-web')
|
||||
providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
|
||||
}
|
||||
// end::dependencies[]
|
||||
@@ -0,0 +1,13 @@
|
||||
plugins {
|
||||
war
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
apply(plugin = "io.spring.dependency-management")
|
||||
|
||||
// tag::dependencies[]
|
||||
dependencies {
|
||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||
providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
|
||||
}
|
||||
// end::dependencies[]
|
||||
@@ -0,0 +1,27 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'maven-publish'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
// tag::publishing[]
|
||||
publishing {
|
||||
publications {
|
||||
bootJava(MavenPublication) {
|
||||
artifact tasks.named("bootJar")
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
url 'https://repo.example.com'
|
||||
}
|
||||
}
|
||||
}
|
||||
// end::publishing[]
|
||||
|
||||
tasks.register("publishingConfiguration") {
|
||||
doLast {
|
||||
println publishing.publications.bootJava
|
||||
println publishing.repositories.maven.url
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
plugins {
|
||||
java
|
||||
`maven-publish`
|
||||
id("org.springframework.boot") version "{version-spring-boot}"
|
||||
}
|
||||
|
||||
// tag::publishing[]
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("bootJava") {
|
||||
artifact(tasks.named("bootJar"))
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("https://repo.example.com")
|
||||
}
|
||||
}
|
||||
}
|
||||
// end::publishing[]
|
||||
|
||||
tasks.register("publishingConfiguration") {
|
||||
doLast {
|
||||
println(publishing.publications["bootJava"])
|
||||
println(publishing.repositories.getByName<MavenArtifactRepository>("maven").url)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version-spring-boot}'
|
||||
}
|
||||
|
||||
// tag::main-class[]
|
||||
application {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
// end::main-class[]
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user