From b798b5a40b6feb305ee6c9fbc0a90a22d706328c Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 1 Dec 2016 14:27:12 +0000 Subject: [PATCH] Update docs to reflect Gradle plugin being available in the Plugin Portal Closes gh-1567 --- .../src/main/asciidoc/build-tool-plugins.adoc | 29 ++++++++++--------- .../src/main/asciidoc/deployment.adoc | 2 -- .../src/main/asciidoc/getting-started.adoc | 20 ++++++++----- .../src/main/asciidoc/using-spring-boot.adoc | 29 +++++++++---------- 4 files changed, 42 insertions(+), 38 deletions(-) diff --git a/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc b/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc index d74ebf643a..569d15fa37 100644 --- a/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc +++ b/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc @@ -172,32 +172,33 @@ dependency management provided by `spring-boot-dependencies`. [[build-tool-plugins-including-the-gradle-plugin]] === Including the plugin -To use the Spring Boot Gradle Plugin simply include a `buildscript` dependency and apply -the `spring-boot` plugin: - +ifeval::["{spring-boot-repo}" == "release"] +To use the Spring Boot Gradle Plugin configure it using the `plugins` block: [source,groovy,indent=0,subs="verbatim,attributes"] ---- - buildscript { - dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:{spring-boot-version}") - } + plugins { + id 'org.springframework.boot' version '{spring-boot-version}' } - apply plugin: 'org.springframework.boot' ---- - -If you are using a milestone or snapshot release you will also need to add appropriate -`repositories` reference: +endif::[] +ifeval::["{spring-boot-repo}" != "release"] +To use the Spring Boot Gradle Plugin simply include a `buildscript` dependency and apply +the `spring-boot` plugin: [source,groovy,indent=0,subs="verbatim,attributes"] ---- buildscript { repositories { - maven.url "http://repo.spring.io/snapshot" - maven.url "http://repo.spring.io/milestone" + maven { url 'http://repo.spring.io/snapshot' } + maven { url 'http://repo.spring.io/milestone' } + } + dependencies { + classpath 'org.springframework.boot:spring-boot-gradle-plugin:{spring-boot-version}'' } - // ... } + apply plugin: 'org.springframework.boot' ---- +endif::[] diff --git a/spring-boot-docs/src/main/asciidoc/deployment.adoc b/spring-boot-docs/src/main/asciidoc/deployment.adoc index 2c2f060d4e..dfb6946ad1 100644 --- a/spring-boot-docs/src/main/asciidoc/deployment.adoc +++ b/spring-boot-docs/src/main/asciidoc/deployment.adoc @@ -387,8 +387,6 @@ With Gradle, the equivalent configuration would be: [source,groovy,indent=0,subs="verbatim,quotes,attributes"] ---- - apply plugin: 'org.springframework.boot' - springBoot { executable = true } diff --git a/spring-boot-docs/src/main/asciidoc/getting-started.adoc b/spring-boot-docs/src/main/asciidoc/getting-started.adoc index 9dc89349c7..a35ed6050a 100644 --- a/spring-boot-docs/src/main/asciidoc/getting-started.adoc +++ b/spring-boot-docs/src/main/asciidoc/getting-started.adoc @@ -226,22 +226,28 @@ Here is a typical `build.gradle` file: [source,groovy,indent=0,subs="verbatim,attributes"] ---- +ifeval::["{spring-boot-repo}" == "release"] + plugins { + id 'org.springframework.boot' version '{spring-boot-version}' + id 'java' + } +endif::[] +ifeval::["{spring-boot-repo}" != "release"] buildscript { repositories { jcenter() -ifndef::release[] - maven { url "http://repo.spring.io/snapshot" } - maven { url "http://repo.spring.io/milestone" } -endif::release[] + maven { url 'http://repo.spring.io/snapshot' } + maven { url 'http://repo.spring.io/milestone' } } dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:{spring-boot-version}") + classpath 'org.springframework.boot:spring-boot-gradle-plugin:{spring-boot-version}' } } apply plugin: 'java' apply plugin: 'org.springframework.boot' +endif::[] jar { baseName = 'myproject' version = '0.0.1-SNAPSHOT' @@ -249,10 +255,10 @@ endif::release[] repositories { jcenter() -ifndef::release[] +ifeval::["{spring-boot-repo}" != "release"] maven { url "http://repo.spring.io/snapshot" } maven { url "http://repo.spring.io/milestone" } -endif::release[] +endif::[] } dependencies { diff --git a/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc b/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc index 507396dbe5..587b2484ca 100644 --- a/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc +++ b/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc @@ -214,8 +214,6 @@ Maven, there is no "`super parent`" to import to share some configuration. [source,groovy,indent=0,subs="attributes"] ---- - apply plugin: 'java' - repositories { ifeval::["{spring-boot-repo}" != "release"] maven { url "http://repo.spring.io/snapshot" } @@ -240,32 +238,33 @@ managed by Spring Boot: [source,groovy,indent=0,subs="attributes"] ---- +ifeval::["{spring-boot-repo}" == "release"] + plugins { + id 'org.springframework.boot' version '{spring-boot-version}' + id 'java' + } +endif::[] +ifeval::["{spring-boot-repo}" != "release"] buildscript { repositories { -ifeval::["{spring-boot-repo}" != "release"] - maven { url "http://repo.spring.io/snapshot" } - maven { url "http://repo.spring.io/milestone" } -endif::[] -ifeval::["{spring-boot-repo}" == "release"] jcenter() -endif::[] + maven { url 'http://repo.spring.io/snapshot' } + maven { url 'http://repo.spring.io/milestone' } } - dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:{spring-boot-version}") + classpath 'org.springframework.boot:spring-boot-gradle-plugin:{spring-boot-version}' } } apply plugin: 'java' apply plugin: 'org.springframework.boot' +endif::[] repositories { -ifeval::["{spring-boot-repo}" != "release"] - maven { url "http://repo.spring.io/snapshot" } - maven { url "http://repo.spring.io/milestone" } -endif::[] -ifeval::["{spring-boot-repo}" == "release"] jcenter() +ifeval::["{spring-boot-repo}" != "release"] + maven { url 'http://repo.spring.io/snapshot' } + maven { url 'http://repo.spring.io/milestone' } endif::[] }