Skip to content

Commit 28de9b7

Browse files
author
Jay Bryant
committed
Update to Spring Boot 3.2.0
And update the readmen file and /complete build files to use includes.
1 parent 2552583 commit 28de9b7

File tree

6 files changed

+198
-242
lines changed

6 files changed

+198
-242
lines changed

Jenkinsfile

Lines changed: 0 additions & 44 deletions
This file was deleted.

README.adoc

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
:spring_version: current
2-
:spring_boot_version: 2.5.4
3-
:Controller: https://docs.spring.io/spring/docs/{spring_version}/javadoc-api/org/springframework/stereotype/Controller.html
4-
:DispatcherServlet: https://docs.spring.io/spring/docs/{spring_version}/javadoc-api/org/springframework/web/servlet/DispatcherServlet.html
5-
:SpringApplication: https://docs.spring.io/spring-boot/docs/{spring_boot_version}/api/org/springframework/boot/SpringApplication.html
6-
:ResponseBody: https://docs.spring.io/spring/docs/{spring_version}/javadoc-api/org/springframework/web/bind/annotation/ResponseBody.html
71
:toc:
82
:icons: font
93
:source-highlighter: prettify
@@ -25,7 +19,7 @@ include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/
2519
[[scratch]]
2620
== Starting with Spring Initializr
2721

28-
You can use this https://start.spring.io/#!type=maven-project&language=java&platformVersion=2.5.5&packaging=jar&jvmVersion=11&groupId=com.example&artifactId=gateway&name=gateway&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.gateway&dependencies=cloud-gateway,cloud-resilience4j,cloud-contract-stub-runner[pre-initialized project] and click Generate to download a ZIP file. This project is configured to fit the examples in this tutorial.
22+
You can use this https://start.spring.io/#!type=maven-project&language=java&packaging=jar&jvmVersion=11&groupId=com.example&artifactId=gateway&name=gateway&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.gateway&dependencies=cloud-gateway,cloud-resilience4j,cloud-contract-stub-runner[pre-initialized project] and click Generate to download a ZIP file. This project is configured to fit the examples in this tutorial.
2923

3024
To manually initialize the project:
3125

@@ -125,20 +119,13 @@ To use this filter you need to add the reactive Resilience4J CircuitBreaker depe
125119
`pom.xml`
126120
[source,java,tabsize=2]
127121
----
128-
...
129-
<dependency>
130-
<groupId>org.springframework.cloud</groupId>
131-
<artifactId>spring-cloud-starter-circuitbreaker-reactor-resilience4j</artifactId>
132-
</dependency>
133-
...
122+
include::complete/pom.xml[tags=dependency]
134123
----
135124

136125
`build.gradle`
137126
[source,java,tabsize=2]
138127
----
139-
...
140-
implementation("org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j")
141-
...
128+
include::complete/build.gradle[tags=dependency]
142129
----
143130

144131
In the next example, we use HTTPBin's delay API, which waits a certain number of

