Skip to content

Commit e772174

Browse files
committed
Update reference documentation for Spring Boot 1.2
Various updates and polish to prepare the reference documentation for Spring Boot 1.2. Fixes gh-1903
1 parent a0ce04a commit e772174

File tree

8 files changed

+202
-119
lines changed

8 files changed

+202
-119
lines changed

spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ unsupported build system. If you are just getting started, you might want to rea
1717
== Spring Boot Maven plugin
1818
The {spring-boot-maven-plugin-site}/[Spring Boot Maven Plugin] provides Spring Boot
1919
support in Maven, allowing you to package executable jar or war archives and run an
20-
application "`in-place`". To use it you must be using Maven 3 (or better).
20+
application "`in-place`". To use it you must be using Maven 3.2 (or better).
2121

2222
NOTE: Refer to the {spring-boot-maven-plugin-site}/[Spring Boot Maven Plugin Site]
2323
for complete plugin documentation.

spring-boot-docs/src/main/asciidoc/cloud-deployment.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ access application information (such as the public URL of the application) and s
135135
information (such as database credentials). See `VcapApplicationListener` Javdoc for
136136
complete details.
137137

138-
TIP: The https://github.com/spring-projects/spring-cloud[Spring Cloud] project is a better
139-
fit for tasks such as configuring a DataSource; it also lets you use Spring Cloud with
140-
Heroku.
138+
TIP: The http://cloud.spring.io/spring-cloud-connectors/[Spring Cloud Connectors] project
139+
is a better fit for tasks such as configuring a DataSource. Spring Boot includes
140+
auto-configuration support and a `spring-boot-starter-cloud-connectors` starter POM.
141141

142142

143143

@@ -187,7 +187,7 @@ This should be everything you need. The most common workflow for Heroku deployme
187187
188188
-----> Java app detected
189189
-----> Installing OpenJDK 1.7... *done*
190-
-----> Installing Maven 3.0.3... *done*
190+
-----> Installing Maven 3.2.3... *done*
191191
-----> Installing settings.xml... *done*
192192
-----> executing /app/tmp/cache/.maven/bin/mvn -B
193193
-Duser.home=/tmp/build_0c35a5d2-a067-4abc-a232-14b1fb7a8229

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ build tool that supports dependency management (such as Maven or Gradle).
109109

110110
[[getting-started-maven-installation]]
111111
==== Maven installation
112-
Spring Boot is compatible with Apache Maven 3.0 or above. If you don't already have Maven
112+
Spring Boot is compatible with Apache Maven 3.2 or above. If you don't already have Maven
113113
installed you can follow the instructions at http://maven.apache.org.
114114

115115
TIP: On many operating systems Maven can be installed via a package manager. If you're an
@@ -199,7 +199,7 @@ scope.
199199

200200
[[getting-started-gradle-installation]]
201201
==== Gradle installation
202-
Spring Boot is compatible with Gradle 1.6 or above. If you don't already have Gradle
202+
Spring Boot is compatible with Gradle 1.12 or above. If you don't already have Gradle
203203
installed you can follow the instructions at http://www.gradle.org/.
204204

205205
Spring Boot dependencies can be declared using the `org.springframework.boot` `group`.
@@ -449,7 +449,7 @@ installed.
449449
[indent=0]
450450
----
451451
$ mvn -v
452-
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 08:22:22-0700)
452+
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T13:58:10-07:00)
453453
Maven home: /Users/user/tools/apache-maven-3.1.1
454454
Java version: 1.7.0_51, vendor: Oracle Corporation
455455
----
@@ -511,7 +511,7 @@ endif::[]
511511
----
512512

513513
This should give you a working build, you can test it out by running `mvn package` (you
514-
can ignore the '"`jar will be empty - no content was marked for inclusion!'`"' warning for
514+
can ignore the "`jar will be empty - no content was marked for inclusion!'`" warning for
515515
now).
516516

517517
NOTE: At this point you could import the project into an IDE (most modern Java IDE's
@@ -768,7 +768,7 @@ To run that application, use the `java -jar` command:
768768
....... . . .
769769
....... . . . (log output here)
770770
....... . . .
771-
........ Started Example in 3.236 seconds (JVM running for 3.764)
771+
........ Started Example in 2.536 seconds (JVM running for 2.864)
772772
----
773773

774774
As before, to gracefully exit the application hit `ctrl-c`.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,16 +2135,16 @@ Once the war is working we make it executable by adding a `main` method to our
21352135

21362136
Applications can fall into more than one category:
21372137

2138-
* Servlet 3.0 applications with no `web.xml`.
2138+
* Servlet 3.0+ applications with no `web.xml`.
21392139
* Applications with a `web.xml`.
21402140
* Applications with a context hierarchy.
21412141
* Applications without a context hierarchy.
21422142

21432143
All of these should be amenable to translation, but each might require slightly different
21442144
tricks.
21452145

2146-
Servlet 3.0 applications might translate pretty easily if they already use the Spring
2147-
Servlet 3.0 initializer support classes. Normally all the code from an existing
2146+
Servlet 3.0+ applications might translate pretty easily if they already use the Spring
2147+
Servlet 3.0+ initializer support classes. Normally all the code from an existing
21482148
`WebApplicationInitializer` can be moved into a `SpringBootServletInitializer`. If your
21492149
existing application has more than one `ApplicationContext` (e.g. if it uses
21502150
`AbstractDispatcherServletInitializer`) then you might be able to squash all your context

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

Lines changed: 50 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ in your `ApplicationContext`. Spring Boot includes a number of auto-configured
155155

156156
=== Security with HealthIndicators
157157
Information returned by `HealthIndicators` is often somewhat sensitive in nature. For
158-
example and you probably don't want to publish details of your database server to the
159-
world. For this reason, by default, only the health status is exposed on an insecure HTTP
160-
connection. If you are happy for complete heath information to always be exposed you can
161-
set `endpoints.health.sensitive` to `false`.
158+
example, you probably don't want to publish details of your database server to the
159+
world. For this reason, by default, only the health status is exposed over an
160+
unauthenticated HTTP connection. If you are happy for complete heath information to always
161+
be exposed you can set `endpoints.health.sensitive` to `false`.
162162

163163
Heath responses are also cached to prevent "`denial of service`" attacks. Use the
164164
`endpoints.health.time-to-live` property if you want to change the default cache period
@@ -169,6 +169,7 @@ of 1000 milliseconds.
169169
==== Auto-configured HealthIndicators
170170
The following `HealthIndicators` are auto-configured by Spring Boot when appropriate:
171171

172+
[cols="1,4"]
172173
|===
173174
|Name |Description
174175

@@ -220,9 +221,9 @@ additional details to be displayed.
220221
}
221222
----
222223

223-
In addition to Spring Boot's default {sc-spring-boot-actuator}/health/Status.{sc-ext}[`Status`]
224-
types, it is also possible to introduce custom `Status` types to represent more
225-
complex system states. In such cases a custom implementation of the
224+
In addition to Spring Boot's predefined {sc-spring-boot-actuator}/health/Status.{sc-ext}[`Status`]
225+
types, it is also possible for `Health` to return a custom `Status` that represents a
226+
new system state. In such cases a custom implementation of the
226227
{sc-spring-boot-actuator}/health/HealthAggregator.{sc-ext}[`HealthAggregator`]
227228
interface also needs to be provided, or the default implementation has to be configured
228229
using the `management.health.status.order` configuration property.
@@ -277,7 +278,7 @@ Maven '`project properties`' via `@..@` placeholders, e.g.
277278
project.name=Demo
278279
project.version=X.X.X.X
279280
project.description=Demo project for info endpoint
280-
info.build.artifact=${project.artifactId}
281+
info.build.artifact=@project.artifactId@
281282
282283
283284
@@ -367,16 +368,17 @@ for Gradle users, although a little more work is required to generate the proper
367368
[[production-ready-monitoring]]
368369
== Monitoring and management over HTTP
369370
If you are developing a Spring MVC application, Spring Boot Actuator will auto-configure
370-
all non-sensitive endpoints to be exposed over HTTP. The default convention is to use the
371+
all enabled endpoints to be exposed over HTTP. The default convention is to use the
371372
`id` of the endpoint as the URL path. For example, `health` is exposed as `/health`.
372373

