Skip to content

Commit

Permalink
Improved the Spring Initializr section
Browse files Browse the repository at this point in the history
Removed some redundancy in the links and added a manual option.
Also bumped the Spring Boot version to 2.4.4, to keep it current.
  • Loading branch information
Jay Bryant committed Mar 18, 2021
1 parent 3677d50 commit a77cea7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 11 deletions.
24 changes: 17 additions & 7 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:spring_boot_version: 2.4.2
:spring_boot_version: 2.4.4
:spring-boot: https://github.com/spring-projects/spring-boot
:toc:
:icons: font
Expand Down Expand Up @@ -54,12 +54,8 @@ them to your application context.
[[scratch]]
== Starting with Spring Initializr

For all Spring applications, you should start with the https://start.spring.io[Spring
Initializr]. The Initializr offers a fast way to pull in all the dependencies you need for
an application and does a lot of the setup for you. This example needs only the Spring Web
dependency.
If you use Maven, visit the https://start.spring.io/#!type=maven-project&language=java&platformVersion=2.4.4.RELEASE&packaging=jar&jvmVersion=1.8&groupId=com.example&artifactId=spring-boot&name=spring-boot&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.spring-boot&dependencies=web[Spring Initializr] to generate a new project with the required dependencies (Spring Web).

You can get a Maven build file with the necessary dependencies directly from the https://start.spring.io/#!type=maven-project&language=java&platformVersion=2.4.2.RELEASE&packaging=jar&jvmVersion=11&groupId=com.example&artifactId=spring-boot&name=spring-boot&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.spring-boot&dependencies=web[Spring Initializr].
The following listing shows the `pom.xml` file that is created when you choose Maven:

====
Expand All @@ -69,7 +65,8 @@ include::initial/pom.xml[]
----
====

You can get a Gradle build file with the necessary dependencies directly from the https://start.spring.io/#!type=gradle-project&language=java&platformVersion=2.4.2.RELEASE&packaging=jar&jvmVersion=11&groupId=com.example&artifactId=spring-boot&name=spring-boot&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.spring-boot&dependencies=web[Spring Initializr].
If you use Gradle, visit the https://start.spring.io/#!type=gradle-project&language=java&platformVersion=2.4.4.RELEASE&packaging=jar&jvmVersion=1.8&groupId=com.example&artifactId=spring-boot&name=spring-boot&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.spring-boot&dependencies=web[Spring Initializr] to generate a new project with the required dependencies (Spring Web).

The following listing shows the `build.gradle` file that is created when you choose Gradle:

====
Expand All @@ -79,6 +76,19 @@ include::initial/build.gradle[]
----
====

=== Manual Initialization (optional)

If you want to initialize the project manually rather than use the links shown earlier, follow the steps given below:

. Navigate to https://start.spring.io.
This service pulls in all the dependencies you need for an application and does most of the setup for you.
. Choose either Gradle or Maven and the language you want to use. This guide assumes that you chose Java.
. Click *Dependencies* and select *Spring Web*.
. Click *Generate*.
. Download the resulting ZIP file, which is an archive of a web application that is configured with your choices.

NOTE: If your IDE has the Spring Initializr integration, you can complete this process from your IDE.

[[initial]]
== Create a Simple Web Application

Expand Down
2 changes: 1 addition & 1 deletion complete/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.springframework.boot' version '2.4.2'
id 'org.springframework.boot' version '2.4.4'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
Expand Down
2 changes: 1 addition & 1 deletion complete/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.2</version>
<version>2.4.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
Expand Down
2 changes: 1 addition & 1 deletion initial/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.springframework.boot' version '2.4.2'
id 'org.springframework.boot' version '2.4.4'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
Expand Down
2 changes: 1 addition & 1 deletion initial/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.2</version>
<version>2.4.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
Expand Down

0 comments on commit a77cea7

Please sign in to comment.