Spring Boot Initilizr Web Interface With Examples

In this post, we are going to discuss about Spring Boot Initilizr Web Interface and it’s IDEs or IDE Plugins. Before reading post, please go through my previous Spring Boot posts.

What is Spring Boot Initilizr

Aside from Spring Boot 4 Components, Spring Boot Framework has another important key component that is: Spring Boot Initilizr.

The Spring Team has provided a Web Interface for Spring Boot Initilizr at “https://start.spring.io/” to quick start the Development of Spring Boot Applications using Maven/Gradle build tool very easily.

Why we need Spring Boot Initilizr

The main aim of Spring Boot Initilizr is to start new project development within no time. It provides all required project structure and base build script files to quick start Spring Boot application without wasting time. It reduces development time.

Spring Boot Initilizr is available in the following forms

  1. Spring Boot Initilizr With Web Interface
  2. Spring Boot Initilizr With IDEs/IDE Plugins
  3. Spring Boot Initilizr With Spring Boot CLI
  4. Spring Boot Initilizr With Third Party Tools

We will look into “Spring Boot Initilizr With Web Interface” now with some examples and will discuss rest of three options in my coming posts.

Spring Boot Initilizr Web Interface

The Spring Team has provided a Web Interface for Spring Boot Initilizr at “https://start.spring.io/“. We can use it to create our new Project’s base structure for Maven/Gradle build tools. It not only generates Project Base structure but also provides all required Spring Boot Jar files.

Spring Boot Initilizr Web Interface looks like this:

springboot-initilizr-homepage1-450x333

NOTE:- Combine above two images to get complete Spring Boot Initilizr Web Interface picture. I was unable to create one single image.

Now we will develop two examples one for Maven and another for Gradle build tools.

Spring Boot Initilizr Web Interface Maven Example

Please follow the following steps to create new Spring Boot WebApplication for Maven Build tool and Spring STS Suite IDE (Or any IDE like Eclipse,IntelliJ IDEA etc).

    • Please access Spring Boot Initilizr at “https://start.spring.io/“.
    • Provide our project Required details and Click on “Generate Project” Button

I have provided all our Maven project’s required details and selected required technologies check boxes as shown in the diagram.

springboot-initilizr-homepage1-450x333

I have selected H2 Database and Click on “Generate Project” Button

springboot-initilizr-maven-proj4

    • When we click on “Generate Project” Button, it creates and downloads a Maven Project as “SpringMVCMavenProject.zip” file into our local file system.
    • Copy “SpringMVCMavenProject.zip” to our Spring STS Suite Workspace and Extract this zip file
    • springboot-initilizr-maven-proj4
    • Import this “SpringMVCMavenProject” Maven project into Spring STS IDE
    • This “SpringMVCMavenProject” Maven project structure looks like
    • springboot-initilizr-maven-proj4

If you observe this project files, it generates pom.xml file, two Spring Boot Java files and one JUnit Java file.

“pom.xml”

NOTE:- We will discuss about this Java Source code and execution of this code and also discuss about “SpringApplication” class in my coming post.

ServletInitializer.java

SpringMvcMavenProjectApplication.java

SpringMvcMavenProjectApplicationTests.java

Spring Boot Initilizr Web Interface Gradle Example

Like Maven Example, Please follow the following steps to create new Spring Boot WebApplication for Gradle Build tool and Spring STS Suite IDE.

    • Please access Spring Boot Initilizr at “https://start.spring.io/“.
    • Provide our project Required details and Click on “Generate Project” Button

I have provided all our Gradle project’s required details and selected required technologies check boxes as shown in the diagram.

NOTE:- Here only difference from previous Maven project is Changing “Type” from “Maven Project” to “Gradle Project”. Like this we can select Java Version, Language(Java,Groovy), Required Project technologies etc and create new project very easily.

springboot-initilizr-homepage1-450x333

I have selected H2 Database and Click on “Generate Project” Button

    • When we click on “Generate Project” Button, it creates and downloads a Gradle Project as “SpringMVCGradleProject.zip” file into our local file system.
    • Copy “SpringMVCGradleProject.zip” to our Spring STS Suite Workspace and Extract this zip file
    • Import this “SpringMVCGradleProject” Gradle project into Spring STS IDE
    • This “SpringMVCGradleProject” Gradle project structure looks like as shown Maven project except pom.xml file change to build.gradle

If you observe this project files, it generates build.gradle file, two Spring Boot Java files and one JUnit Java file (These 3 Java files are similar to Maven Project).

Genernate “build.gradle” file content:

That’s about Spring Boot Initilizr With Web Interface.

We will discuss about Java Source code, Importance of “SpringApplication” class and its “SpringApplication.run()” method, How to run this Application etc in my coming posts at “Spring Boot Initilizr With IDEs or IDE Plugins”, “Spring Boot Initilizr With Spring Boot CLI” and “Spring Boot Initilizr With ThirdParty Tools” in my coming post.

Please drop me a comment if you have any issues or suggestions.

By admin

Leave a Reply

%d bloggers like this: