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> <version>0.1.0</version>
<parent> <parent>
<groupId>org.springframework.zero</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-starter-parent</artifactId> <artifactId>spring-boot-up-parent</artifactId>
<version>0.5.0.BUILD-SNAPSHOT</version> <version>0.5.0.BUILD-SNAPSHOT</version>
</parent> </parent>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.zero</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-starter-batch</artifactId> <artifactId>spring-boot-up-batch</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.hsqldb</groupId> <groupId>org.hsqldb</groupId>
@ -99,7 +99,7 @@ In a project directory of your choosing, create the following subdirectory struc
</project> </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. 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> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.zero</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-package-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
</plugins> </plugins>
</build> </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 `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 ```sh
$ mvn package $ 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. > **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> <version>0.1.0</version>
<parent> <parent>
<groupId>org.springframework.zero</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-starter-parent</artifactId> <artifactId>spring-boot-up-parent</artifactId>
<version>0.5.0.BUILD-SNAPSHOT</version> <version>0.5.0.BUILD-SNAPSHOT</version>
</parent> </parent>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.zero</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-starter-batch</artifactId> <artifactId>spring-boot-up-batch</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.hsqldb</groupId> <groupId>org.hsqldb</groupId>
@ -31,8 +31,8 @@
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.zero</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-package-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>

View File

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