Skip to content

Commit 5ded496

Browse files
author
Dave Syer
committed
Remove test dependencies from spring-boot-starter-parent
Fixes gh-617
1 parent ea2c491 commit 5ded496

File tree

4 files changed

+7
-33
lines changed

4 files changed

+7
-33
lines changed

spring-boot-docs/src/main/asciidoc/getting-started.adoc

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ endif::release[]
203203
204204
dependencies {
205205
compile("org.springframework.boot:spring-boot-starter-web")
206-
testCompile("junit:junit")
206+
testCompile("org.springframework.boot:spring-boot-starter-test")
207207
}
208208
----
209209

@@ -478,16 +478,11 @@ currently have.
478478
$ mvn dependency:tree
479479
480480
[INFO] com.example:myproject:jar:0.0.1-SNAPSHOT
481-
[INFO] +- junit:junit:jar:4.11:test
482-
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
483-
[INFO] +- org.mockito:mockito-core:jar:1.9.5:test
484-
[INFO] | \- org.objenesis:objenesis:jar:1.0:test
485-
[INFO] \- org.hamcrest:hamcrest-library:jar:1.3:test
486481
----
487482

488483
The `mvn dependency:tree` command prints tree representation of your project dependencies.
489-
You can see that `spring-boot-starter-parent` has already provided some useful test
490-
dependencies. Let's edit our `pom.xml` and add the `spring-boot-starter-web` dependency
484+
You can see that `spring-boot-starter-parent` provides no
485+
dependenciesby itself. Let's edit our `pom.xml` and add the `spring-boot-starter-web` dependency
491486
just below the `parent` section:
492487

493488
[source,xml,indent=0,subs="verbatim,quotes,attributes"]

spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,19 +1381,19 @@ documentation].
13811381
[[boot-features-testing]]
13821382
== Testing
13831383
Spring Boot provides a number of useful tools for testing your application. The
1384-
`spring-boot-starter-parent` POM provides JUnit, Hamcrest and Mockito ``test'' `scope`
1384+
`spring-boot-starter-test` POM provides Spring Test, JUnit, Hamcrest and Mockito
13851385
dependencies. There are also useful test utilities in the core `spring-boot` module
1386-
under the `org.springframework.boot.test` package. There is also a
1387-
`spring-boot-starter-test` ``Starter POM''.
1386+
under the `org.springframework.boot.test` package.
13881387

13891388

13901389

13911390
[[boot-features-test-scope-dependencies]]
13921391
=== Test scope dependencies
1393-
If you extend your Maven project from the `spring-boot-starter-parent` POM, or use the
1392+
If you use the
13941393
`spring-boot-starter-test` ``Starter POM'' (in the `test` `scope`), you will find
13951394
the following provided libraries:
13961395

1396+
* Spring Test -- integration test support for Spring applications.
13971397
* Junit -- The de-facto standard for unit testing Java applications.
13981398
* Hamcrest -- A library of matcher objects (also known as constraints or predicates)
13991399
allowing `assertThat` style JUnit assertions.

spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ defaults. The parent project provides the following features:
3636
* UTF-8 source encoding.
3737
* A Dependency Management section, allowing you to omit `<version>` tags for common
3838
dependencies.
39-
* Generally useful test dependencies (http://junit.org/[JUnit],
40-
https://code.google.com/p/hamcrest/[Hamcrest],
41-
https://code.google.com/p/mockito/[Mockito]).
4239
* Sensible https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html[resource filtering].
4340
* Sensible plugin configuration (http://mojo.codehaus.org/exec-maven-plugin/[exec plugin],
4441
http://maven.apache.org/surefire/maven-surefire-plugin/[surefire],

spring-boot-starters/spring-boot-starter-parent/pom.xml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -158,24 +158,6 @@
158158
</dependency>
159159
</dependencies>
160160
</dependencyManagement>
161-
<dependencies>
162-
<!-- Generally Useful Test Dependencies -->
163-
<dependency>
164-
<groupId>junit</groupId>
165-
<artifactId>junit</artifactId>
166-
<scope>test</scope>
167-
</dependency>
168-
<dependency>
169-
<groupId>org.mockito</groupId>
170-
<artifactId>mockito-core</artifactId>
171-
<scope>test</scope>
172-
</dependency>
173-
<dependency>
174-
<groupId>org.hamcrest</groupId>
175-
<artifactId>hamcrest-library</artifactId>
176-
<scope>test</scope>
177-
</dependency>
178-
</dependencies>
179161
<build>
180162
<!-- Turn on filtering by default for application properties -->
181163
<resources>

0 commit comments

Comments
 (0)