You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-configuration-metadata.adoc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ However, it is possible to <<configuration-metadata-additional-metadata,write pa
12
12
[[configuration-metadata-format]]
13
13
=== Metadata Format
14
14
Configuration metadata files are located inside jars under `META-INF/spring-configuration-metadata.json`.
15
-
They use a simple JSON format with items categorized under either "`groups`" or "`properties`" and additional values hints categorized under "hints", as shown in the following example:
15
+
They use a JSON format with items categorized under either "`groups`" or "`properties`" and additional values hints categorized under "hints", as shown in the following example:
16
16
17
17
[source,json,indent=0]
18
18
----
@@ -736,7 +736,7 @@ This dependency ensures that the additional metadata is available when the annot
736
736
The processor picks up both classes and methods that are annotated with `@ConfigurationProperties`.
737
737
The Javadoc for field values within configuration classes is used to populate the `description` attribute.
738
738
739
-
NOTE: You should only use simple text with `@ConfigurationProperties` field Javadoc, since they are not processed before being added to the JSON.
739
+
NOTE: You should only use plain text with `@ConfigurationProperties` field Javadoc, since they are not processed before being added to the JSON.
740
740
741
741
Properties are discovered through the presence of standard getters and setters with special handling for collection types (that is detected even if only a getter is present).
742
742
The annotation processor also supports the use of the `@Data`, `@Getter`, and `@Setter` lombok annotations.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/main/asciidoc/deployment.adoc
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ It minimizes divergence between development and production environments.
26
26
27
27
Ideally, your application, like a Spring Boot executable jar, has everything that it needs to run packaged within it.
28
28
29
-
In this section, we look at what it takes to get the <<getting-started.adoc#getting-started-first-application, simple application that we developed>> in the "`Getting Started`" section up and running in the Cloud.
29
+
In this section, we look at what it takes to get the <<getting-started.adoc#getting-started-first-application, application that we developed>> in the "`Getting Started`" section up and running in the Cloud.
30
30
31
31
32
32
@@ -227,7 +227,7 @@ The options include:
227
227
* AWS Container Registry
228
228
229
229
Each has different features and pricing models.
230
-
In this document, we describe only the simplest option: AWS Elastic Beanstalk.
230
+
In this document, we describe to approach using AWS Elastic Beanstalk.
231
231
232
232
233
233
@@ -399,7 +399,7 @@ Then deploy with `mvn appengine:deploy` (if you need to authenticate first, the
399
399
== Installing Spring Boot Applications
400
400
In addition to running Spring Boot applications by using `java -jar`, it is also possible to make fully executable applications for Unix systems.
401
401
A fully executable jar can be executed like any other executable binary or it can be <<deployment-service,registered with `init.d` or `systemd`>>.
402
-
This makes it very easy to install and manage Spring Boot applications in common production environments.
402
+
This helps when installing and managing Spring Boot applications in common production environments.
403
403
404
404
CAUTION: Fully executable jars work by embedding an extra script at the front of the file.
405
405
Currently, some tools do not accept this format, so you may not always be able to use this technique.
@@ -740,7 +740,7 @@ The following environment properties are supported with the default script:
740
740
| The explicit location of the jar file, in case the script is being used to launch a jar that it is not actually embedded.
741
741
742
742
| `DEBUG`
743
-
| If not empty, sets the `-x` flag on the shell process, making it easy to see the logic in the script.
743
+
| If not empty, sets the `-x` flag on the shell process, allowing you to see the logic in the script.
744
744
745
745
| `STOP_WAIT_TIME`
746
746
| The time in seconds to wait when stopping the application before forcing a shutdown (`60` by default).
NOTE: If you need access to the `BeanFactory` or the `Environment`, your `FailureAnalyzer` can simply implement `BeanFactoryAware` or `EnvironmentAware` respectively.
43
+
NOTE: If you need access to the `BeanFactory` or the `Environment`, your `FailureAnalyzer` can implement `BeanFactoryAware` or `EnvironmentAware` respectively.
44
44
45
45
46
46
@@ -417,7 +417,7 @@ Many Spring Boot starters include default embedded containers.
417
417
* For reactive stack applications, the `spring-boot-starter-webflux` includes Reactor Netty by including `spring-boot-starter-reactor-netty`, but you can use `spring-boot-starter-tomcat`, `spring-boot-starter-jetty`, or `spring-boot-starter-undertow` instead.
418
418
419
419
When switching to a different HTTP server, you need to exclude the default dependencies in addition to including the one you need.
420
-
Spring Boot provides separate starters for HTTP servers to help make this process as easy as possible.
420
+
To help with this process, Spring Boot provides a separate starter for each of the supported HTTP servers.
421
421
422
422
The following Maven example shows how to exclude Tomcat and include Jetty for Spring MVC:
423
423
@@ -1020,7 +1020,7 @@ The `ObjectMapper` (or `XmlMapper` for Jackson XML converter) instance (created
1020
1020
Spring Boot also has some features to make it easier to customize this behavior.
1021
1021
1022
1022
You can configure the `ObjectMapper` and `XmlMapper` instances by using the environment.
1023
-
Jackson provides an extensive suite of simple on/off features that can be used to configure various aspects of its processing.
1023
+
Jackson provides an extensive suite of on/off features that can be used to configure various aspects of its processing.
1024
1024
These features are described in six enums (in Jackson) that map onto properties in the environment:
1025
1025
1026
1026
|===
@@ -1281,7 +1281,7 @@ This ensures efficient sharing of resources for the server receiving requests an
1281
1281
== Logging
1282
1282
Spring Boot has no mandatory logging dependency, except for the Commons Logging API, which is typically provided by Spring Framework's `spring-jcl` module.
1283
1283
To use https://logback.qos.ch[Logback], you need to include it and `spring-jcl` on the classpath.
1284
-
The simplest way to do that is through the starters, which all depend on `spring-boot-starter-logging`.
1284
+
The recommended way to do that is through the starters, which all depend on `spring-boot-starter-logging`.
1285
1285
For a web application, you need only `spring-boot-starter-web`, since it depends transitively on the logging starter.
1286
1286
If you use Maven, the following dependency adds logging for you:
1287
1287
@@ -1395,7 +1395,7 @@ Spring Boot supports https://logging.apache.org/log4j/2.x[Log4j 2] for logging c
1395
1395
If you use the starters for assembling dependencies, you have to exclude Logback and then include log4j 2 instead.
1396
1396
If you do not use the starters, you need to provide (at least) `spring-jcl` in addition to Log4j 2.
1397
1397
1398
-
The simplest path is probably through the starters, even though it requires some jiggling with excludes.
1398
+
The recommended path is through the starters, even though it requires some jiggling with excludes.
1399
1399
The following example shows how to set up the starters in Maven:
@@ -1733,8 +1733,7 @@ See {spring-boot-autoconfigure-module-code}/orm/jpa/HibernateJpaAutoConfiguratio
1733
1733
Hibernate {hibernate-docs}#caching[second-level cache] can be configured for a range of cache providers.
1734
1734
Rather than configuring Hibernate to lookup the cache provider again, it is better to provide the one that is available in the context whenever possible.
1735
1735
1736
-
If you're using JCache, this is pretty easy.
1737
-
First, make sure that `org.hibernate:hibernate-jcache` is available on the classpath.
1736
+
To do this with JCache, first make sure that `org.hibernate:hibernate-jcache` is available on the classpath.
1738
1737
Then, add a `HibernatePropertiesCustomizer` bean as shown in the following example:
1739
1738
1740
1739
[source,java,indent=0]
@@ -1765,10 +1764,9 @@ Spring Boot auto-configuration switches off its entity manager in the presence o
1765
1764
1766
1765
[[howto-use-two-entity-managers]]
1767
1766
=== Use Two EntityManagers
1768
-
Even if the default `EntityManagerFactory` works fine, you need to define a new one.
1769
-
Otherwise, the presence of the second bean of that type switches off the default.
1770
-
To make it easy to do, you can use the convenient `EntityManagerBuilder` provided by Spring Boot.
1771
-
Alternatively, you can just the `LocalContainerEntityManagerFactoryBean` directly from Spring ORM, as shown in the following example:
1767
+
Even if the default `EntityManagerFactory` works fine, you need to define a new one, otherwise the presence of the second bean of that type switches off the default.
1768
+
You can use the `EntityManagerBuilder` provided by Spring Boot to help you to create one.
1769
+
Alternatively, you can use the `LocalContainerEntityManagerFactoryBean` directly from Spring ORM, as shown in the following example:
@@ -2158,7 +2156,7 @@ Overriding the error page with your own depends on the templating technology tha
2158
2156
For example, if you use Thymeleaf, you can add an `error.html` template.
2159
2157
If you use FreeMarker, you can add an `error.ftl` template.
2160
2158
In general, you need a `View` that resolves with a name of `error` or a `@Controller` that handles the `/error` path.
2161
-
Unless you replaced some of the default configuration, you should find a `BeanNameViewResolver` in your `ApplicationContext`, so a `@Bean` named `error` would be a simple way of doing that.
2159
+
Unless you replaced some of the default configuration, you should find a `BeanNameViewResolver` in your `ApplicationContext`, so a `@Bean` named `error` would be one way of doing that.
2162
2160
See {spring-boot-autoconfigure-module-code}/web/servlet/error/ErrorMvcAutoConfiguration.java[`ErrorMvcAutoConfiguration`] for more options.
2163
2161
2164
2162
See also the section on "`<<boot-features-error-handling, Error Handling>>`" for details of how to register handlers in the servlet container.
@@ -2731,8 +2729,7 @@ TIP: Take a look at Spring Boot's sample applications for a {spring-boot-code}/s
=== Convert an Existing Application to Spring Boot
2734
-
For a non-web application, it should be easy to convert an existing Spring application to a Spring Boot application.
2735
-
To do so, throw away the code that creates your `ApplicationContext` and replace it with calls to `SpringApplication` or `SpringApplicationBuilder`.
2732
+
To convert an existing non-web Spring application to a Spring Boot application, replace the code that creates your `ApplicationContext` and replace it with calls to `SpringApplication` or `SpringApplicationBuilder`.
2736
2733
Spring MVC web applications are generally amenable to first creating a deployable war application and then migrating it later to an executable war or jar.
2737
2734
See the https://spring.io/guides/gs/convert-jar-to-war/[Getting Started Guide on Converting a jar to a war].
2738
2735
@@ -2767,7 +2764,7 @@ If you have other features in your application (for instance, using other servle
2767
2764
* A `@Bean` of type `Servlet` or `ServletRegistrationBean` installs that bean in the container as if it were a `<servlet/>` and `<servlet-mapping/>` in `web.xml`.
2768
2765
* A `@Bean` of type `Filter` or `FilterRegistrationBean` behaves similarly (as a `<filter/>` and `<filter-mapping/>`).
2769
2766
* An `ApplicationContext` in an XML file can be added through an `@ImportResource` in your `Application`.
2770
-
Alternatively, simple cases where annotation configuration is heavily used already can be recreated in a few lines as `@Bean` definitions.
2767
+
Alternatively, cases where annotation configuration is heavily used already can be recreated in a few lines as `@Bean` definitions.
2771
2768
2772
2769
Once the war file is working, you can make it executable by adding a `main` method to your `Application`, as shown in the following example:
2773
2770
@@ -2871,7 +2868,7 @@ You can do so by adding a `WEB-INF/weblogic.xml` file with the following content
2871
2868
=== Use Jedis Instead of Lettuce
2872
2869
By default, the Spring Boot starter (`spring-boot-starter-data-redis`) uses https://github.com/lettuce-io/lettuce-core/[Lettuce].
2873
2870
You need to exclude that dependency and include the https://github.com/xetorthio/jedis/[Jedis] one instead.
2874
-
Spring Boot manages these dependencies to help make this process as easy as possible.
2871
+
Spring Boot manages both of these dependencies so you can switch to Jedis without specifying a version.
2875
2872
2876
2873
The following example shows how to do so in Maven:
0 commit comments