Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
f58b8366
Commit
f58b8366
authored
Oct 28, 2014
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct the syntax that's used for smart single and double quotes
Fixes gh-1753
parent
ae503c62
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
118 additions
and
118 deletions
+118
-118
appendix-auto-configuration-classes.adoc
...rc/main/asciidoc/appendix-auto-configuration-classes.adoc
+2
-2
appendix-executable-jar-format.adoc
...ocs/src/main/asciidoc/appendix-executable-jar-format.adoc
+3
-3
build-tool-plugins.adoc
spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc
+14
-14
cloud-deployment.adoc
spring-boot-docs/src/main/asciidoc/cloud-deployment.adoc
+6
-6
getting-started.adoc
spring-boot-docs/src/main/asciidoc/getting-started.adoc
+29
-29
howto.adoc
spring-boot-docs/src/main/asciidoc/howto.adoc
+13
-13
production-ready-features.adoc
...oot-docs/src/main/asciidoc/production-ready-features.adoc
+2
-2
spring-boot-cli.adoc
spring-boot-docs/src/main/asciidoc/spring-boot-cli.adoc
+17
-17
spring-boot-features.adoc
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
+9
-9
using-spring-boot.adoc
spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc
+23
-23
No files found.
spring-boot-docs/src/main/asciidoc/appendix-auto-configuration-classes.adoc
View file @
f58b8366
...
@@ -10,7 +10,7 @@ application for more details of which features are switched on.
...
@@ -10,7 +10,7 @@ application for more details of which features are switched on.
[[auto-configuration-classes-from-autoconfigure-module]]
[[auto-configuration-classes-from-autoconfigure-module]]
=== From the
``spring-boot-autoconfigure''
module
=== From the
"`spring-boot-autoconfigure`"
module
The following auto-configuration classes are from the `spring-boot-autoconfigure` module:
The following auto-configuration classes are from the `spring-boot-autoconfigure` module:
include::../../../target/generated-resources/auto-configuration-classes-spring-boot-autoconfigure.adoc[]
include::../../../target/generated-resources/auto-configuration-classes-spring-boot-autoconfigure.adoc[]
...
@@ -18,7 +18,7 @@ include::../../../target/generated-resources/auto-configuration-classes-spring-b
...
@@ -18,7 +18,7 @@ include::../../../target/generated-resources/auto-configuration-classes-spring-b
[[auto-configuration-classes-from-actuator]]
[[auto-configuration-classes-from-actuator]]
=== From the
``spring-boot-actuator''
module
=== From the
"`spring-boot-actuator`"
module
The following auto-configuration classes are from the `spring-boot-actuator` module:
The following auto-configuration classes are from the `spring-boot-actuator` module:
include::../../../target/generated-resources/auto-configuration-classes-spring-boot-actuator.adoc[]
include::../../../target/generated-resources/auto-configuration-classes-spring-boot-actuator.adoc[]
spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc
View file @
f58b8366
...
@@ -18,7 +18,7 @@ are themselves contained within a jar). This can be problematic if you are looki
...
@@ -18,7 +18,7 @@ are themselves contained within a jar). This can be problematic if you are looki
to distribute a self-contained application that you can just run from the command line
to distribute a self-contained application that you can just run from the command line
without unpacking.
without unpacking.
To solve this problem, many developers use
``shaded''
jars. A shaded jar simply packages
To solve this problem, many developers use
"`shaded`"
jars. A shaded jar simply packages
all classes, from all jars, into a single 'uber jar'. The problem with shaded jars is
all classes, from all jars, into a single 'uber jar'. The problem with shaded jars is
that it becomes hard to see which libraries you are actually using in your application.
that it becomes hard to see which libraries you are actually using in your application.
It can also be problematic if the the same filename is used (but with different content)
It can also be problematic if the the same filename is used (but with different content)
...
@@ -91,7 +91,7 @@ a traditional web container should be placed in `WEB-INF/lib-provided`.
...
@@ -91,7 +91,7 @@ a traditional web container should be placed in `WEB-INF/lib-provided`.
[[executable-jar-jarfile]]
[[executable-jar-jarfile]]
=== Spring Boot's
``JarFile''
class
=== Spring Boot's
"`JarFile`"
class
The core class used to support loading nested jars is
The core class used to support loading nested jars is
`org.springframework.boot.loader.jar.JarFile`. It allows you load jar
`org.springframework.boot.loader.jar.JarFile`. It allows you load jar
content from a standard jar file, or from nested child jar data. When first loaded, the
content from a standard jar file, or from nested child jar data. When first loaded, the
...
@@ -121,7 +121,7 @@ need to read all entry data into memory.
...
@@ -121,7 +121,7 @@ need to read all entry data into memory.
[[executable-jar-jarfile-compatibility]]
[[executable-jar-jarfile-compatibility]]
==== Compatibility with the standard Java
``JarFile''
==== Compatibility with the standard Java
"`JarFile`"
Spring Boot Loader strives to remain compatible with existing code and libraries.
Spring Boot Loader strives to remain compatible with existing code and libraries.
`org.springframework.boot.loader.jar.JarFile` extends from `java.util.jar.JarFile` and
`org.springframework.boot.loader.jar.JarFile` extends from `java.util.jar.JarFile` and
should work as a drop-in replacement. The `RandomAccessJarFile.getURL()` method will
should work as a drop-in replacement. The `RandomAccessJarFile.getURL()` method will
...
...
spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc
View file @
f58b8366
...
@@ -7,7 +7,7 @@ Spring Boot provides build tool plugins for Maven and Gradle. The plugins offer
...
@@ -7,7 +7,7 @@ Spring Boot provides build tool plugins for Maven and Gradle. The plugins offer
variety
of
features
,
including
the
packaging
of
executable
jars
.
This
section
provides
variety
of
features
,
including
the
packaging
of
executable
jars
.
This
section
provides
more
details
on
both
plugins
,
as
well
as
some
help
should
you
need
to
extend
an
more
details
on
both
plugins
,
as
well
as
some
help
should
you
need
to
extend
an
unsupported
build
system
.
If
you
are
just
getting
started
,
you
might
want
to
read
unsupported
build
system
.
If
you
are
just
getting
started
,
you
might
want
to
read
``<<
using
-
spring
-
boot
.
adoc
#
using
-
boot
-
build
-
systems
>>
''
from
the
"`<<using-spring-boot.adoc#using-boot-build-systems>>`"
from
the
<<
using
-
spring
-
boot
.
adoc
#
using
-
boot
>>
section
first
.
<<
using
-
spring
-
boot
.
adoc
#
using
-
boot
>>
section
first
.
--
--
...
@@ -17,7 +17,7 @@ unsupported build system. If you are just getting started, you might want to rea
...
@@ -17,7 +17,7 @@ unsupported build system. If you are just getting started, you might want to rea
==
Spring
Boot
Maven
plugin
==
Spring
Boot
Maven
plugin
The
{
spring
-
boot
-
maven
-
plugin
-
site
}/[
Spring
Boot
Maven
Plugin
]
provides
Spring
Boot
The
{
spring
-
boot
-
maven
-
plugin
-
site
}/[
Spring
Boot
Maven
Plugin
]
provides
Spring
Boot
support
in
Maven
,
allowing
you
to
package
executable
jar
or
war
archives
and
run
an
support
in
Maven
,
allowing
you
to
package
executable
jar
or
war
archives
and
run
an
application
``
in
-
place
''
.
To
use
it
you
must
be
using
Maven
3
(
or
better
).
application
"`in-place`"
.
To
use
it
you
must
be
using
Maven
3
(
or
better
).
NOTE
:
Refer
to
the
{
spring
-
boot
-
maven
-
plugin
-
site
}/[
Spring
Boot
Maven
Plugin
Site
]
NOTE
:
Refer
to
the
{
spring
-
boot
-
maven
-
plugin
-
site
}/[
Spring
Boot
Maven
Plugin
Site
]
for
complete
plugin
documentation
.
for
complete
plugin
documentation
.
...
@@ -129,7 +129,7 @@ To build and run a project artifact, you can type the following:
...
@@ -129,7 +129,7 @@ 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
To
build
a
war
file
that
is
both
executable
and
deployable
into
an
external
container
you
need
to
mark
the
embedded
container
dependencies
as
``
provided
''
,
e
.
g
:
need
to
mark
the
embedded
container
dependencies
as
"`provided`"
,
e
.
g
:
[
source
,
xml
,
indent
=
0
,
subs
=
"verbatim,attributes"
]
[
source
,
xml
,
indent
=
0
,
subs
=
"verbatim,attributes"
]
----
----
...
@@ -163,7 +163,7 @@ Advanced configuration options and examples are available in the
...
@@ -163,7 +163,7 @@ Advanced configuration options and examples are available in the
==
Spring
Boot
Gradle
plugin
==
Spring
Boot
Gradle
plugin
The
Spring
Boot
Gradle
Plugin
provides
Spring
Boot
support
in
Gradle
,
allowing
you
to
The
Spring
Boot
Gradle
Plugin
provides
Spring
Boot
support
in
Gradle
,
allowing
you
to
package
executable
jar
or
war
archives
,
run
Spring
Boot
applications
and
omit
version
package
executable
jar
or
war
archives
,
run
Spring
Boot
applications
and
omit
version
information
from
your
`
build
.
gradle
`
file
for
``
blessed
''
dependencies
.
information
from
your
`
build
.
gradle
`
file
for
"`blessed`"
dependencies
.
...
@@ -201,7 +201,7 @@ If you are using a milestone or snapshot release you will also need to add appro
...
@@ -201,7 +201,7 @@ If you are using a milestone or snapshot release you will also need to add appro
[[
build
-
tool
-
plugins
-
gradle
-
dependencies
-
without
-
versions
]]
[[
build
-
tool
-
plugins
-
gradle
-
dependencies
-
without
-
versions
]]
===
Declaring
dependencies
without
versions
===
Declaring
dependencies
without
versions
The
`
spring
-
boot
`
plugin
will
register
a
custom
Gradle
`
ResolutionStrategy
`
with
your
The
`
spring
-
boot
`
plugin
will
register
a
custom
Gradle
`
ResolutionStrategy
`
with
your
build
that
allows
you
to
omit
version
numbers
when
declaring
dependencies
to
``
blessed
''
build
that
allows
you
to
omit
version
numbers
when
declaring
dependencies
to
"`blessed`"
artifacts
.
To
make
use
of
this
functionality
,
simply
declare
dependencies
in
the
usual
way
,
artifacts
.
To
make
use
of
this
functionality
,
simply
declare
dependencies
in
the
usual
way
,
but
leave
the
version
number
empty
:
but
leave
the
version
number
empty
:
...
@@ -215,7 +215,7 @@ but leave the version number empty:
...
@@ -215,7 +215,7 @@ but leave the version number empty:
----
----
NOTE
:
The
version
of
the
`
spring
-
boot
`
gradle
plugin
that
you
declare
determines
the
NOTE
:
The
version
of
the
`
spring
-
boot
`
gradle
plugin
that
you
declare
determines
the
actual
versions
of
the
``
blessed
''
dependencies
(
this
ensures
that
builds
are
always
actual
versions
of
the
"`blessed`"
dependencies
(
this
ensures
that
builds
are
always
repeatable
).
You
should
always
set
the
version
of
the
`
spring
-
boot
`
gradle
plugin
to
the
repeatable
).
You
should
always
set
the
version
of
the
`
spring
-
boot
`
gradle
plugin
to
the
actual
Spring
Boot
version
that
you
wish
to
use
.
Details
of
the
versions
that
are
actual
Spring
Boot
version
that
you
wish
to
use
.
Details
of
the
versions
that
are
provided
can
be
found
in
the
<<
appendix
-
dependency
-
versions
,
appendix
>>.
provided
can
be
found
in
the
<<
appendix
-
dependency
-
versions
,
appendix
>>.
...
@@ -237,7 +237,7 @@ example:
...
@@ -237,7 +237,7 @@ example:
[[
build
-
tool
-
plugins
-
gradle
-
custom
-
version
-
management
]]
[[
build
-
tool
-
plugins
-
gradle
-
custom
-
version
-
management
]]
====
Custom
version
management
====
Custom
version
management
If
is
possible
to
customize
the
versions
used
by
the
`
ResolutionStrategy
`
if
you
need
If
is
possible
to
customize
the
versions
used
by
the
`
ResolutionStrategy
`
if
you
need
to
deviate
from
Spring
Boot
's
``blessed''
dependencies. Alternative version metadata
to
deviate
from
Spring
Boot
's
"`blessed`"
dependencies. Alternative version metadata
is consulted using the `versionManagement` configuration. For example:
is consulted using the `versionManagement` configuration. For example:
[source,groovy,indent=0,subs="verbatim,attributes"]
[source,groovy,indent=0,subs="verbatim,attributes"]
...
@@ -263,7 +263,7 @@ to override version numbers if necessary.
...
@@ -263,7 +263,7 @@ to override version numbers if necessary.
[[
build
-
tool
-
plugins
-
gradle
-
exclude
-
rules
]]
[[
build
-
tool
-
plugins
-
gradle
-
exclude
-
rules
]]
===
Default
exclude
rules
===
Default
exclude
rules
Gradle
handles
``
exclude
rules
''
in
a
slightly
different
way
to
Maven
which
can
cause
Gradle
handles
"`exclude rules`"
in
a
slightly
different
way
to
Maven
which
can
cause
unexpected
results
when
using
the
starter
POMs
.
Specifically
,
exclusions
declared
on
unexpected
results
when
using
the
starter
POMs
.
Specifically
,
exclusions
declared
on
a
dependency
will
not
be
applied
when
the
dependency
can
be
reached
through
a
different
a
dependency
will
not
be
applied
when
the
dependency
can
be
reached
through
a
different
path
.
For
example
,
if
a
starter
POM
declares
the
following
:
path
.
For
example
,
if
a
starter
POM
declares
the
following
:
...
@@ -296,7 +296,7 @@ which does not have an `exclusion` element.
...
@@ -296,7 +296,7 @@ which does not have an `exclusion` element.
To
ensure
that
correct
exclusions
are
actually
applied
,
the
Spring
Boot
Gradle
plugin
will
To
ensure
that
correct
exclusions
are
actually
applied
,
the
Spring
Boot
Gradle
plugin
will
automatically
add
exclusion
rules
.
All
exclusions
defined
in
the
automatically
add
exclusion
rules
.
All
exclusions
defined
in
the
`
spring
-
boot
-
dependencies
`
POM
and
implicit
rules
for
the
``
starter
''
POMs
will
be
added
.
`
spring
-
boot
-
dependencies
`
POM
and
implicit
rules
for
the
"`starter`"
POMs
will
be
added
.
If
you
don
't want exclusion rules automatically applied you can use the following
If
you
don
't want exclusion rules automatically applied you can use the following
configuration:
configuration:
...
@@ -331,7 +331,7 @@ To build and run a project artifact, you can type the following:
...
@@ -331,7 +331,7 @@ 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
,
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
you
need
to
mark
the
embedded
container
dependencies
as
belonging
to
a
configuration
named
``
providedRuntime
''
,
e
.
g
:
named
"`providedRuntime`"
,
e
.
g
:
[
source
,
groovy
,
indent
=
0
,
subs
=
"verbatim,attributes"
]
[
source
,
groovy
,
indent
=
0
,
subs
=
"verbatim,attributes"
]
----
----
...
@@ -362,7 +362,7 @@ named ``providedRuntime'', e.g:
...
@@ -362,7 +362,7 @@ named ``providedRuntime'', e.g:
[[
build
-
tool
-
plugins
-
gradle
-
running
-
applications
]]
[[
build
-
tool
-
plugins
-
gradle
-
running
-
applications
]]
===
Running
a
project
in
-
place
===
Running
a
project
in
-
place
To
run
a
project
in
place
without
building
a
jar
first
you
can
use
the
``
bootRun
''
task
:
To
run
a
project
in
place
without
building
a
jar
first
you
can
use
the
"`bootRun`"
task
:
[
indent
=
0
]
[
indent
=
0
]
----
----
...
@@ -513,7 +513,7 @@ The following configuration options are available:
...
@@ -513,7 +513,7 @@ The following configuration options are available:
(defaults to a guess based on the archive type).
(defaults to a guess based on the archive type).
|`requiresUnpack`
|`requiresUnpack`
|A list of dependencies (in the form
``groupId:artifactId''
that must be unpacked from
|A list of dependencies (in the form
"`groupId:artifactId`"
that must be unpacked from
fat jars in order to run. Items are still packaged into the fat jar, but they will be
fat jars in order to run. Items are still packaged into the fat jar, but they will be
automatically unpacked when it runs.
automatically unpacked when it runs.
|===
|===
...
@@ -573,7 +573,7 @@ you may find that it includes unnecessary dependencies.
...
@@ -573,7 +573,7 @@ you may find that it includes unnecessary dependencies.
If you want to use a build tool other than Maven or Gradle, you will likely need to develop
If you want to use a build tool other than Maven or Gradle, you will likely need to develop
your own plugin. Executable jars need to follow a specific format and certain entries need
your own plugin. Executable jars need to follow a specific format and certain entries need
to be written in an uncompressed form (see the
to be written in an uncompressed form (see the
'
<<
appendix
-
executable
-
jar
-
format
.
adoc
#
executable
-
jar
,
executable
jar
format
>>
'
section
_<<appendix-executable-jar-format.adoc#executable-jar, executable jar format>>_
section
in the appendix for details).
in the appendix for details).
The Spring Boot Maven and Gradle plugins both make use of `spring-boot-loader-tools` to
The Spring Boot Maven and Gradle plugins both make use of `spring-boot-loader-tools` to
...
@@ -637,4 +637,4 @@ technical details of the <<appendix-executable-jar-format.adoc#executable-jar, e
...
@@ -637,4 +637,4 @@ technical details of the <<appendix-executable-jar-format.adoc#executable-jar, e
jar
format
>>
are
covered
in
the
appendix
.
jar
format
>>
are
covered
in
the
appendix
.
If
you
have
specific
build
-
related
questions
you
can
check
out
the
If
you
have
specific
build
-
related
questions
you
can
check
out
the
`<<
howto
.
adoc
#
howto
,
how
-
to
>>
'
guides.
"`<<howto.adoc#howto, how-to>>`"
guides
.
spring-boot-docs/src/main/asciidoc/cloud-deployment.adoc
View file @
f58b8366
...
@@ -5,11 +5,11 @@
...
@@ -5,11 +5,11 @@
--
--
Spring Boot's executable jars are ready-made for most popular cloud PaaS
Spring Boot's executable jars are ready-made for most popular cloud PaaS
(platform-as-a-service) providers. These providers tend to require that you
(platform-as-a-service) providers. These providers tend to require that you
_`bring your own container'_
; they manage application processes (not Java applications
"`bring your own container`"
; they manage application processes (not Java applications
specifically), so they need some intermediary layer that adapts _your_ application to the
specifically), so they need some intermediary layer that adapts _your_ application to the
_cloud's_ notion of a running process.
_cloud's_ notion of a running process.
Two popular cloud providers, Heroku and Cloud Foundry, employ a
``buildpack''
approach.
Two popular cloud providers, Heroku and Cloud Foundry, employ a
"`buildpack`"
approach.
The buildpack wraps your deployed code in whatever is needed to _start_ your
The buildpack wraps your deployed code in whatever is needed to _start_ your
application: it might be a JDK and a call to `java`, it might be an embedded webserver,
application: it might be a JDK and a call to `java`, it might be an embedded webserver,
or it might be a full-fledged application server. A buildpack is pluggable, but ideally
or it might be a full-fledged application server. A buildpack is pluggable, but ideally
...
@@ -22,7 +22,7 @@ to run packaged within it.
...
@@ -22,7 +22,7 @@ to run packaged within it.
In this section we'll look at what it takes to get the
In this section we'll look at what it takes to get the
<<getting-started.adoc#getting-started-first-application, simple application that we
<<getting-started.adoc#getting-started-first-application, simple application that we
developed>> in the
``Getting Started''
section up and running in the Cloud.
developed>> in the
"`Getting Started`"
section up and running in the Cloud.
--
--
...
@@ -226,7 +226,7 @@ Your application should now be up and running on Heroku.
...
@@ -226,7 +226,7 @@ Your application should now be up and running on Heroku.
[[cloud-deployment-cloudbees]]
[[cloud-deployment-cloudbees]]
== CloudBees
== CloudBees
CloudBees provides cloud-based
``continuous integration'' and ``continuous delivery''
CloudBees provides cloud-based
"`continuous integration`" and "`continuous delivery`"
services as well as Java PaaS hosting. https://github.com/msgilligan[Sean Gilligan]
services as well as Java PaaS hosting. https://github.com/msgilligan[Sean Gilligan]
has contributed an excellent
has contributed an excellent
https://github.com/CloudBees-community/springboot-gradle-cloudbees-sample[Spring Boot
https://github.com/CloudBees-community/springboot-gradle-cloudbees-sample[Spring Boot
...
@@ -308,9 +308,9 @@ features that a PaaS can offer. These are just three of the most popular Java Pa
...
@@ -308,9 +308,9 @@ features that a PaaS can offer. These are just three of the most popular Java Pa
providers, since Spring Boot is so amenable to cloud-based deployment you're free to
providers, since Spring Boot is so amenable to cloud-based deployment you're free to
consider other providers as well.
consider other providers as well.
The next section goes on to cover the
'<<spring-boot-cli.adoc#cli, Spring Boot CLI>>'
;
The next section goes on to cover the
_<<spring-boot-cli.adoc#cli, Spring Boot CLI>>_
;
or you can jump ahead to read about
or you can jump ahead to read about
'<<build-tool-plugins.adoc#build-tool-plugins, build tool plugins>>'
.
_<<build-tool-plugins.adoc#build-tool-plugins, build tool plugins>>_
.
...
...
spring-boot-docs/src/main/asciidoc/getting-started.adoc
View file @
f58b8366
This diff is collapsed.
Click to expand it.
spring-boot-docs/src/main/asciidoc/howto.adoc
View file @
f58b8366
...
@@ -41,7 +41,7 @@ rules of thumb:
...
@@ -41,7 +41,7 @@ rules of thumb:
`+@Conditional*+` annotations to find out what features they enable and when. Add
`+@Conditional*+` annotations to find out what features they enable and when. Add
`--debug` to the command line or a System property `-Ddebug` to get a log on the
`--debug` to the command line or a System property `-Ddebug` to get a log on the
console of all the autoconfiguration decisions that were made in your app. In a running
console of all the autoconfiguration decisions that were made in your app. In a running
Actuator app look at the `autoconfig` endpoint (
`/autoconfig
' or the JMX equivalent) for
Actuator app look at the `autoconfig` endpoint (
'`/autoconfig`
' or the JMX equivalent) for
the same information.
the same information.
* Look for classes that are `@ConfigurationProperties` (e.g.
* Look for classes that are `@ConfigurationProperties` (e.g.
{sc-spring-boot-autoconfigure}/web/ServerProperties.{sc-ext}[`ServerProperties`])
{sc-spring-boot-autoconfigure}/web/ServerProperties.{sc-ext}[`ServerProperties`])
...
@@ -79,7 +79,7 @@ than one way to register additional ones:
...
@@ -79,7 +79,7 @@ than one way to register additional ones:
The `SpringApplication` sends some special `ApplicationEvents` to the listeners (even
The `SpringApplication` sends some special `ApplicationEvents` to the listeners (even
some before the context is created), and then registers the listeners for events published
some before the context is created), and then registers the listeners for events published
by the `ApplicationContext` as well. See
by the `ApplicationContext` as well. See
'<<spring-boot-features.adoc#boot-features-application-events-and-listeners>>'
in the
_<<spring-boot-features.adoc#boot-features-application-events-and-listeners>>_
in the
'`Spring Boot features`' section for a complete list.
'`Spring Boot features`' section for a complete list.
...
@@ -87,7 +87,7 @@ by the `ApplicationContext` as well. See
...
@@ -87,7 +87,7 @@ by the `ApplicationContext` as well. See
[[howto-build-an-application-context-hierarchy]]
[[howto-build-an-application-context-hierarchy]]
=== Build an ApplicationContext hierarchy (adding a parent or root context)
=== Build an ApplicationContext hierarchy (adding a parent or root context)
You can use the `ApplicationBuilder` class to create parent/child `ApplicationContext`
You can use the `ApplicationBuilder` class to create parent/child `ApplicationContext`
hierarchies. See
'<<spring-boot-features.adoc#boot-features-fluent-builder-api>>'
hierarchies. See
_<<spring-boot-features.adoc#boot-features-fluent-builder-api>>_
in the '`Spring Boot features`' section for more information.
in the '`Spring Boot features`' section for more information.
...
@@ -135,7 +135,7 @@ underscores (`_`) as well as dashes (`-`) in property names.
...
@@ -135,7 +135,7 @@ underscores (`_`) as well as dashes (`-`) in property names.
[[howto-change-the-location-of-external-properties]]
[[howto-change-the-location-of-external-properties]]
=== Change the location of external properties of an application
=== Change the location of external properties of an application
By default properties from different sources are added to the Spring `Environment` in a
By default properties from different sources are added to the Spring `Environment` in a
defined order (see
'<<spring-boot-features.adoc#boot-features-external-config>>'
in
defined order (see
_<<spring-boot-features.adoc#boot-features-external-config>>_
in
the '`Spring Boot features`' section for the exact order).
the '`Spring Boot features`' section for the exact order).
A nice way to augment and modify this is to add `@PropertySource` annotations to your
A nice way to augment and modify this is to add `@PropertySource` annotations to your
...
@@ -222,7 +222,7 @@ The example YAML above corresponds to an `application.properties` file
...
@@ -222,7 +222,7 @@ The example YAML above corresponds to an `application.properties` file
server.port=9000
server.port=9000
----
----
See
'<<spring-boot-features.adoc#boot-features-external-config-yaml>>'
in
See
_<<spring-boot-features.adoc#boot-features-external-config-yaml>>_
in
the '`Spring Boot features`' section for more information
the '`Spring Boot features`' section for more information
about YAML.
about YAML.
...
@@ -249,7 +249,7 @@ A value set this way is replaced by the System property or environment variable
...
@@ -249,7 +249,7 @@ A value set this way is replaced by the System property or environment variable
but not by the `SpringApplicationBuilder.profiles()` method. Thus the latter Java API can
but not by the `SpringApplicationBuilder.profiles()` method. Thus the latter Java API can
be used to augment the profiles without changing the defaults.
be used to augment the profiles without changing the defaults.
See
'<<spring-boot-features.adoc#boot-features-profiles>>'
in
See
_<<spring-boot-features.adoc#boot-features-profiles>>_
in
the '`Spring Boot features`' section for more information.
the '`Spring Boot features`' section for more information.
...
@@ -345,7 +345,7 @@ environment variable).
...
@@ -345,7 +345,7 @@ environment variable).
To switch off the HTTP endpoints completely, but still create a `WebApplicationContext`,
To switch off the HTTP endpoints completely, but still create a `WebApplicationContext`,
use `server.port=-1` (this is sometimes useful for testing).
use `server.port=-1` (this is sometimes useful for testing).
For more details look at
'<<spring-boot-features.adoc#boot-features-customizing-embedded-containers>>'
For more details look at
_<<spring-boot-features.adoc#boot-features-customizing-embedded-containers>>_
in the '`Spring Boot features`' section, or the
in the '`Spring Boot features`' section, or the
{sc-spring-boot-autoconfigure}/web/ServerProperties.{sc-ext}[`ServerProperties`] source
{sc-spring-boot-autoconfigure}/web/ServerProperties.{sc-ext}[`ServerProperties`] source
code.
code.
...
@@ -365,7 +365,7 @@ that and be sure that it has initialized is to add a `@Bean` of type
...
@@ -365,7 +365,7 @@ that and be sure that it has initialized is to add a `@Bean` of type
`ApplicationListener<EmbeddedServletContainerInitializedEvent>` and pull the container
`ApplicationListener<EmbeddedServletContainerInitializedEvent>` and pull the container
out of the event when it is published.
out of the event when it is published.
A useful practice for use with `@IntegrationTest
`s
is to set `server.port=0`
A useful practice for use with `@IntegrationTest
s`
is to set `server.port=0`
and then inject the actual ('`local`') port as a `@Value`. For example:
and then inject the actual ('`local`') port as a `@Value`. For example:
[source,java,indent=0,subs="verbatim,quotes,attributes"]
[source,java,indent=0,subs="verbatim,quotes,attributes"]
...
@@ -413,7 +413,7 @@ accessible on the filesystem, i.e. it cannot be read from within a jar file.
...
@@ -413,7 +413,7 @@ accessible on the filesystem, i.e. it cannot be read from within a jar file.
[[howto-configure-tomcat]]
[[howto-configure-tomcat]]
=== Configure Tomcat
=== Configure Tomcat
Generally you can follow the advice from
Generally you can follow the advice from
'<<howto-discover-build-in-options-for-external-properties>>'
about
_<<howto-discover-build-in-options-for-external-properties>>_
about
`@ConfigurationProperties` (`ServerProperties` is the main one here), but also look at
`@ConfigurationProperties` (`ServerProperties` is the main one here), but also look at
`EmbeddedServletContainerCustomizer` and various Tomcat-specific `+*Customizers+` that you
`EmbeddedServletContainerCustomizer` and various Tomcat-specific `+*Customizers+` that you
can add in one of those. The Tomcat APIs are quite rich so once you have access to the
can add in one of those. The Tomcat APIs are quite rich so once you have access to the
...
@@ -548,7 +548,7 @@ Example in Gradle:
...
@@ -548,7 +548,7 @@ Example in Gradle:
[[howto-configure-jetty]]
[[howto-configure-jetty]]
=== Configure Jetty
=== Configure Jetty
Generally you can follow the advice from
Generally you can follow the advice from
'<<howto-discover-build-in-options-for-external-properties>>'
about
_<<howto-discover-build-in-options-for-external-properties>>_
about
`@ConfigurationProperties` (`ServerProperties` is the main one here), but also look at
`@ConfigurationProperties` (`ServerProperties` is the main one here), but also look at
`EmbeddedServletContainerCustomizer`. The Jetty APIs are quite rich so once you have
`EmbeddedServletContainerCustomizer`. The Jetty APIs are quite rich so once you have
access to the `JettyEmbeddedServletContainerFactory` you can modify it in a number
access to the `JettyEmbeddedServletContainerFactory` you can modify it in a number
...
@@ -689,7 +689,7 @@ provided of type `HttpMessageConverters` (always available if you use the defaul
...
@@ -689,7 +689,7 @@ provided of type `HttpMessageConverters` (always available if you use the defaul
configuration) which has some useful methods to access the default and user-enhanced
configuration) which has some useful methods to access the default and user-enhanced
message converters.
message converters.
See also the
'<<howto-customize-the-responsebody-rendering>>'
section and the
See also the
_<<howto-customize-the-responsebody-rendering>>_
section and the
{sc-spring-boot-autoconfigure}/web/WebMvcAutoConfiguration.{sc-ext}[`WebMvcAutoConfiguration`]
{sc-spring-boot-autoconfigure}/web/WebMvcAutoConfiguration.{sc-ext}[`WebMvcAutoConfiguration`]
source code for more details.
source code for more details.
...
@@ -964,7 +964,7 @@ your own, and bind it to a set of `Environment` properties e.g.
...
@@ -964,7 +964,7 @@ your own, and bind it to a set of `Environment` properties e.g.
datasource.mine.poolSize=30
datasource.mine.poolSize=30
----
----
See
'<<spring-boot-features.adoc#boot-features-configure-datasource>>'
in the
See
_<<spring-boot-features.adoc#boot-features-configure-datasource>>_
in the
'`Spring Boot features`' section and the
'`Spring Boot features`' section and the
{sc-spring-boot-autoconfigure}/jdbc/DataSourceAutoConfiguration.{sc-ext}[`DataSourceAutoConfiguration`]
{sc-spring-boot-autoconfigure}/jdbc/DataSourceAutoConfiguration.{sc-ext}[`DataSourceAutoConfiguration`]
class for more details.
class for more details.
...
@@ -1314,7 +1314,7 @@ also set `management.address` to a valid IP address that the server is able to b
...
@@ -1314,7 +1314,7 @@ also set `management.address` to a valid IP address that the server is able to b
For more detail look at the
For more detail look at the
{sc-spring-boot-actuator}/autoconfigure/ManagementServerProperties.{sc-ext}[`ManagementServerProperties`]
{sc-spring-boot-actuator}/autoconfigure/ManagementServerProperties.{sc-ext}[`ManagementServerProperties`]
source code and
source code and
'<<production-ready-features.adoc#production-ready-customizing-management-server-port>>'
_<<production-ready-features.adoc#production-ready-customizing-management-server-port>>_
in the '`Production-ready features`' section.
in the '`Production-ready features`' section.
...
...
spring-boot-docs/src/main/asciidoc/production-ready-features.adoc
View file @
f58b8366
...
@@ -131,7 +131,7 @@ of the `beans` endpoint and also enables `shutdown`.
...
@@ -131,7 +131,7 @@ of the `beans` endpoint and also enables `shutdown`.
endpoints.shutdown.enabled=true
endpoints.shutdown.enabled=true
----
----
NOTE: The prefix
"`endpoints` + `.` + `name`"
is used to uniquely identify the endpoint
NOTE: The prefix
‟`endpoints` + `.` + `name`”
is used to uniquely identify the endpoint
that is being configured.
that is being configured.
...
@@ -846,4 +846,4 @@ might want to read about graphing tools such as http://graphite.wikidot.com/[Gra
...
@@ -846,4 +846,4 @@ might want to read about graphing tools such as http://graphite.wikidot.com/[Gra
Otherwise, you can continue on, to read about <<cloud-deployment.adoc#cloud-deployment,
Otherwise, you can continue on, to read about <<cloud-deployment.adoc#cloud-deployment,
'
`
cloud
deployment
options
`
'>> or jump ahead
'
`
cloud
deployment
options
`
'>> or jump ahead
for some in-depth information about Spring Boot'
s
for some in-depth information about Spring Boot'
s
'<<build-tool-plugins.adoc#build-tool-plugins, build tool plugins>>'
.
_
<<
build
-
tool
-
plugins
.
adoc
#
build
-
tool
-
plugins
,
build
tool
plugins
>>
_
.
spring-boot-docs/src/main/asciidoc/spring-boot-cli.adoc
View file @
f58b8366
...
@@ -14,8 +14,8 @@ familiar Java-like syntax, without so much boilerplate code.
...
@@ -14,8 +14,8 @@ familiar Java-like syntax, without so much boilerplate code.
== Installing the CLI
== Installing the CLI
The Spring Boot CLI can be installed manually; using GVM (the Groovy Environment
The Spring Boot CLI can be installed manually; using GVM (the Groovy Environment
Manually) or using Homebrew if you are an OSX user. See
Manually) or using Homebrew if you are an OSX user. See
'<<getting-started.adoc#getting-started-installing-the-cli>>'
_<<getting-started.adoc#getting-started-installing-the-cli>>_
in the
``Getting started''
section for comprehensive installation instructions.
in the
"`Getting started`"
section for comprehensive installation instructions.
...
@@ -78,7 +78,7 @@ using.
...
@@ -78,7 +78,7 @@ using.
You can compile and run Groovy source code using the `run` command. The Spring Boot CLI
You can compile and run Groovy source code using the `run` command. The Spring Boot CLI
is completely self-contained so you don't need any external Groovy installation.
is completely self-contained so you don't need any external Groovy installation.
Here is an example
``hello world''
web application written in Groovy:
Here is an example
"`hello world`"
web application written in Groovy:
[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
----
----
...
@@ -96,16 +96,16 @@ Here is an example ``hello world'' web application written in Groovy:
...
@@ -96,16 +96,16 @@ Here is an example ``hello world'' web application written in Groovy:
[[cli-deduced-grab-annotations]]
[[cli-deduced-grab-annotations]]
==== Deduced
``grab''
dependencies
==== Deduced
"`grab`"
dependencies
Standard Groovy includes a `@Grab` annotation which allows you to declare dependencies
Standard Groovy includes a `@Grab` annotation which allows you to declare dependencies
on a third-party libraries. This useful technique allows Groovy to download jars in the
on a third-party libraries. This useful technique allows Groovy to download jars in the
same way as Maven or Gradle would; but without requiring you to use a build tool.
same way as Maven or Gradle would; but without requiring you to use a build tool.
Spring Boot extends this technique further, and will attempt to deduce which libraries
Spring Boot extends this technique further, and will attempt to deduce which libraries
to
``grab''
based on your code. For example, since the `WebApplication` code above uses
to
"`grab`"
based on your code. For example, since the `WebApplication` code above uses
`@RestController` annotations,
``Tomcat'' and ``Spring MVC''
will be grabbed.
`@RestController` annotations,
"`Tomcat`" and "`Spring MVC`"
will be grabbed.
The following items are used as
``grab hints''
:
The following items are used as
"`grab hints`"
:
|===
|===
| Items | Grabs
| Items | Grabs
...
@@ -154,7 +154,7 @@ in the Spring Boot CLI source code to understand exactly how customizations are
...
@@ -154,7 +154,7 @@ in the Spring Boot CLI source code to understand exactly how customizations are
[[cli-default-grab-deduced-coordinates]]
[[cli-default-grab-deduced-coordinates]]
==== Deduced
``grab''
coordinates
==== Deduced
"`grab`"
coordinates
Spring Boot extends Groovy's standard `@Grab` support by allowing you to specify a dependency
Spring Boot extends Groovy's standard `@Grab` support by allowing you to specify a dependency
without a group or version, for example `@Grab('freemarker')`. This will consult Spring Boot's
without a group or version, for example `@Grab('freemarker')`. This will consult Spring Boot's
default dependency metadata to deduce the artifact's group and version. Note that the default
default dependency metadata to deduce the artifact's group and version. Note that the default
...
@@ -166,12 +166,12 @@ metadata can be found in the <<appendix-dependency-versions, appendix>>.
...
@@ -166,12 +166,12 @@ metadata can be found in the <<appendix-dependency-versions, appendix>>.
[[cli-default-grab-deduced-coordinates-custom-metadata]]
[[cli-default-grab-deduced-coordinates-custom-metadata]]
===== Custom
``grab''
metadata
===== Custom
"`grab`"
metadata
Spring Boot provides a new annotation, `@GrabMetadata` that can be used to provide custom
Spring Boot provides a new annotation, `@GrabMetadata` that can be used to provide custom
dependency metadata that overrides Spring Boot's defaults. This metadata is specified by
dependency metadata that overrides Spring Boot's defaults. This metadata is specified by
using this annotation to provide the coordinates of one or more properties files (deployed
using this annotation to provide the coordinates of one or more properties files (deployed
to a Maven repository with a "type" identifier: "properties"). For example
to a Maven repository with a "type" identifier: "properties"). For example
`@GrabMetadata(['com.example:versions-one:1.0.0', 'com.example.versions-two:1.0.0'])` will
`@GrabMetadata(['com.example:versions-one:1.0.0', 'com.example.versions-two:1.0.0'])` will
pick up files in a Maven repository in "com/example/versions-*/1.0.0/versions-*-1.0.0.properties". The
pick up files in a Maven repository in "com/example/versions-*/1.0.0/versions-*-1.0.0.properties". The
properties files are applied in the order that they're specified. In the example above, this
properties files are applied in the order that they're specified. In the example above, this
means that properties in `versions-two` will override properties in `versions-one`. Each entry
means that properties in `versions-two` will override properties in `versions-one`. Each entry
...
@@ -241,7 +241,7 @@ into a `test` directory.
...
@@ -241,7 +241,7 @@ into a `test` directory.
[[cli-multiple-source-files]]
[[cli-multiple-source-files]]
=== Applications with multiple source files
=== Applications with multiple source files
You can use
``shell globbing''
with all commands that accept file input. This allows you
You can use
"`shell globbing`"
with all commands that accept file input. This allows you
to easily use multiple files from a single directory, e.g.
to easily use multiple files from a single directory, e.g.
[indent=0]
[indent=0]
...
@@ -249,7 +249,7 @@ to easily use multiple files from a single directory, e.g.
...
@@ -249,7 +249,7 @@ to easily use multiple files from a single directory, e.g.
$ spring run *.groovy
$ spring run *.groovy
----
----
This technique can also be useful if you want to segregate your
``test'' or ``spec''
code
This technique can also be useful if you want to segregate your
"`test`" or "`spec`"
code
from the main application code:
from the main application code:
[indent=0]
[indent=0]
...
@@ -273,7 +273,7 @@ The resulting jar will contain the classes produced by compiling the application
...
@@ -273,7 +273,7 @@ The resulting jar will contain the classes produced by compiling the application
of the application's dependencies so that it can then be run using `java -jar`. The jar
of the application's dependencies so that it can then be run using `java -jar`. The jar
file will also contain entries from the application's classpath. You can add explicit
file will also contain entries from the application's classpath. You can add explicit
paths to the jar using `--include` and `--exclude` (both are comma-separated, and both
paths to the jar using `--include` and `--exclude` (both are comma-separated, and both
accept prefixes to the values
``+'' and ``-''
to signify that they should be removed from
accept prefixes to the values
"`+`" and "`-`"
to signify that they should be removed from
the defaults). The default includes are
the defaults). The default includes are
[indent=0]
[indent=0]
...
@@ -319,7 +319,7 @@ embedded shell.
...
@@ -319,7 +319,7 @@ embedded shell.
[[cli-groovy-beans-dsl]]
[[cli-groovy-beans-dsl]]
== Developing application with the Groovy beans DSL
== Developing application with the Groovy beans DSL
Spring Framework 4.0 has native support for a `beans{}`
``DSL''
(borrowed from
Spring Framework 4.0 has native support for a `beans{}`
"`DSL`"
(borrowed from
http://grails.org/[Grails]), and you can embed bean definitions in your Groovy
http://grails.org/[Grails]), and you can embed bean definitions in your Groovy
application scripts using the same format. This is sometimes a good way to include
application scripts using the same format. This is sometimes a good way to include
external features like middleware declarations. For example:
external features like middleware declarations. For example:
...
@@ -361,7 +361,7 @@ Spring Boot CLI. There is also extensive javadoc throughout the
...
@@ -361,7 +361,7 @@ Spring Boot CLI. There is also extensive javadoc throughout the
{sc-spring-boot-cli}[source code].
{sc-spring-boot-cli}[source code].
If you find that you reach the limit of the CLI tool, you will probably want to look
If you find that you reach the limit of the CLI tool, you will probably want to look
at converting your application to full Gradle or Maven built
``groovy project''
. The
at converting your application to full Gradle or Maven built
"`groovy project`"
. The
next section covers Spring Boot's
next section covers Spring Boot's
'<<build-tool-plugins.adoc#build-tool-plugins, Build tool plugins>>'
that you can
_<<build-tool-plugins.adoc#build-tool-plugins, Build tool plugins>>_
that you can
use with Gradle or Maven.
use with Gradle or Maven.
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
View file @
f58b8366
...
@@ -5,8 +5,8 @@
...
@@ -5,8 +5,8 @@
--
--
This section dives into the details of Spring Boot. Here you can learn about the key
This section dives into the details of Spring Boot. Here you can learn about the key
features that you will want to use and customize. If you haven't already, you might want
features that you will want to use and customize. If you haven't already, you might want
to read the
'<<getting-started.adoc#getting-started>>'
and
to read the
_<<getting-started.adoc#getting-started>>_
and
'<<using-spring-boot.adoc#using-boot>>'
sections so that you have a good grounding
_<<using-spring-boot.adoc#using-boot>>_
sections so that you have a good grounding
of the basics.
of the basics.
--
--
...
@@ -73,7 +73,7 @@ for spring beans. In most cases these will be references to `@Configuration` cla
...
@@ -73,7 +73,7 @@ for spring beans. In most cases these will be references to `@Configuration` cla
they could also be references to XML configuration or to packages that should be scanned.
they could also be references to XML configuration or to packages that should be scanned.
It is also possible to configure the `SpringApplication` using an `application.properties`
It is also possible to configure the `SpringApplication` using an `application.properties`
file. See
'<<boot-features-external-config>>'
for details.
file. See
_<<boot-features-external-config>>_
for details.
For a complete list of the configuration options, see the
For a complete list of the configuration options, see the
{dc-spring-boot}/SpringApplication.{dc-ext}[`SpringApplication` Javadoc].
{dc-spring-boot}/SpringApplication.{dc-ext}[`SpringApplication` Javadoc].
...
@@ -341,7 +341,7 @@ properties).
...
@@ -341,7 +341,7 @@ properties).
----
----
TIP: You can also use this technique to create '`short`' variants of existing Spring Boot
TIP: You can also use this technique to create '`short`' variants of existing Spring Boot
properties. See the
'<<howto.adoc#howto-use-short-command-line-arguments>>'
how-to
properties. See the
_<<howto.adoc#howto-use-short-command-line-arguments>>_
how-to
for details.
for details.
...
@@ -369,7 +369,7 @@ For example, the following YAML document:
...
@@ -369,7 +369,7 @@ For example, the following YAML document:
[source,yaml,indent=0]
[source,yaml,indent=0]
----
----
environments:
environments:
dev:
`
dev:
url: http://dev.bar.com
url: http://dev.bar.com
name: Developer Setup
name: Developer Setup
prod:
prod:
...
@@ -583,7 +583,7 @@ You can also add a custom Spring `Validator` by creating a bean definition calle
...
@@ -583,7 +583,7 @@ You can also add a custom Spring `Validator` by creating a bean definition calle
TIP: The `spring-boot-actuator` module includes an endpoint that exposes all
TIP: The `spring-boot-actuator` module includes an endpoint that exposes all
`@ConfigurationProperties` beans. Simply point your web browser to `/configprops`
`@ConfigurationProperties` beans. Simply point your web browser to `/configprops`
or use the equivalent JMX endpoint. See the
or use the equivalent JMX endpoint. See the
'<<production-ready-features.adoc#production-ready-endpoints, Production ready features>>'
.
_<<production-ready-features.adoc#production-ready-endpoints, Production ready features>>_
.
section for details.
section for details.
...
@@ -661,7 +661,7 @@ possible to activate profiles using Spring's `ConfigurableEnvironment` interface
...
@@ -661,7 +661,7 @@ possible to activate profiles using Spring's `ConfigurableEnvironment` interface
=== Profile specific configuration files
=== Profile specific configuration files
Profile specific variants of both `application.properties` (or `application.yml`) and
Profile specific variants of both `application.properties` (or `application.yml`) and
files referenced via `@ConfigurationProperties` are considered as files are loaded.
files referenced via `@ConfigurationProperties` are considered as files are loaded.
See
'<<boot-features-external-config-profile-specific-properties>>'
for details.
See
_<<boot-features-external-config-profile-specific-properties>>_
for details.
...
@@ -812,7 +812,7 @@ use the `spring-boot-starter-web` module to get up and running quickly.
...
@@ -812,7 +812,7 @@ use the `spring-boot-starter-web` module to get up and running quickly.
If you haven't yet developed a Spring Boot web application you can follow the
If you haven't yet developed a Spring Boot web application you can follow the
"Hello World!" example in the
"Hello World!" example in the
'<<getting-started.adoc#getting-started-first-application, Getting started>>'
section.
_<<getting-started.adoc#getting-started-first-application, Getting started>>_
section.
...
@@ -1406,7 +1406,7 @@ considered. A typical entity class would look something like this:
...
@@ -1406,7 +1406,7 @@ considered. A typical entity class would look something like this:
----
----
TIP: You can customize entity scanning locations using the `@EntityScan` annotation.
TIP: You can customize entity scanning locations using the `@EntityScan` annotation.
See the
'<<howto.adoc#howto-separate-entity-definitions-from-spring-configuration>>'
See the
_<<howto.adoc#howto-separate-entity-definitions-from-spring-configuration>>_
how-to.
how-to.
...
...
spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc
View file @
f58b8366
...
@@ -12,7 +12,7 @@ recommendations that, when followed, will make your development process just a
...
@@ -12,7 +12,7 @@ recommendations that, when followed, will make your development process just a
little
easier
.
little
easier
.
If
you
're just starting out with Spring Boot, you should probably read the
If
you
're just starting out with Spring Boot, you should probably read the
'
<<
getting
-
started
.
adoc
#
getting
-
started
,
Getting
Started
>>
'
guide before diving into
_<<getting-started.adoc#getting-started, Getting Started>>_
guide before diving into
this section.
this section.
--
--
...
@@ -21,7 +21,7 @@ this section.
...
@@ -21,7 +21,7 @@ this section.
[[using-boot-build-systems]]
[[using-boot-build-systems]]
== Build systems
== Build systems
It is strongly recommended that you choose a build system that supports _dependency
It is strongly recommended that you choose a build system that supports _dependency
management_, and one that can consume artifacts published to the
``Maven Central''
management_, and one that can consume artifacts published to the
"`Maven Central`"
repository. We would recommend that you choose Maven or Gradle. It is possible to get
repository. We would recommend that you choose Maven or Gradle. It is possible to get
Spring Boot to work with other build systems (Ant for example), but they will not be
Spring Boot to work with other build systems (Ant for example), but they will not be
particularly well supported.
particularly well supported.
...
@@ -134,8 +134,8 @@ the parent.
...
@@ -134,8 +134,8 @@ the parent.
[[
using
-
boot
-
gradle
]]
[[
using
-
boot
-
gradle
]]
===
Gradle
===
Gradle
Gradle
users
can
directly
import
``
starter
POMs
''
in
their
`
dependencies
`
section
.
Unlike
Gradle
users
can
directly
import
"`starter POMs`"
in
their
`
dependencies
`
section
.
Unlike
Maven
,
there
is
no
``
super
parent
''
to
import
to
share
some
configuration
.
Maven
,
there
is
no
"`super parent`"
to
import
to
share
some
configuration
.
[
source
,
groovy
,
indent
=
0
,
subs
=
"attributes"
]
[
source
,
groovy
,
indent
=
0
,
subs
=
"attributes"
]
----
----
...
@@ -151,7 +151,7 @@ The <<build-tool-plugins.adoc#build-tool-plugins-gradle-plugin, `spring-boot-gra
...
@@ -151,7 +151,7 @@ The <<build-tool-plugins.adoc#build-tool-plugins-gradle-plugin, `spring-boot-gra
is
also
available
and
provides
tasks
to
create
executable
jars
and
run
projects
from
is
also
available
and
provides
tasks
to
create
executable
jars
and
run
projects
from
source
.
It
also
adds
a
`
ResolutionStrategy
`
that
enables
you
to
source
.
It
also
adds
a
`
ResolutionStrategy
`
that
enables
you
to
<<
build
-
tool
-
plugins
-
gradle
-
dependencies
-
without
-
versions
,
omit
the
version
number
<<
build
-
tool
-
plugins
-
gradle
-
dependencies
-
without
-
versions
,
omit
the
version
number
for
``
blessed
''
dependencies
>>:
for
"`blessed`"
dependencies
>>:
[
source
,
groovy
,
indent
=
0
,
subs
=
"attributes"
]
[
source
,
groovy
,
indent
=
0
,
subs
=
"attributes"
]
----
----
...
@@ -180,7 +180,7 @@ It is possible to build a Spring Boot project using Apache Ant, however, no spec
...
@@ -180,7 +180,7 @@ It is possible to build a Spring Boot project using Apache Ant, however, no spec
support
or
plugins
are
provided
.
Ant
scripts
can
use
the
Ivy
dependency
system
to
import
support
or
plugins
are
provided
.
Ant
scripts
can
use
the
Ivy
dependency
system
to
import
starter
POMs
.
starter
POMs
.
See
the
'<<howto.adoc#howto-build-an-executable-archive-with-ant>>'
``
How
-
to
''
for
more
See
the
_
<<
howto
.
adoc
#
howto
-
build
-
an
-
executable
-
archive
-
with
-
ant
>>
_
"`How-to`"
for
more
complete
instructions
.
complete
instructions
.
...
@@ -217,13 +217,13 @@ The following application starters are provided by Spring Boot under the
...
@@ -217,13 +217,13 @@ The following application starters are provided by Spring Boot under the
|The core Spring Boot starter, including auto-configuration support, logging and YAML.
|The core Spring Boot starter, including auto-configuration support, logging and YAML.
|`spring-boot-starter-amqp`
|`spring-boot-starter-amqp`
|Support for the
``Advanced Message Queuing Protocol''
via `spring-rabbit`.
|Support for the
"`Advanced Message Queuing Protocol`"
via `spring-rabbit`.
|`spring-boot-starter-aop`
|`spring-boot-starter-aop`
|Support for aspect-oriented programming including `spring-aop` and AspectJ.
|Support for aspect-oriented programming including `spring-aop` and AspectJ.
|`spring-boot-starter-batch`
|`spring-boot-starter-batch`
|Support for
``Spring Batch''
including HSQLDB database.
|Support for
"`Spring Batch`"
including HSQLDB database.
|`spring-boot-starter-data-elasticsearch`
|`spring-boot-starter-data-elasticsearch`
|Support for the Elasticsearch search and analytics engine including
|Support for the Elasticsearch search and analytics engine including
...
@@ -233,7 +233,7 @@ The following application starters are provided by Spring Boot under the
...
@@ -233,7 +233,7 @@ The following application starters are provided by Spring Boot under the
|Support for the GemFire distributed data store including `spring-data-gemfire`.
|Support for the GemFire distributed data store including `spring-data-gemfire`.
|`spring-boot-starter-data-jpa`
|`spring-boot-starter-data-jpa`
|Support for the
``Java Persistence API''
including `spring-data-jpa`, `spring-orm`
|Support for the
"`Java Persistence API`"
including `spring-data-jpa`, `spring-orm`
and Hibernate.
and Hibernate.
|`spring-boot-starter-data-mongodb`
|`spring-boot-starter-data-mongodb`
...
@@ -252,7 +252,7 @@ and Hibernate.
...
@@ -252,7 +252,7 @@ and Hibernate.
|Support for the Groovy templating engine
|Support for the Groovy templating engine
|`spring-boot-starter-hornetq`
|`spring-boot-starter-hornetq`
|Support for
``Java Message Service API''
via HornetQ.
|Support for
"`Java Message Service API`"
via HornetQ.
|`spring-boot-starter-integration`
|`spring-boot-starter-integration`
|Support for common `spring-integration` modules.
|Support for common `spring-integration` modules.
...
@@ -299,7 +299,7 @@ and Hibernate.
...
@@ -299,7 +299,7 @@ and Hibernate.
|===
|===
In addition to the application starters, the following starters can be used to
In addition to the application starters, the following starters can be used to
add
'
<<
production
-
ready
-
features
.
adoc
#
production
-
ready
,
production
ready
>>
'
features.
add
_<<production-ready-features.adoc#production-ready, production ready>>_
features.
.Spring Boot production ready starters
.Spring Boot production ready starters
|===
|===
...
@@ -346,9 +346,9 @@ best practices that help.
...
@@ -346,9 +346,9 @@ best practices that help.
[[using-boot-using-the-default-package]]
[[using-boot-using-the-default-package]]
=== Using the
``default''
package
=== Using the
"`default`"
package
When a class doesn'
t
include
a
`
package
`
declaration
it
is
considered
to
be
in
the
When a class doesn'
t
include
a
`
package
`
declaration
it
is
considered
to
be
in
the
``
default
package
''
.
The
use
of
the
``
default
package
''
is
generally
discouraged
,
and
"`default package`"
.
The
use
of
the
"`default package`"
is
generally
discouraged
,
and
should
be
avoided
.
It
can
cause
particular
problems
for
Spring
Boot
applications
that
should
be
avoided
.
It
can
cause
particular
problems
for
Spring
Boot
applications
that
use
`@
ComponentScan
`
or
`@
EntityScan
`
annotations
,
since
every
class
from
every
jar
,
use
`@
ComponentScan
`
or
`@
EntityScan
`
annotations
,
since
every
class
from
every
jar
,
will
be
read
.
will
be
read
.
...
@@ -362,7 +362,7 @@ and use a reversed domain name (for example, `com.example.project`).
...
@@ -362,7 +362,7 @@ and use a reversed domain name (for example, `com.example.project`).
=== Locating the main application class
=== Locating the main application class
We generally recommend that you locate your main application class in a root package
We generally recommend that you locate your main application class in a root package
above other classes. The `@EnableAutoConfiguration` annotation is often placed on your
above other classes. The `@EnableAutoConfiguration` annotation is often placed on your
main class, and it implicitly defines a base
``search package''
for certain items. For
main class, and it implicitly defines a base
"`search package`"
for certain items. For
example, if you are writing a JPA application, the package of the
example, if you are writing a JPA application, the package of the
`@EnableAutoConfiguration` annotated class will be used to search for `@Entity` items.
`@EnableAutoConfiguration` annotated class will be used to search for `@Entity` items.
...
@@ -554,8 +554,8 @@ http://maven.apache.org/plugins/maven-eclipse-plugin/[Eclipse] and
...
@@ -554,8 +554,8 @@ http://maven.apache.org/plugins/maven-eclipse-plugin/[Eclipse] and
http://maven.apache.org/plugins/maven-idea-plugin/[IDEA]; Gradle offers plugins
http://maven.apache.org/plugins/maven-idea-plugin/[IDEA]; Gradle offers plugins
for http://www.gradle.org/docs/current/userguide/ide_support.html[various IDEs].
for http://www.gradle.org/docs/current/userguide/ide_support.html[various IDEs].
TIP: If you accidentally run a web application twice you will see a
`
`Port already in
TIP: If you accidentally run a web application twice you will see a
"
`Port already in
use
''
error. STS users can use the `Relaunch` button rather than `Run` to ensure that
use
`"
error. STS users can use the `Relaunch` button rather than `Run` to ensure that
any existing instance is closed.
any existing instance is closed.
...
@@ -585,7 +585,7 @@ This allows you to attach a debugger to your packaged application:
...
@@ -585,7 +585,7 @@ This allows you to attach a debugger to your packaged application:
=== Using the Maven plugin
=== Using the Maven plugin
The Spring Boot Maven plugin includes a `run` goal which can be used to quickly compile
The Spring Boot Maven plugin includes a `run` goal which can be used to quickly compile
and run your application. Applications run in an exploded form, and you can edit
and run your application. Applications run in an exploded form, and you can edit
resources for instant
``hot''
reload.
resources for instant
"`hot`"
reload.
[indent=0,subs="attributes"]
[indent=0,subs="attributes"]
----
----
...
@@ -599,7 +599,7 @@ Useful operating system environment variable:
...
@@ -599,7 +599,7 @@ Useful operating system environment variable:
$ export MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=128M -Djava.security.egd=file:/dev/./urandom
$ export MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=128M -Djava.security.egd=file:/dev/./urandom
----
----
(The
``egd''
setting is to speed up Tomcat startup by giving it a faster source of
(The
"`egd`"
setting is to speed up Tomcat startup by giving it a faster source of
entropy for session keys.)
entropy for session keys.)
...
@@ -632,7 +632,7 @@ replace, for a more complete solution the
...
@@ -632,7 +632,7 @@ replace, for a more complete solution the
https://github.com/spring-projects/spring-loaded[Spring Loaded] project, or
https://github.com/spring-projects/spring-loaded[Spring Loaded] project, or
http://zeroturnaround.com/software/jrebel/[JRebel] can be used.
http://zeroturnaround.com/software/jrebel/[JRebel] can be used.
See the <<howto.adoc#howto-hotswapping, Hot swapping
``How-to''
>> section for details.
See the <<howto.adoc#howto-hotswapping, Hot swapping
"`How-to`"
>> section for details.
...
@@ -641,9 +641,9 @@ See the <<howto.adoc#howto-hotswapping, Hot swapping ``How-to''>> section for de
...
@@ -641,9 +641,9 @@ See the <<howto.adoc#howto-hotswapping, Hot swapping ``How-to''>> section for de
Executable jars can be used for production deployment. As they are self-contained, they
Executable jars can be used for production deployment. As they are self-contained, they
are also ideally suited for cloud-based deployment.
are also ideally suited for cloud-based deployment.
For additional
``production ready''
features, such as health, auditing and metric REST
For additional
"`production ready`"
features, such as health, auditing and metric REST
or JMX end-points; consider adding `spring-boot-actuator`. See
or JMX end-points; consider adding `spring-boot-actuator`. See
'
<<
production
-
ready
-
features
.
adoc
#
production
-
ready
>>
'
for details.
_<<production-ready-features.adoc#production-ready>>_
for details.
...
@@ -651,7 +651,7 @@ or JMX end-points; consider adding `spring-boot-actuator`. See
...
@@ -651,7 +651,7 @@ or JMX end-points; consider adding `spring-boot-actuator`. See
== What to read next
== What to read next
You should now have good understanding of how you can use Spring Boot along with some best
You should now have good understanding of how you can use Spring Boot along with some best
practices that you should follow. You can now go on to learn about specific
practices that you should follow. You can now go on to learn about specific
'
<<
spring
-
boot
-
features
#
boot
-
features
,
Spring
Boot
features
>>
'
in depth, or you
_<<spring-boot-features#boot-features, Spring Boot features>>_
in depth, or you
could skip ahead and read about the
could skip ahead and read about the
``<<production-ready-features#production-ready, production ready>>''
aspects of Spring
"`<<production-ready-features#production-ready, production ready>>`"
aspects of Spring
Boot.
Boot.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment