Extract code samples from docs

See gh-6313
This commit is contained in:
Phillip Webb
2021-05-02 15:59:28 -07:00
parent 0893df4a01
commit 9aad29da0c
101 changed files with 2502 additions and 579 deletions

View File

@@ -149,26 +149,9 @@ If you run `mvn dependency:tree` again, you see that there are now a number of a
To finish our application, we need to create a single Java file.
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:
[source,java,pending-extract=true,indent=0]
[source,java,indent=0]
----
import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.web.bind.annotation.*;
@RestController
@EnableAutoConfiguration
public class Example {
@RequestMapping("/")
String home() {
return "Hello World!";
}
public static void main(String[] args) {
SpringApplication.run(Example.class, args);
}
}
include::{docs-java}/gettingstarted/firstapplication/code/Example.java[]
----
Although there is not much code here, quite a lot is going on.