Upgrade to Spring Boot

This commit is contained in:
Greg Turnquist 2013-07-30 10:19:08 -04:00
parent 390a378078
commit b597faada0
3 changed files with 25 additions and 20 deletions

View File

@ -61,15 +61,15 @@ In a project directory of your choosing, create the following subdirectory struc
<version>0.1.0</version>
<parent>
<groupId>org.springframework.zero</groupId>
<artifactId>spring-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-up-parent</artifactId>
<version>0.5.0.BUILD-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.zero</groupId>
<artifactId>spring-starter-batch</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-up-batch</artifactId>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
@ -99,7 +99,7 @@ In a project directory of your choosing, create the following subdirectory struc
</project>
```
TODO: mention that we're using Spring Bootstrap's [_starter POMs_](../gs-bootstrap-starter) here.
TODO: mention that we're using Spring Boot's [_starter POMs_](../gs-bootstrap-starter) here.
Note to experienced Maven users who are unaccustomed to using an external parent project: you can take it out later, it's just there to reduce the amount of code you have to write to get started.
@ -438,8 +438,8 @@ Add the following configuration to your existing Maven POM:
<build>
<plugins>
<plugin>
<groupId>org.springframework.zero</groupId>
<artifactId>spring-package-maven-plugin</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
@ -447,15 +447,20 @@ Add the following configuration to your existing Maven POM:
The `start-class` property tells Maven to create a `META-INF/MANIFEST.MF` file with a `Main-Class: hello.Application` entry. This entry enables you to run the jar with `java -jar`.
The [Spring Package maven plugin][spring-package-maven-plugin] collects all the jars on the classpath and builds a single "über-jar", which makes it more convenient to execute and transport your service.
The [Spring Boot maven plugin][spring-boot-maven-plugin] collects all the jars on the classpath and builds a single "über-jar", which makes it more convenient to execute and transport your service.
Now run the following to produce a single executable JAR file containing all necessary dependency classes and resources:
Now run the following command to produce a single executable JAR file containing all necessary dependency classes and resources:
```sh
$ mvn package
```
[spring-package-maven-plugin]: https://github.com/SpringSource/spring-zero/tree/master/spring-package-maven-plugin
To run the package, run this:
```sh
$ mvn spring-boot:run
```
[spring-boot-maven-plugin]: https://github.com/SpringSource/spring-boot/tree/master/spring-boot-maven-plugin
> **Note:** The procedure above will create a runnable JAR. You can also opt to [build a classic WAR file](/guides/gs/convert-jar-to-war/content) instead.

View File

@ -8,15 +8,15 @@
<version>0.1.0</version>
<parent>
<groupId>org.springframework.zero</groupId>
<artifactId>spring-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-up-parent</artifactId>
<version>0.5.0.BUILD-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.zero</groupId>
<artifactId>spring-starter-batch</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-up-batch</artifactId>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
@ -31,8 +31,8 @@
<build>
<plugins>
<plugin>
<groupId>org.springframework.zero</groupId>
<artifactId>spring-package-maven-plugin</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

View File

@ -8,15 +8,15 @@
<version>0.1.0</version>
<parent>
<groupId>org.springframework.zero</groupId>
<artifactId>spring-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-up-parent</artifactId>
<version>0.5.0.BUILD-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.zero</groupId>
<artifactId>spring-starter-batch</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-up-batch</artifactId>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>