O'Reilly logo

Mastering Spring Application Development by Anjana Mankale

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Spring Gradle MVC application

Gradle is similar to Maven; it helps in building the applications. We need to provide all the dependency information in the build.gradle file. Spring boot also has a Gradle plugin. The Gradle plugin helps in placing all the dependencies JAR files on the classpath and finally builds into a single runnable JAR file. The runnable JAR file will have an application.java file; this class will have a public static void main() method. This class will be flagged as a runnable class.

A sample Gradle file is shown here:

buildscript { repositories { maven { url "http://repo.spring.io/libs-milestone" } mavenLocal() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:1.1.3.RELEASE") } } apply plugin: 'java' ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required