Fix README Quick Start Java Example
- Update pom.xml to be valid - Change to use milestone repository instead of snapshot - Add file name for SampleController.java - Correct EnableAutoConfiguration import - Add missing ;
This commit is contained in:
parent
461f508cc6
commit
3662a8b347
21
README.md
21
README.md
@ -79,8 +79,11 @@ an IDE you can. Create a `pom.xml` (or the equivalent with your favourite build
|
|||||||
`pom.xml`
|
`pom.xml`
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<pom>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<artifactId>myproject</myproject>
|
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>myproject</artifactId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
@ -105,24 +108,24 @@ an IDE you can. Create a `pom.xml` (or the equivalent with your favourite build
|
|||||||
<!-- TODO: remove once Spring Boot is in Maven Central -->
|
<!-- TODO: remove once Spring Boot is in Maven Central -->
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>spring-snapshots</id>
|
<id>spring-milestone</id>
|
||||||
<url>http://repo.springsource.org/snapshot</url>
|
<url>http://repo.springsource.org/milestone</url>
|
||||||
<snapshots><enabled>true</enabled></snapshots>
|
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
<pluginRepositories>
|
<pluginRepositories>
|
||||||
<pluginRepository>
|
<pluginRepository>
|
||||||
<id>spring-snapshots</id>
|
<id>spring-milestone</id>
|
||||||
<url>http://repo.springsource.org/snapshot</url>
|
<url>http://repo.springsource.org/milestone</url>
|
||||||
<snapshots><enabled>true</enabled></snapshots>
|
|
||||||
</pluginRepository>
|
</pluginRepository>
|
||||||
</pluginRepositories>
|
</pluginRepositories>
|
||||||
</pom>
|
</project>
|
||||||
```
|
```
|
||||||
|
|
||||||
Then just add a class in `src/main/java` with a `main()` method that
|
Then just add a class in `src/main/java` with a `main()` method that
|
||||||
calls `SpringApplication` and add `@EnableAutoConfiguration`, e.g:
|
calls `SpringApplication` and add `@EnableAutoConfiguration`, e.g:
|
||||||
|
|
||||||
|
`src/main/java/SampleController.java`
|
||||||
|
|
||||||
```java
|
```java
|
||||||
import org.springframework.boot.*;
|
import org.springframework.boot.*;
|
||||||
import org.springframework.boot.autoconfigure.*;
|
import org.springframework.boot.autoconfigure.*;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user