From 5ded496dc32770148935574ff1c649799f251413 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Tue, 1 Apr 2014 11:30:20 +0100 Subject: [PATCH] Remove test dependencies from spring-boot-starter-parent Fixes gh-617 --- .../src/main/asciidoc/getting-started.adoc | 11 +++-------- .../main/asciidoc/spring-boot-features.adoc | 8 ++++---- .../src/main/asciidoc/using-spring-boot.adoc | 3 --- .../spring-boot-starter-parent/pom.xml | 18 ------------------ 4 files changed, 7 insertions(+), 33 deletions(-) diff --git a/spring-boot-docs/src/main/asciidoc/getting-started.adoc b/spring-boot-docs/src/main/asciidoc/getting-started.adoc index edec710ec0c..ac6adc97148 100644 --- a/spring-boot-docs/src/main/asciidoc/getting-started.adoc +++ b/spring-boot-docs/src/main/asciidoc/getting-started.adoc @@ -203,7 +203,7 @@ endif::release[] dependencies { compile("org.springframework.boot:spring-boot-starter-web") - testCompile("junit:junit") + testCompile("org.springframework.boot:spring-boot-starter-test") } ---- @@ -478,16 +478,11 @@ currently have. $ mvn dependency:tree [INFO] com.example:myproject:jar:0.0.1-SNAPSHOT - [INFO] +- junit:junit:jar:4.11:test - [INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test - [INFO] +- org.mockito:mockito-core:jar:1.9.5:test - [INFO] | \- org.objenesis:objenesis:jar:1.0:test - [INFO] \- org.hamcrest:hamcrest-library:jar:1.3:test ---- The `mvn dependency:tree` command prints tree representation of your project dependencies. -You can see that `spring-boot-starter-parent` has already provided some useful test -dependencies. Let's edit our `pom.xml` and add the `spring-boot-starter-web` dependency +You can see that `spring-boot-starter-parent` provides no +dependenciesby itself. Let's edit our `pom.xml` and add the `spring-boot-starter-web` dependency just below the `parent` section: [source,xml,indent=0,subs="verbatim,quotes,attributes"] diff --git a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index c3461e6de78..660fa19343b 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -1381,19 +1381,19 @@ documentation]. [[boot-features-testing]] == Testing Spring Boot provides a number of useful tools for testing your application. The -`spring-boot-starter-parent` POM provides JUnit, Hamcrest and Mockito ``test'' `scope` +`spring-boot-starter-test` POM provides Spring Test, JUnit, Hamcrest and Mockito dependencies. There are also useful test utilities in the core `spring-boot` module -under the `org.springframework.boot.test` package. There is also a -`spring-boot-starter-test` ``Starter POM''. +under the `org.springframework.boot.test` package. [[boot-features-test-scope-dependencies]] === Test scope dependencies -If you extend your Maven project from the `spring-boot-starter-parent` POM, or use the +If you use the `spring-boot-starter-test` ``Starter POM'' (in the `test` `scope`), you will find the following provided libraries: +* Spring Test -- integration test support for Spring applications. * Junit -- The de-facto standard for unit testing Java applications. * Hamcrest -- A library of matcher objects (also known as constraints or predicates) allowing `assertThat` style JUnit assertions. 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 adf747bc6c7..f0c138b4b06 100644 --- a/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc +++ b/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc @@ -36,9 +36,6 @@ defaults. The parent project provides the following features: * UTF-8 source encoding. * A Dependency Management section, allowing you to omit `` tags for common dependencies. -* Generally useful test dependencies (http://junit.org/[JUnit], - https://code.google.com/p/hamcrest/[Hamcrest], - https://code.google.com/p/mockito/[Mockito]). * Sensible https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html[resource filtering]. * Sensible plugin configuration (http://mojo.codehaus.org/exec-maven-plugin/[exec plugin], http://maven.apache.org/surefire/maven-surefire-plugin/[surefire], diff --git a/spring-boot-starters/spring-boot-starter-parent/pom.xml b/spring-boot-starters/spring-boot-starter-parent/pom.xml index ead23ccd039..36c352cac27 100644 --- a/spring-boot-starters/spring-boot-starter-parent/pom.xml +++ b/spring-boot-starters/spring-boot-starter-parent/pom.xml @@ -158,24 +158,6 @@ - - - - junit - junit - test - - - org.mockito - mockito-core - test - - - org.hamcrest - hamcrest-library - test - -