How To Set Up Spring Boot Project With Gradle

Photo of


You’ll learn to,

  • Set up the project using Gradle without Spring Initializr.

  • Generate a java project using Gradle command line.

  • Work on the build file to add the required plugins and dependencies.

  • Discuss core Gradle plugins, community plugins and the Gradle plugins portal.

  • Then generate the eclipse configuration files and import the project to eclipse.


Cammands

The Gradle command to generate the project

On Windows: gradlew init --type java-library

On Mac: ./gradlew init --type java-library

The Gradle command to generate eclipse configuration files:

On Windows: gradlew eclipse

On Mac: ./gradlew eclipse


Links

Core Gradle plugins: https://docs.gradle.org/current/userguide/plugin_reference.html

Build Init plugin - https://docs.gradle.org/current/userguide/build_init_plugin.html

Java plugin - https://docs.gradle.org/current/userguide/java_plugin.html

eclipse plugin - https://docs.gradle.org/current/userguide/eclipse_plugin.html

idea plugin - https://docs.gradle.org/current/userguide/idea_plugin.html

Gradle plugins portal: https://plugins.gradle.org/

Spring Boot plugin - https://plugins.gradle.org/plugin/org.springframework.boot

Spring dependency management plugin - https://plugins.gradle.org/plugin/io.spring.dependency-management