complete/build.gradle

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
buildscript {
2-
repositories {
3-
mavenCentral()
4-
}
5-
dependencies {
6-
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.7.1")
7-
}
1+
plugins {
2+
id 'java'
3+
id 'org.springframework.boot' version '3.2.0'
4+
id 'io.spring.dependency-management' version '1.1.4'
85
}
96

10-
apply plugin: 'java'
11-
apply plugin: 'eclipse'
12-
apply plugin: 'idea'
13-
apply plugin: 'org.springframework.boot'
14-
apply plugin: 'io.spring.dependency-management'
7+
group = 'com.example'
8+
version = '0.0.1-SNAPSHOT'
159

16-
bootJar {
17-
baseName = 'gs-gateway'
18-
version = '0.1.0'
10+
java {
11+
sourceCompatibility = '17'
1912
}
2013

2114
repositories {
22-
mavenCentral()
15+
mavenCentral()
16+
maven { url 'https://repo.spring.io/milestone' }
2317
}
2418

25-
sourceCompatibility = 1.8
26-
targetCompatibility = 1.8
27-
28-
dependencyManagement {
29-
imports {
30-
mavenBom "org.springframework.cloud:spring-cloud-dependencies:2021.0.3"
31-
}
19+
ext {
20+
set('springCloudVersion', "2023.0.0-RC1")
3221
}
3322

3423
dependencies {
35-
implementation("org.springframework.cloud:spring-cloud-starter-gateway")
36-
implementation("org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j")
37-
implementation("org.springframework.cloud:spring-cloud-starter-contract-stub-runner"){
38-
exclude group: "org.springframework.boot", module: "spring-boot-starter-web"
39-
}
40-
testImplementation("org.springframework.boot:spring-boot-starter-test")
24+
implementation 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-resilience4j'
25+
// tag::dependency[]
26+
implementation 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j'
27+
// end::dependency[]
28+
implementation 'org.springframework.cloud:spring-cloud-starter-gateway'
29+
testImplementation 'org.springframework.boot:spring-boot-starter-test'
30+
testImplementation 'org.springframework.cloud:spring-cloud-starter-contract-stub-runner'
31+
}
32+
33+
dependencyManagement {
34+
imports {
35+
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
36+
}
4137
}
38+
39+
tasks.named('test') {
40+
useJUnitPlatform()
41+
}

complete/pom.xml

Lines changed: 73 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,78 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4-
<modelVersion>4.0.0</modelVersion>
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<groupId>org.springframework.boot</groupId>
7+
<artifactId>spring-boot-starter-parent</artifactId>
8+
<version>3.2.0</version>
9+
<relativePath/> <!-- lookup parent from repository -->
10+
</parent>
11+
<groupId>com.example</groupId>
12+
<artifactId>gs-gateway</artifactId>
13+
<version>0.0.1-SNAPSHOT</version>
14+
<name>gs-gateway</name>
15+
<description>Demo project for Spring Boot</description>
16+
<properties>
17+
<java.version>17</java.version>
18+
<spring-cloud.version>2023.0.0-RC1</spring-cloud.version>
19+
</properties>
20+
<dependencies>
21+
<dependency>
22+
<groupId>org.springframework.cloud</groupId>
23+
<artifactId>spring-cloud-starter-circuitbreaker-resilience4j</artifactId>
24+
</dependency>
25+
<!-- tag::dependency[] -->
26+
<dependency>
27+
<groupId>org.springframework.cloud</groupId>
28+
<artifactId>spring-cloud-starter-circuitbreaker-reactor-resilience4j</artifactId>
29+
</dependency>
30+
<!-- end::dependency[] -->
31+
<dependency>
32+
<groupId>org.springframework.cloud</groupId>
33+
<artifactId>spring-cloud-starter-gateway</artifactId>
34+
</dependency>
535

6-
<groupId>org.springframework</groupId>
7-
<artifactId>gs-gateway</artifactId>
8-
<version>0.1.0</version>
36+
<dependency>
37+
<groupId>org.springframework.boot</groupId>
38+
<artifactId>spring-boot-starter-test</artifactId>
39+
<scope>test</scope>
40+
</dependency>
41+
<dependency>
42+
<groupId>org.springframework.cloud</groupId>
43+
<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
44+
<scope>test</scope>
45+
</dependency>
46+
</dependencies>
47+
<dependencyManagement>
48+
<dependencies>
49+
<dependency>
50+
<groupId>org.springframework.cloud</groupId>
51+
<artifactId>spring-cloud-dependencies</artifactId>
52+
<version>${spring-cloud.version}</version>
53+
<type>pom</type>
54+
<scope>import</scope>
55+
</dependency>
56+
</dependencies>
57+
</dependencyManagement>
958

10-
<parent>
11-
<groupId>org.springframework.boot</groupId>
12-
<artifactId>spring-boot-starter-parent</artifactId>
13-
<version>2.7.1</version>
14-
</parent>
59+
<build>
60+
<plugins>
61+
<plugin>
62+
<groupId>org.springframework.boot</groupId>
63+
<artifactId>spring-boot-maven-plugin</artifactId>
64+
</plugin>
65+
</plugins>
66+
</build>
67+
<repositories>
68+
<repository>
69+
<id>spring-milestones</id>
70+
<name>Spring Milestones</name>
71+
<url>https://repo.spring.io/milestone</url>
72+
<snapshots>
73+
<enabled>false</enabled>
74+
</snapshots>
75+
</repository>
76+
</repositories>
1577

16-
<dependencyManagement>
17-
<dependencies>
18-
<dependency>
19-
<groupId>org.springframework.cloud</groupId>
20-
<artifactId>spring-cloud-dependencies</artifactId>
21-
<version>2021.0.3</version>
22-
<type>pom</type>
23-
<scope>import</scope>
24-
</dependency>
25-
</dependencies>
26-
</dependencyManagement>
27-
28-
<dependencies>
29-
<dependency>
30-
<groupId>org.springframework.cloud</groupId>
31-
<artifactId>spring-cloud-starter-gateway</artifactId>
32-
</dependency>
33-
<dependency>
34-
<groupId>org.springframework.cloud</groupId>
35-
<artifactId>spring-cloud-starter-circuitbreaker-reactor-resilience4j</artifactId>
36-
</dependency>
37-
<dependency>
38-
<groupId>org.springframework.cloud</groupId>
39-
<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
40-
<exclusions>
41-
<exclusion>
42-
<artifactId>spring-boot-starter-web</artifactId>
43-
<groupId>org.springframework.boot</groupId>
44-
</exclusion>
45-
</exclusions>
46-
</dependency>
47-
<dependency>
48-
<groupId>org.springframework.boot</groupId>
49-
<artifactId>spring-boot-starter-test</artifactId>
50-
<scope>test</scope>
51-
</dependency>
52-
</dependencies>
53-
54-
<properties>
55-
<java.version>1.8</java.version>
56-
</properties>
57-
58-
<build>
59-
<plugins>
60-
<plugin>
61-
<groupId>org.springframework.boot</groupId>
62-
<artifactId>spring-boot-maven-plugin</artifactId>
63-
</plugin>
64-
</plugins>
65-
</build>
66-
67-
</project>
78+
</project>

initial/build.gradle

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,38 @@
1-
buildscript {
2-
repositories {
3-
mavenCentral()
4-
}
5-
dependencies {
6-
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.7.1")
7-
}
1+
plugins {
2+
id 'java'
3+
id 'org.springframework.boot' version '3.2.0'
4+
id 'io.spring.dependency-management' version '1.1.4'
85
}
96

10-
apply plugin: 'java'
11-
apply plugin: 'eclipse'
12-
apply plugin: 'idea'
13-
apply plugin: 'org.springframework.boot'
14-
apply plugin: 'io.spring.dependency-management'
7+
group = 'com.example'
8+
version = '0.0.1-SNAPSHOT'
159

16-
bootJar {
17-
baseName = 'gs-gateway'
18-
version = '0.1.0'
10+
java {
11+
sourceCompatibility = '17'
1912
}
2013

2114
repositories {
22-
mavenCentral()
15+
mavenCentral()
16+
maven { url 'https://repo.spring.io/milestone' }
2317
}
2418

25-
sourceCompatibility = 1.8
26-
targetCompatibility = 1.8
27-
28-
dependencyManagement {
29-
imports {
30-
mavenBom "org.springframework.cloud:spring-cloud-dependencies:2021.0.3"
31-
}
19+
ext {
20+
set('springCloudVersion', "2023.0.0-RC1")
3221
}
3322

3423
dependencies {
35-
implementation("org.springframework.cloud:spring-cloud-starter-gateway")
36-
implementation("org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j")
37-
implementation("org.springframework.cloud:spring-cloud-starter-contract-stub-runner"){
38-
exclude group: "org.springframework.boot", module: "spring-boot-starter-web"
39-
}
40-
testImplementation("org.springframework.boot:spring-boot-starter-test")
24+
implementation 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-resilience4j'
25+
implementation 'org.springframework.cloud:spring-cloud-starter-gateway'
26+
testImplementation 'org.springframework.boot:spring-boot-starter-test'
27+
testImplementation 'org.springframework.cloud:spring-cloud-starter-contract-stub-runner'
28+
}
29+
30+
dependencyManagement {
31+
imports {
32+
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
33+
}
4134
}
35+
36+
tasks.named('test') {
37+
useJUnitPlatform()
38+
}

0 commit comments

Comments
 (0)