Skip to content

Commit

Permalink
Revert "Remove test dependencies from spring-boot-starter-parent"
Browse files Browse the repository at this point in the history
This reverts commit 5ded496.

Fixes gh-628
  • Loading branch information
Phillip Webb committed Apr 7, 2014
1 parent 2bb0f74 commit 1351759
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 7 deletions.
11 changes: 8 additions & 3 deletions spring-boot-docs/src/main/asciidoc/getting-started.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ endif::release[]
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
testCompile("org.springframework.boot:spring-boot-starter-test")
testCompile("junit:junit")
}
----

Expand Down Expand Up @@ -478,11 +478,16 @@ 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` provides no
dependenciesby itself. Let's edit our `pom.xml` and add the `spring-boot-starter-web` dependency
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
just below the `parent` section:

[source,xml,indent=0,subs="verbatim,quotes,attributes"]
Expand Down
8 changes: 4 additions & 4 deletions spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1436,19 +1436,19 @@ documentation].
[[boot-features-testing]]
== Testing
Spring Boot provides a number of useful tools for testing your application. The
`spring-boot-starter-test` POM provides Spring Test, JUnit, Hamcrest and Mockito
`spring-boot-starter-parent` POM provides JUnit, Hamcrest and Mockito ``test'' `scope`
dependencies. There are also useful test utilities in the core `spring-boot` module
under the `org.springframework.boot.test` package.
under the `org.springframework.boot.test` package. There is also a
`spring-boot-starter-test` ``Starter POM''.



[[boot-features-test-scope-dependencies]]
=== Test scope dependencies
If you use the
If you extend your Maven project from the `spring-boot-starter-parent` POM, or 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.
Expand Down
3 changes: 3 additions & 0 deletions spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ defaults. The parent project provides the following features:
* UTF-8 source encoding.
* A Dependency Management section, allowing you to omit `<version>` 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],
Expand Down
18 changes: 18 additions & 0 deletions spring-boot-starters/spring-boot-starter-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,24 @@
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- Generally Useful Test Dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<!-- Turn on filtering by default for application properties -->
<resources>
Expand Down

0 comments on commit 1351759

Please sign in to comment.