From 93ceb980bc0d85a3cb15455f33e7224a53a97336 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 19 Jul 2016 15:40:57 +0100 Subject: [PATCH] Recommend against using compileOnly in favour of providedRuntime Closes gh-5461 --- .../src/main/asciidoc/build-tool-plugins.adoc | 8 ++------ spring-boot-docs/src/main/asciidoc/howto.adoc | 5 +++++ 2 files changed, 7 insertions(+), 6 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 aed0c52227..e763bbfefa 100644 --- a/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc +++ b/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc @@ -267,8 +267,8 @@ To build and run a project artifact, you can type the following: ---- To build a war file that is both executable and deployable into an external container, -you need to mark the embedded container dependencies as belonging to a configuration -named "`providedRuntime`", e.g: +you need to mark the embedded container dependencies as belonging to the war plugin's +`providedRuntime` configuration, e.g.: [source,groovy,indent=0,subs="verbatim,attributes"] ---- @@ -285,10 +285,6 @@ named "`providedRuntime`", e.g: maven { url "http://repo.spring.io/libs-snapshot" } } - configurations { - providedRuntime - } - dependencies { compile("org.springframework.boot:spring-boot-starter-web") providedRuntime("org.springframework.boot:spring-boot-starter-tomcat") diff --git a/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-docs/src/main/asciidoc/howto.adoc index 56ad5472cf..5cfd1a9c95 100644 --- a/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -2917,6 +2917,11 @@ And if you're using Gradle: } ---- +NOTE: If you are using a version of Gradle that supports compile only dependencies (2.12 +or later), you should continue to use `providedRuntime`. Among other limitations, +`compileOnly` dependencies are not on the test classpath so any web-based integration +tests will fail. + If you're using the <>, marking the embedded servlet container dependency as provided will produce an executable war file with the provided dependencies packaged in a `lib-provided` directory. This means