Skip to content

Commit ae1be76

Browse files
committed
Add pending-extract attribute to source
Add `pending-extract=true` to source blocks to help us identify those that need to be extracted to a real source file. See gh-6313
1 parent 073f8c4 commit ae1be76

File tree

9 files changed

+187
-188
lines changed

9 files changed

+187
-188
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-configuration-metadata.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ Deprecation can also be specified declaratively in code by adding the `@Deprecat
220220
For instance, assume that the `app.acme.target` property was confusing and was renamed to `app.acme.name`.
221221
The following example shows how to handle that situation:
222222

223-
[source,java,indent=0]
223+
[source,java,pending-extract=true,indent=0]
224224
----
225225
@ConfigurationProperties("app.acme")
226226
public class AcmeProperties {
@@ -343,7 +343,7 @@ The special `.keys` and `.values` suffixes must refer to the keys and the values
343343

344344
Assume a `sample.contexts` maps magic `String` values to an integer, as shown in the following example:
345345

346-
[source,java,indent=0]
346+
[source,java,pending-extract=true,indent=0]
347347
----
348348
@ConfigurationProperties("sample")
349349
public class SampleProperties {
@@ -762,7 +762,7 @@ The annotation processor also supports the use of the `@Data`, `@Getter`, and `@
762762

763763
Consider the following example:
764764