373374

374375

375376
[[production-ready-sensitive-endpoints]]
376-
=== Exposing sensitive endpoints
377-
If you use '`Spring Security`' sensitive endpoints will be exposed over HTTP, but also
378-
protected. By default '`basic`' authentication will be used with the username `user`
379-
and a generated password (which is printed on the console when the application starts).
377+
=== Securing sensitive endpoints
378+
If you add '`Spring Security`' to you project, all sensitive endpoints exposed over HTTP
379+
will be protected. By default '`basic`' authentication will be used with the username
380+
`user` and a generated password (which is printed on the console when the application
381+
starts).
380382

381383
TIP: Generated passwords are logged as the application starts. Search for '`Using default
382384
security password`'.
@@ -760,6 +762,23 @@ NOTE: In this example we are actually accessing the endpoint over HTTP using the
760762

761763

762764

765+
[[production-ready-system-metrics]]
766+
=== System metrics
767+
The following system metrics are exposed by Spring Boot:
768+
769+
* The total system memory in Kb (`mem`)
770+
* The amount of free memory in Kb (`mem.free`)
771+
* The number of processors (`processors`)
772+
* The system uptime in milliseconds (`uptime`)
773+
* The application context uptime in milliseconds (`instance.uptime`)
774+
* The average system load (`systemload.average`)
775+
* Heap information in Kb (`heap`, `heap.committed`, `heap.init`, `heap.used`)
776+
* Thread information (`threads`, `thread.peak`, `thead.daemon`)
777+
* Class load information (`classes`, `classes.loaded`, `classes.unloaded`)
778+
* Garbage collection information (`gc.xxx.count`, `gc.xxx.time`)
779+
780+
781+
763782
[[production-ready-datasource-metrics]]
764783
=== DataSource metrics
765784
The following metrics are exposed for each supported `DataSource` defined in your
@@ -788,6 +807,14 @@ beans if your favorite data source isn't supported out of the box. See
788807

789808

790809

810+
[[production-ready-session-metrics]]
811+
=== Tomcat session metrics
812+
If you are using Tomcat as your embedded servlet container, session metrics will
813+
automatically be exposed. The `httpsessions.active` and `httpsessions.max` keys provide
814+
the number of active and maximum sessions.
815+
816+
817+
791818
[[production-ready-recording-metrics]]
792819
=== Recording your own metrics
793820
To record your own metrics inject a
@@ -857,14 +884,16 @@ an `Exporter` interface and a few basic implementations for you to get started w
857884

858885

859886
[[production-ready-code-hale-metrics]]
860-
=== Coda Hale Metrics
861-
User of the http://metrics.codahale.com/[Coda Hale '`Metrics`' library] will automatically
862-
find that Spring Boot metrics are published to `com.codahale.metrics.MetricRegistry`. A
863-
default `com.codahale.metrics.MetricRegistry` Spring bean will be created when you declare
864-
a dependency to the `com.codahale.metrics:metrics-core` library; you can also register you
865-
own `@Bean` instance if you need customizations.
866-
867-
Users can create Coda Hale metrics by prefixing their metric names with the appropriate
887+
=== Dropwizard Metrics
888+
User of the https://dropwizard.github.io/metrics/[Dropwizard '`Metrics`' library] will
889+
automatically find that Spring Boot metrics are published to
890+
`com.codahale.metrics.MetricRegistry`. A default `com.codahale.metrics.MetricRegistry`
891+
Spring bean will be created when you declare a dependency to the
892+
`io.dropwizard.metrics:metrics-core` library; you can also register you own `@Bean`
893+
instance if you need customizations. Metrics from the `MetricRegistry` are also
894+
automatically exposed via the `/metrics` endpoint
895+
896+
Users can create Dropwizard metrics by prefixing their metric names with the appropriate
868897
type (e.g. `+histogram.*+`, `+meter.*+`).
869898

870899

0 commit comments

Comments
 (0)