25.02.2015 Views

Introducing Spring Framework

Introducing Spring Framework

Introducing Spring Framework

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 19<br />

<strong>Spring</strong> Boot, Simplifying Everything<br />

In Chapter 1, I showed a sneak peek of <strong>Spring</strong> Boot, a new technology by the <strong>Spring</strong> <strong>Framework</strong> team. In this chapter,<br />

you are going to translate your My Documents application into a <strong>Spring</strong> Boot application.<br />

You can think of <strong>Spring</strong> Boot as a bootstrap engine that helps to create stand-alone and production-ready <strong>Spring</strong><br />

applications with minimal effort—just code, and you don’t have to worry about any extra configuration. <strong>Spring</strong> Boot<br />

gives you the flexibility to use Java or even Groovy scripts to create applications without any configuration files. In<br />

previous chapters, you depended on XML configuration files. <strong>Spring</strong> Boot eliminates all that!<br />

<strong>Spring</strong> Boot<br />

Let’s start coding. Your first <strong>Spring</strong> Boot application will be in Java and you will still use Gradle as your building and<br />

testing tool. Listing 19-1 shows the build.gradle file and all the necessary dependencies.<br />

Listing 19-1. build.gradle<br />

buildscript {<br />

repositories {<br />

jcenter()<br />

mavenCentral()<br />

maven {<br />

url "http://repo.spring.io/libs-snapshot"<br />

url 'http://repo.spring.io/milestone'<br />

url 'http://repo.spring.io/libs-release'<br />

}<br />

mavenLocal()<br />

}<br />

dependencies {<br />

classpath (group: 'org.springframework.boot', name:'spring-boot-gradle-plugin',<br />

version: '1.1.1.RELEASE')<br />

}<br />

}<br />

apply plugin: 'java'<br />

apply plugin: 'eclipse'<br />

apply plugin: 'idea'<br />

apply plugin: 'spring-boot'<br />

263

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!