765-
[source,java,indent=0,subs="verbatim,attributes"]
765+
[source,java,pending-extract=true,indent=0,subs="verbatim,attributes"]
766766
----
767767
@ConfigurationProperties(prefix="server")
768768
public class ServerProperties {
@@ -799,7 +799,7 @@ Also, the annotation processor cannot auto-detect default values for ``Enum``s a
799799
For cases where the default value could not be detected, <<configuration-metadata-additional-metadata,manual metadata>> should be provided.
800800
Consider the following example:
801801

802-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
802+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
803803
----
804804
@ConfigurationProperties(prefix = "acme.messaging")
805805
public class MessagingProperties {
@@ -845,7 +845,7 @@ The annotation processor automatically considers inner classes as nested propert
845845
Rather than documenting the `ip` and `port` at the root of the namespace, we could create a sub-namespace for it.
846846
Consider the updated example:
847847

848-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
848+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
849849
----
850850
@ConfigurationProperties(prefix="server")
851851
public class ServerProperties {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ An exception is thrown if more than one candidate is found.
223223
=== Example Repackage Implementation
224224
The following example shows a typical repackage implementation:
225225

226-
[source,java,indent=0]
226+
[source,java,pending-extract=true,indent=0]
227227
----
228228
Repackager repackager = new Repackager(sourceJarFile);
229229
repackager.setBackupSource(false);

spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Process-scoped environment variables are language agnostic.
135135

136136
Environment variables do not always make for the easiest API, so Spring Boot automatically extracts them and flattens the data into properties that can be accessed through Spring's `Environment` abstraction, as shown in the following example:
137137

138-
[source,java,indent=0]
138+
[source,java,pending-extract=true,indent=0]
139139
----
140140
@Component
141141
class MyBean implements EnvironmentAware {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ If you run `mvn dependency:tree` again, you see that there are now a number of a
483483
To finish our application, we need to create a single Java file.
484484
By default, Maven compiles sources from `src/main/java`, so you need to create that directory structure and then add a file named `src/main/java/Example.java` to contain the following code:
485485

486-
[source,java,indent=0]
486+
[source,java,pending-extract=true,indent=0]
487487
----
488488
import org.springframework.boot.*;
489489
import org.springframework.boot.autoconfigure.*;

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

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Then the Spring Boot banner is not printed on startup, and the application is no
239239
Properties defined in external configuration override the values specified with the Java API, with the notable exception of the sources used to create the `ApplicationContext`.
240240
Consider the following application:
241241

242-
[source,java,indent=0]
242+
[source,java,pending-extract=true,indent=0]
243243
----
244244
new SpringApplicationBuilder()
245245
.bannerMode(Banner.Mode.OFF)
@@ -513,7 +513,7 @@ The best way to get that and be sure it has been initialized is to add a `@Bean`
513513

514514
Tests that use `@SpringBootTest(webEnvironment=WebEnvironment.RANDOM_PORT)` can also inject the actual port into a field by using the `@LocalServerPort` annotation, as shown in the following example:
515515

516-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
516+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
517517
----
518518
@SpringBootTest(webEnvironment=WebEnvironment.RANDOM_PORT)
519519
public class MyWebIntegrationTests {
@@ -658,7 +658,7 @@ and instead apply a customizer specific to your choice of server:
658658

659659
For Tomcat, we need to add an upgrade protocol:
660660

661-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
661+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
662662
----
663663
@Bean
664664
public TomcatConnectorCustomizer connectorCustomizer() {
@@ -668,7 +668,7 @@ For Tomcat, we need to add an upgrade protocol:
668668

669669
For Jetty, we need to add a connection factory to the existing connector:
670670

671-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
671+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
672672
----
673673
@Bean
674674
public JettyServerCustomizer serverCustomizer() {
@@ -687,7 +687,7 @@ For Jetty, we need to add a connection factory to the existing connector:
687687

688688
For Netty, we need to add `h2c` as a supported protocol:
689689

690-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
690+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
691691
----
692692
@Bean
693693
public NettyServerCustomizer serverCustomizer() {
@@ -697,7 +697,7 @@ For Netty, we need to add `h2c` as a supported protocol:
697697

698698
For Undertow, we need to enable the HTTP2 option:
699699

700-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
700+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
701701
----
702702
@Bean
703703
public UndertowBuilderCustomizer builderCustomizer() {
@@ -721,7 +721,7 @@ You can declare such a component and get access to the server factory relevant t
721721

722722
The example below is for Tomcat with the `spring-boot-starter-web` (Servlet stack):
723723

724-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
724+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
725725
----
726726
@Component
727727
public class MyTomcatWebServerCustomizer
@@ -802,7 +802,7 @@ Like any other Spring bean, you can define the order of Servlet filter beans; pl
802802
As <<howto-add-a-servlet-filter-or-listener-as-spring-bean,described earlier>>, any `Servlet` or `Filter` beans are registered with the servlet container automatically.
803803
To disable registration of a particular `Filter` or `Servlet` bean, create a registration bean for it and mark it as disabled, as shown in the following example:
804804

805-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
805+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
806806
----
807807
@Bean
808808
public FilterRegistrationBean registration(MyFilter filter) {
@@ -987,7 +987,7 @@ include::{include-howto}/embeddedwebservers/UndertowMultipleListenersConfigurati
987987
=== Create WebSocket Endpoints Using @ServerEndpoint
988988
If you want to use `@ServerEndpoint` in a Spring Boot application that used an embedded container, you must declare a single `ServerEndpointExporter` `@Bean`, as shown in the following example:
989989

990-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
990+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
991991
----
992992
@Bean
993993
public ServerEndpointExporter serverEndpointExporter() {
@@ -1012,7 +1012,7 @@ This section answers common questions about Spring MVC and Spring Boot.
10121012
=== Write a JSON REST Service
10131013
Any Spring `@RestController` in a Spring Boot application should render JSON response by default as long as Jackson2 is on the classpath, as shown in the following example:
10141014

1015-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
1015+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
10161016
----
10171017
@RestController
10181018
public class MyController {
@@ -1046,7 +1046,7 @@ To use the Jackson XML renderer, add the following dependency to your project:
10461046

10471047
If Jackson's XML extension is not available and JAXB is available, XML can be rendered with the additional requirement of having `MyThing` annotated as `@XmlRootElement`, as shown in the following example:
10481048

1049-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
1049+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
10501050
----
10511051
@XmlRootElement
10521052
public class MyThing {
@@ -1251,7 +1251,7 @@ For more detail, see the following sections:
12511251
Spring Security provides support for running tests as a specific user.
12521252
For example, the test in the snippet below will run with an authenticated user that has the `ADMIN` role.
12531253

1254-
[source,java,indent=0]
1254+
[source,java,pending-extract=true,indent=0]
12551255
----
12561256
@Test
12571257
@WithMockUser(roles="ADMIN")
@@ -1294,7 +1294,7 @@ To use Jersey alongside another web framework, such as Spring MVC, it should be
12941294
First, configure Jersey to use a Filter rather than a Servlet by configuring the configprop:spring.jersey.type[] application property with a value of `filter`.
12951295
Second, configure your `ResourceConfig` to forward requests that would have resulted in a 404, as shown in the following example.
12961296

1297-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
1297+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
12981298
----
12991299
@Component
13001300
public class JerseyConfig extends ResourceConfig {
@@ -1551,7 +1551,7 @@ If you need to externalize some settings, you can bind your `DataSource` to the
15511551

15521552
The following example shows how to define a data source in a bean:
15531553

1554-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
1554+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
15551555
----
15561556
@Bean
15571557
@ConfigurationProperties(prefix="app.datasource")
@@ -1729,7 +1729,7 @@ For more about Spring Data, see the {spring-data}[Spring Data project page].
17291729
Spring Boot tries to guess the location of your `@Entity` definitions, based on the `@EnableAutoConfiguration` it finds.
17301730
To get more control, you can use the `@EntityScan` annotation, as shown in the following example:
17311731

1732-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
1732+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
17331733
----
17341734
@Configuration(proxyBeanMethods = false)
17351735
@EnableAutoConfiguration
@@ -1806,7 +1806,7 @@ If you prefer to use Hibernate 5's default instead, set the following property:
18061806

18071807
Alternatively, you can configure the following bean:
18081808

1809-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
1809+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
18101810
----
18111811
@Bean
18121812
public PhysicalNamingStrategy physicalNamingStrategy() {
@@ -1858,7 +1858,7 @@ Even if the default `EntityManagerFactory` works fine, you need to define a new
18581858
You can use the `EntityManagerBuilder` provided by Spring Boot to help you to create one.
18591859
Alternatively, you can use the `LocalContainerEntityManagerFactoryBean` directly from Spring ORM, as shown in the following example:
18601860

1861-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
1861+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
18621862
----
18631863
// add two data sources configured as above
18641864
@@ -1896,7 +1896,7 @@ Alternatively, you might be able to use a JTA transaction manager that spans bot
18961896

18971897
If you use Spring Data, you need to configure `@EnableJpaRepositories` accordingly, as shown in the following example:
18981898

1899-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
1899+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
19001900
----
19011901
@Configuration(proxyBeanMethods = false)
19021902
@EnableJpaRepositories(basePackageClasses = Customer.class,
@@ -2206,7 +2206,7 @@ If your JMS broker does not support transacted sessions, you have to disable the
22062206
If you create your own `JmsListenerContainerFactory`, there is nothing to do, since, by default it cannot be transacted.
22072207
If you want to use the `DefaultJmsListenerContainerFactoryConfigurer` to reuse Spring Boot's default, you can disable transacted sessions, as follows:
22082208

2209-
[source,java,indent=0]
2209+
[source,java,pending-extract=true,indent=0]
22102210
----
22112211
@Bean
22122212
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory(
@@ -2399,7 +2399,7 @@ Alternatively, you can add the `RemoteIpValve` by customizing the `TomcatServlet
23992399

24002400
To configure Spring Security to require a secure channel for all (or some) requests, consider adding your own `SecurityFilterChain` bean that adds the following `HttpSecurity` configuration:
24012401

2402-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
2402+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
24032403
----
24042404
@Bean
24052405
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
@@ -2798,7 +2798,7 @@ The first step in producing a deployable war file is to provide a `SpringBootSer
27982798
Doing so makes use of Spring Framework's Servlet 3.0 support and lets you configure your application when it is launched by the servlet container.
27992799
Typically, you should update your application's main class to extend `SpringBootServletInitializer`, as shown in the following example:
28002800

2801-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
2801+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
28022802
----
28032803
@SpringBootApplication
28042804
public class Application extends SpringBootServletInitializer {
@@ -2875,7 +2875,7 @@ See the https://spring.io/guides/gs/convert-jar-to-war/[Getting Started Guide on
28752875

28762876
To create a deployable war by extending `SpringBootServletInitializer` (for example, in a class called `Application`) and adding the Spring Boot `@SpringBootApplication` annotation, use code similar to that shown in the following example:
28772877

2878-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
2878+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
28792879
----
28802880
@SpringBootApplication
28812881
public class Application extends SpringBootServletInitializer {
@@ -2908,7 +2908,7 @@ If you have other features in your application (for instance, using other servle
29082908

29092909
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:
29102910

2911-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
2911+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
29122912
----
29132913
public static void main(String[] args) {
29142914
SpringApplication.run(Application.class, args);
@@ -2919,7 +2919,7 @@ Once the war file is working, you can make it executable by adding a `main` meth
29192919
====
29202920
If you intend to start your application as a war or as an executable application, you need to share the customizations of the builder in a method that is both available to the `SpringBootServletInitializer` callback and in the `main` method in a class similar to the following:
29212921
2922-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
2922+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
29232923
----
29242924
@SpringBootApplication
29252925
public class Application extends SpringBootServletInitializer {
@@ -2969,7 +2969,7 @@ To deploy a Spring Boot application to WebLogic, you must ensure that your servl
29692969

29702970
A typical initializer for WebLogic should resemble the following example:
29712971

2972-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
2972+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
29732973
----
29742974
import org.springframework.boot.autoconfigure.SpringBootApplication;
29752975
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
@@ -3052,7 +3052,7 @@ It integrates with JUnit, allowing you to write a test class that can start up a
30523052
Testcontainers is especially useful for writing integration tests that talk to a real backend service such as MySQL, MongoDB, Cassandra etc.
30533053
Testcontainers can be used in a Spring Boot test as follows:
30543054

3055-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
3055+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
30563056
----
30573057
@SpringBootTest
30583058
@Testcontainers
@@ -3069,7 +3069,7 @@ In most cases, you will need to configure the application using details from the
30693069

30703070
This can be done with a static `@DynamicPropertySource` method that allows adding dynamic property values to the Spring Environment.
30713071

3072-
[source,java,indent=0,subs="verbatim,quotes,attributes"]
3072+
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
30733073
----
30743074
@SpringBootTest
30753075
@Testcontainers

0 commit comments

Comments
 (0)