diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/endpoints.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/endpoints.adoc index 165c5352de..ded6330f1b 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/endpoints.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/endpoints.adoc @@ -1159,9 +1159,12 @@ If you want to display the full git information (that is, the full content of `g To disable the git commit information from the `info` endpoint completely, set the configprop:management.info.git.enabled[] property to `false`, as follows: -[source,properties,indent=0,subs="verbatim",configprops] +[source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- - management.info.git.enabled=false + management: + info: + git: + enabled: false ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins/antlib.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins/antlib.adoc index 90a8351e75..a7be882b6b 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins/antlib.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins/antlib.adoc @@ -15,7 +15,7 @@ To use the module, you need to declare an additional `spring-boot` namespace in You need to remember to start Ant using the `-lib` option, as shown in the following example: -[indent=0,subs="verbatim,attributes"] +[source,shell,indent=0,subs="verbatim,attributes"] ---- $ ant -lib ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/groovy-beans-dsl.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/groovy-beans-dsl.adoc index 4afc812161..b523e3d30b 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/groovy-beans-dsl.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/groovy-beans-dsl.adoc @@ -3,7 +3,7 @@ Spring Framework 4.0 has native support for a `beans{}` "`DSL`" (borrowed from https://grails.org/[Grails]), and you can embed bean definitions in your Groovy application scripts by using the same format. This is sometimes a good way to include external features like middleware declarations, as shown in the following example: -[source,groovy,indent=0,subs="verbatim"] +[source,groovy,pending-extract=true,indent=0,subs="verbatim"] ---- @Configuration(proxyBeanMethods = false) class Application implements CommandLineRunner { diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/using-the-cli.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/using-the-cli.adoc index e8789a3cde..0939f0e2ae 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/using-the-cli.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/using-the-cli.adoc @@ -3,7 +3,7 @@ Once you have installed the CLI, you can run it by typing `spring` and pressing Enter at the command line. If you run `spring` without any arguments, a help screen is displayed, as follows: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ spring usage: spring [--help] [--version] @@ -19,7 +19,7 @@ If you run `spring` without any arguments, a help screen is displayed, as follow You can type `spring help` to get more details about any of the supported commands, as shown in the following example: -[indent=0] +[source,shell,indent=0,subs="verbatim"] ---- $ spring help run spring run - Run a spring groovy script @@ -41,7 +41,7 @@ You can type `spring help` to get more details about any of the supported comman The `version` command provides a quick way to check which version of Spring Boot you are using, as follows: -[indent=0,subs="verbatim,attributes"] +[source,shell,indent=0,subs="verbatim,attributes"] ---- $ spring version Spring CLI v{spring-boot-version} @@ -64,21 +64,21 @@ include::{docs-groovy}/cli/usingthecli/run/WebApplication.groovy[tag=*] To compile and run the application, type the following command: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ spring run hello.groovy ---- To pass command-line arguments to the application, use `--` to separate the commands from the "`spring`" command arguments, as shown in the following example: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ spring run hello.groovy -- --server.port=9000 ---- To set JVM command line arguments, you can use the `JAVA_OPTS` environment variable, as shown in the following example: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ JAVA_OPTS=-Xmx1024m spring run hello.groovy ---- @@ -201,7 +201,7 @@ However, to ensure consistent ordering of the dependency management, you can use You can use "`shell globbing`" with all commands that accept file input. Doing so lets you use multiple files from a single directory, as shown in the following example: -[indent=0] +[source,shell,indent=0,subs="verbatim"] ---- $ spring run *.groovy ---- @@ -212,7 +212,7 @@ Doing so lets you use multiple files from a single directory, as shown in the fo === Packaging Your Application You can use the `jar` command to package your application into a self-contained executable jar file, as shown in the following example: -[indent=0] +[source,shell,indent=0,subs="verbatim"] ---- $ spring jar my-app.jar *.groovy ---- @@ -243,7 +243,7 @@ Type `spring help jar` on the command line for more information. === Initialize a New Project The `init` command lets you create a new project by using https://start.spring.io without leaving the shell, as shown in the following example: -[indent=0] +[source,shell,indent=0,subs="verbatim"] ---- $ spring init --dependencies=web,data-jpa my-project Using service at https://start.spring.io @@ -253,7 +253,7 @@ The `init` command lets you create a new project by using https://start.spring.i The preceding example creates a `my-project` directory with a Maven-based project that uses `spring-boot-starter-web` and `spring-boot-starter-data-jpa`. You can list the capabilities of the service by using the `--list` flag, as shown in the following example: -[indent=0] +[source,shell,indent=0,subs="verbatim"] ---- $ spring init --list ======================================= @@ -282,7 +282,7 @@ The `init` command supports many options. See the `help` output for more details. For instance, the following command creates a Gradle project that uses Java 8 and `war` packaging: -[indent=0] +[source,shell,indent=0,subs="verbatim"] ---- $ spring init --build=gradle --java-version=1.8 --dependencies=websocket --packaging=war sample-app.zip Using service at https://start.spring.io @@ -296,7 +296,7 @@ For instance, the following command creates a Gradle project that uses Java 8 an Spring Boot includes command-line completion scripts for the BASH and zsh shells. If you do not use either of these shells (perhaps you are a Windows user), you can use the `shell` command to launch an integrated shell, as shown in the following example: -[indent=0,subs="verbatim,quotes,attributes"] +[source,shell,indent=0,subs="verbatim,quotes,attributes"] ---- $ spring shell *Spring Boot* (v{spring-boot-version}) @@ -305,7 +305,7 @@ If you do not use either of these shells (perhaps you are a Windows user), you c From inside the embedded shell, you can run other commands directly: -[indent=0,subs="verbatim,attributes"] +[source,shell,indent=0,subs="verbatim,attributes"] ---- $ version Spring CLI v{spring-boot-version} @@ -322,7 +322,7 @@ To exit the embedded shell, press `ctrl-c`. You can add extensions to the CLI by using the `install` command. The command takes one or more sets of artifact coordinates in the format `group:artifact:version`, as shown in the following example: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ spring install com.example:spring-boot-cli-extension:1.0.0.RELEASE ---- @@ -332,7 +332,7 @@ In addition to installing the artifacts identified by the coordinates you supply To uninstall a dependency, use the `uninstall` command. As with the `install` command, it takes one or more sets of artifact coordinates in the format of `group:artifact:version`, as shown in the following example: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ spring uninstall com.example:spring-boot-cli-extension:1.0.0.RELEASE ---- @@ -341,7 +341,7 @@ It uninstalls the artifacts identified by the coordinates you supply and their d To uninstall all additional dependencies, you can use the `--all` option, as shown in the following example: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ spring uninstall --all ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/format.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/format.adoc index f7d7825d43..e477628365 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/format.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/format.adoc @@ -66,12 +66,13 @@ They use a JSON format with items categorized under either "`groups`" or "`prope ---- Each "`property`" is a configuration item that the user specifies with a given value. -For example, `server.port` and `server.address` might be specified in `application.properties`, as follows: +For example, `server.port` and `server.address` might be specified in your `application.properties`/`application.yaml`, as follows: -[source,properties,indent=0,subs="verbatim",configprops] +[source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- - server.port=9090 - server.address=127.0.0.1 + server: + port: 9090 + address: 127.0.0.1 ---- The "`groups`" are higher level items that do not themselves specify a value but instead provide a contextual grouping for properties. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/cloud.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/cloud.adoc index 4920eb083d..7853d0a5fc 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/cloud.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/cloud.adoc @@ -27,7 +27,7 @@ Once you have built your application (by using, for example, `mvn clean package` Be sure to have https://docs.cloudfoundry.org/cf-cli/getting-started.html#login[logged in with your `cf` command line client] before pushing an application. The following line shows using the `cf push` command to deploy an application: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ cf push acloudyspringtime -p target/demo-0.0.1-SNAPSHOT.jar ---- @@ -68,7 +68,7 @@ Congratulations! The application is now live! Once your application is live, you can verify the status of the deployed application by using the `cf apps` command, as shown in the following example: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ cf apps Getting applications in ... @@ -126,14 +126,14 @@ The preStop handler can be configured via the PodSpec in the pod's configuration [source,yml,indent=0,subs="verbatim"] ---- -spec: - containers: - - name: example-container - image: example-image - lifecycle: - preStop: - exec: - command: ["sh", "-c", "sleep 10"] + spec: + containers: + - name: example-container + image: example-image + lifecycle: + preStop: + exec: + command: ["sh", "-c", "sleep 10"] ---- Once the pre-stop hook has completed, SIGTERM will be sent to the container and <> will begin, allowing any remaining in-flight requests to complete. @@ -161,7 +161,7 @@ The `$PORT` environment variable is assigned to us by the Heroku PaaS. This should be everything you need. The most common deployment workflow for Heroku deployments is to `git push` the code to production, as shown in the following example: -[indent=0,subs="verbatim,quotes"] +[source,shell,indent=0,subs="verbatim,quotes"] ---- $ git push heroku main @@ -308,7 +308,7 @@ Boxfuse leverages this information both for the images it produces as well as fo Once you have created a https://console.boxfuse.com[Boxfuse account], connected it to your AWS account, installed the latest version of the Boxfuse Client, and ensured that the application has been built by Maven or Gradle (by using, for example, `mvn clean package`), you can deploy your Spring Boot application to AWS with a command similar to the following: -[indent=0] +[source,shell,indent=0,subs="verbatim"] ---- $ boxfuse run myapp-1.0.jar -env=prod ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/containers.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/containers.adoc index be1979f124..ee67b1c011 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/containers.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/containers.adoc @@ -5,7 +5,7 @@ Certain PaaS implementations may also choose to unpack archives before they run. For example, Cloud Foundry operates this way. One way to run an unpacked archive is by starting the appropriate launcher, as follows: -[indent=0] +[source,shell,indent=0,subs="verbatim"] ---- $ jar -xf myapp.jar $ java org.springframework.boot.loader.JarLauncher @@ -16,7 +16,7 @@ At runtime you shouldn't expect any differences. Once you have unpacked the jar file, you can also get an extra boost to startup time by running the app with its "natural" main method instead of the `JarLauncher`. For example: -[indent=0] +[source,shell,indent=0,subs="verbatim"] ---- $ jar -xf myapp.jar $ java -cp BOOT-INF/classes:BOOT-INF/lib/* com.example.MyApplication diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/installing.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/installing.adoc index 5ef2fa9aad..71931d050f 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/installing.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/installing.adoc @@ -66,7 +66,7 @@ The script supports the following features: Assuming that you have a Spring Boot application installed in `/var/myapp`, to install a Spring Boot application as an `init.d` service, create a symlink, as follows: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ sudo ln -s /var/myapp/myapp.jar /etc/init.d/myapp ---- @@ -74,7 +74,7 @@ Assuming that you have a Spring Boot application installed in `/var/myapp`, to i Once installed, you can start and stop the service in the usual way. For example, on a Debian-based system, you could start it with the following command: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ service myapp start ---- @@ -84,7 +84,7 @@ TIP: If your application fails to start, check the log file written to `/var/log You can also flag the application to start automatically by using your standard operating system tools. For example, on Debian, you could use the following command: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ update-rc.d myapp defaults ---- @@ -101,7 +101,7 @@ When the environment variable is not set, the user who owns the jar file is used You should never run a Spring Boot application as `root`, so `RUN_AS_USER` should never be root and your application's jar file should never be owned by root. Instead, create a specific user to run your application and set the `RUN_AS_USER` environment variable or use `chown` to make it the owner of the jar file, as shown in the following example: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ chown bootapp:bootapp your-app.jar ---- @@ -114,7 +114,7 @@ For example, you can set the account's shell to `/usr/sbin/nologin`. You should also take steps to prevent the modification of your application's jar file. Firstly, configure its permissions so that it cannot be written and can only be read or executed by its owner, as shown in the following example: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ chmod 500 your-app.jar ---- @@ -123,7 +123,7 @@ Second, you should also take steps to limit the damage if your application or th If an attacker does gain access, they could make the jar file writable and change its contents. One way to protect against this is to make it immutable by using `chattr`, as shown in the following example: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ sudo chattr +i your-app.jar ---- @@ -134,7 +134,7 @@ If root is used to control the application's service and you <> of an application. TIP: If you are using JUnit 4, don't forget to also add `@RunWith(SpringRunner.class)` to your test, otherwise the annotations will be ignored. -If you are using JUnit 5, there's no need to add the equivalent `@ExtendWith(SpringExtension.class)` as `@SpringBootTest` and the other `@…Test` annotations are already annotated with it. +If you are using JUnit 5, there's no need to add the equivalent `@ExtendWith(SpringExtension.class)` as `@SpringBootTest` and the other `@...Test` annotations are already annotated with it. By default, `@SpringBootTest` will not start a server. You can use the `webEnvironment` attribute of `@SpringBootTest` to further refine how your tests run: diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/first-application.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/first-application.adoc index f5e1cfab7c..32215a2c5f 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/first-application.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/first-application.adoc @@ -15,7 +15,7 @@ Check the https://github.com/spring-io/start.spring.io/blob/main/USING.adoc[star Before we begin, open a terminal and run the following commands to ensure that you have valid versions of Java and Maven installed: -[indent=0] +[source,shell,indent=0,subs="verbatim"] ---- $ java -version java version "1.8.0_102" @@ -23,7 +23,7 @@ Before we begin, open a terminal and run the following commands to ensure that y Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode) ---- -[indent=0] +[source,shell,indent=0,subs="verbatim"] ---- $ mvn -v Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T14:33:14-04:00) @@ -119,7 +119,7 @@ Other "`Starters`" provide dependencies that you are likely to need when develop Since we are developing a web application, we add a `spring-boot-starter-web` dependency. Before that, we can look at what we currently have by running the following command: -[indent=0] +[source,shell,indent=0,subs="verbatim"] ---- $ mvn dependency:tree @@ -208,7 +208,7 @@ Since you used the `spring-boot-starter-parent` POM, you have a useful `run` goa Type `mvn spring-boot:run` from the root project directory to start the application. You should see output similar to the following: -[indent=0,subs="verbatim,attributes"] +[source,shell,indent=0,subs="verbatim,attributes"] ---- $ mvn spring-boot:run @@ -275,7 +275,7 @@ See the {spring-boot-maven-plugin-docs}#getting-started[plugin documentation] fo Save your `pom.xml` and run `mvn package` from the command line, as follows: -[indent=0,subs="verbatim,attributes"] +[source,shell,indent=0,subs="verbatim,attributes"] ---- $ mvn package @@ -298,7 +298,7 @@ If you look in the `target` directory, you should see `myproject-0.0.1-SNAPSHOT. The file should be around 10 MB in size. If you want to peek inside, you can use `jar tvf`, as follows: -[indent=0] +[source,shell,indent=0,subs="verbatim"] ---- $ jar tvf target/myproject-0.0.1-SNAPSHOT.jar ---- @@ -308,7 +308,7 @@ This is the original jar file that Maven created before it was repackaged by Spr To run that application, use the `java -jar` command, as follows: -[indent=0,subs="verbatim,attributes"] +[source,shell,indent=0,subs="verbatim,attributes"] ---- $ java -jar target/myproject-0.0.1-SNAPSHOT.jar diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/installing.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/installing.adoc index 50c995c8ca..d8b990d8c9 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/installing.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/installing.adoc @@ -4,7 +4,7 @@ Spring Boot can be used with "`classic`" Java development tools or installed as Either way, you need https://www.java.com[Java SDK v1.8] or higher. Before you begin, you should check your current Java installation by using the following command: -[indent=0] +[source,shell,indent=0,subs="verbatim"] ---- $ java -version ---- @@ -93,7 +93,7 @@ Alternatively, you can use `java -jar` with the `.jar` file (the script helps yo SDKMAN! (The Software Development Kit Manager) can be used for managing multiple versions of various binary SDKs, including Groovy and the Spring Boot CLI. Get SDKMAN! from https://sdkman.io and install Spring Boot by using the following commands: -[indent=0,subs="verbatim,attributes"] +[source,shell,indent=0,subs="verbatim,attributes"] ---- $ sdk install springboot $ spring --version @@ -102,7 +102,7 @@ Get SDKMAN! from https://sdkman.io and install Spring Boot by using the followin If you develop features for the CLI and want access to the version you built, use the following commands: -[indent=0,subs="verbatim,attributes"] +[source,shell,indent=0,subs="verbatim,attributes"] ---- $ sdk install springboot dev /path/to/spring-boot/spring-boot-cli/target/spring-boot-cli-{spring-boot-version}-bin/spring-{spring-boot-version}/ $ sdk default springboot dev @@ -115,7 +115,7 @@ It points at your target build location, so every time you rebuild Spring Boot, You can see it by running the following command: -[indent=0,subs="verbatim,attributes"] +[source,shell,indent=0,subs="verbatim,attributes"] ---- $ sdk ls springboot @@ -138,7 +138,7 @@ You can see it by running the following command: ==== OSX Homebrew Installation If you are on a Mac and use https://brew.sh/[Homebrew], you can install the Spring Boot CLI by using the following commands: -[indent=0] +[source,shell,indent=0,subs="verbatim"] ---- $ brew tap spring-io/tap $ brew install spring-boot @@ -155,7 +155,7 @@ In that case, run `brew update` and try again. ==== MacPorts Installation If you are on a Mac and use https://www.macports.org/[MacPorts], you can install the Spring Boot CLI by using the following command: -[indent=0] +[source,shell,indent=0,subs="verbatim"] ---- $ sudo port install spring-boot-cli ---- @@ -169,7 +169,7 @@ You can `source` the script (also named `spring`) in any shell or put it in your On a Debian system, the system-wide scripts are in `/shell-completion/bash` and all scripts in that directory are executed when a new shell starts. For example, to run the script manually if you have installed by using SDKMAN!, use the following commands: -[indent=0] +[source,shell,indent=0,subs="verbatim"] ---- $ . ~/.sdkman/candidates/springboot/current/shell-completion/bash/spring $ spring @@ -217,7 +217,7 @@ To start, create a file called `app.groovy`, as follows: Then run it from a shell, as follows: -[indent=0] +[source,shell,indent=0,subs="verbatim"] ---- $ spring run app.groovy ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/batch.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/batch.adoc index 7ab5d5ce25..e68ef9f6bb 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/batch.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/batch.adoc @@ -35,7 +35,7 @@ Spring Boot converts any command line argument starting with `--` to a property This should not be used to pass arguments to batch jobs. To specify batch arguments on the command line, use the regular format (i.e. without `--`), as shown in the following example: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ java -jar myapp.jar someParameter=someValue anotherParameter=anotherValue ---- @@ -43,7 +43,7 @@ To specify batch arguments on the command line, use the regular format (i.e. wit If you specify a property of the `Environment` on the command line, it is ignored by the job. Consider the following command: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ java -jar myapp.jar --server.port=7070 someParameter=someValue ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/properties-and-configuration.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/properties-and-configuration.adoc index f14e43d486..bc98458ef5 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/properties-and-configuration.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/properties-and-configuration.adoc @@ -218,7 +218,7 @@ See "`<>`" in the '`Spring Boot features The Spring `Environment` has an API for this, but you would normally set a System property (configprop:spring.profiles.active[]) or an OS environment variable (configprop:spring.profiles.active[format=envvar]). Also, you can launch your application with a `-D` argument (remember to put it before the main class or jar archive), as follows: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ java -jar -Dspring.profiles.active=production demo-0.0.1-SNAPSHOT.jar ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/traditional-deployment.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/traditional-deployment.adoc index 87a454c984..db67d906e5 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/traditional-deployment.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/traditional-deployment.adoc @@ -42,13 +42,13 @@ If you use Maven, the following example marks the servlet container (Tomcat, in [source,xml,indent=0,subs="verbatim"] ---- - + org.springframework.boot spring-boot-starter-tomcat provided - + ---- @@ -57,9 +57,9 @@ If you use Gradle, the following example marks the servlet container (Tomcat, in [source,gradle,indent=0,subs="verbatim"] ---- dependencies { - // … + // ... providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat' - // … + // ... } ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/test-auto-configuration.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/test-auto-configuration.adoc index 9b2605b6b4..b73138a5cf 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/test-auto-configuration.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/test-auto-configuration.adoc @@ -5,7 +5,7 @@ include::attributes.adoc[] -This appendix describes the `@…Test` auto-configuration annotations that Spring Boot provides to test slices of your application. +This appendix describes the `@...Test` auto-configuration annotations that Spring Boot provides to test slices of your application. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/test-auto-configuration/slices.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/test-auto-configuration/slices.adoc index a8567d196e..eef005567c 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/test-auto-configuration/slices.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/test-auto-configuration/slices.adoc @@ -1,6 +1,6 @@ [[test-auto-configuration.slices]] == Test Slices -The following table lists the various `@…Test` annotations that can be used to test slices of your application and the auto-configuration that they import by default: +The following table lists the various `@...Test` annotations that can be used to test slices of your application and the auto-configuration that they import by default: include::documented-slices.adoc[] diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using/running-your-application.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using/running-your-application.adoc index 4eea5ac5d4..314507433b 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using/running-your-application.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using/running-your-application.adoc @@ -30,7 +30,7 @@ STS users can use the `Relaunch` button rather than the `Run` button to ensure t === Running as a Packaged Application If you use the Spring Boot Maven or Gradle plugins to create an executable jar, you can run your application using `java -jar`, as shown in the following example: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ java -jar target/myapplication-0.0.1-SNAPSHOT.jar ---- @@ -38,7 +38,7 @@ If you use the Spring Boot Maven or Gradle plugins to create an executable jar, It is also possible to run a packaged application with remote debugging support enabled. Doing so lets you attach a debugger to your packaged application, as shown in the following example: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n \ -jar target/myapplication-0.0.1-SNAPSHOT.jar @@ -52,14 +52,14 @@ The Spring Boot Maven plugin includes a `run` goal that can be used to quickly c Applications run in an exploded form, as they do in your IDE. The following example shows a typical Maven command to run a Spring Boot application: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ mvn spring-boot:run ---- You might also want to use the `MAVEN_OPTS` operating system environment variable, as shown in the following example: -[indent=0,subs="verbatim"] +[source,shell,indent=0,subs="verbatim"] ---- $ export MAVEN_OPTS=-Xmx1024m ----