diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
index c954cec..1ae2871 100644
--- a/.mvn/wrapper/maven-wrapper.properties
+++ b/.mvn/wrapper/maven-wrapper.properties
@@ -1 +1 @@
-distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip
+distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.9.14/apache-maven-3.9.14-bin.zip
diff --git a/build.gradle b/build.gradle
index 09f1083..8327a81 100644
--- a/build.gradle
+++ b/build.gradle
@@ -3,7 +3,7 @@ buildscript {
mavenCentral()
}
dependencies {
- classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.2.RELEASE")
+ classpath("org.springframework.boot:spring-boot-gradle-plugin:3.2.12")
}
}
@@ -14,7 +14,7 @@ apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
bootJar {
- baseName = 'gs-spring-boot'
+ archiveBaseName = 'gs-spring-boot'
version = '0.1.0'
}
@@ -22,11 +22,13 @@ repositories {
mavenCentral()
}
-sourceCompatibility = 1.8
-targetCompatibility = 1.8
+sourceCompatibility = 17
+targetCompatibility = 17
dependencies {
- compile("org.springframework.boot:spring-boot-starter-web")
- testCompile("junit:junit")
+ implementation("org.springframework.boot:spring-boot-starter-web")
+ implementation("org.springframework.boot:spring-boot-starter-jdbc")
+ runtimeOnly("com.h2database:h2")
+ testImplementation("junit:junit")
}
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index a2ff3cc..3c03123 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip
diff --git a/gradlew b/gradlew
old mode 100644
new mode 100755
diff --git a/pom.xml b/pom.xml
index 63f5cbd..afd5c0b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,15 +11,10 @@
org.springframework.boot
spring-boot-starter-parent
- 2.0.2.RELEASE
+ 3.2.12
-
- org.springframework.boot
- spring-boot-properties-migrator
- runtime
-
org.springframework.boot
spring-boot-starter-web
@@ -35,7 +30,7 @@
- 1.8
+ 17
diff --git a/src/main/java/hello/Application.java b/src/main/java/hello/Application.java
index 7cf8faf..3a41d22 100644
--- a/src/main/java/hello/Application.java
+++ b/src/main/java/hello/Application.java
@@ -35,8 +35,8 @@ public static void main(String[] args) {
System.out.println(beanName);
}
- RestTemplate restTemplate = new RestTemplate();
- Quote quote = restTemplate.getForObject("http://gturnquist-quoters.cfapps.io/api/random", Quote.class);
+ RestTemplate restTemplate = new RestTemplate();
+ Quote quote = restTemplate.getForObject("https://dummyjson.com/quotes/random", Quote.class);
log.info(quote.toString());
}
@@ -50,7 +50,7 @@ public RestTemplate restTemplate(RestTemplateBuilder builder) {
public CommandLineRunner run(RestTemplate restTemplate) throws Exception {
return args -> {
Quote quote = restTemplate.getForObject(
- "http://gturnquist-quoters.cfapps.io/api/random", Quote.class);
+ "https://dummyjson.com/quotes/random", Quote.class);
log.info(quote.toString());
};
}
@@ -63,7 +63,7 @@ public CommandLineRunner run(RestTemplate restTemplate) throws Exception {
public void run(String... args) throws Exception {
log.info("Creating tables");
- jdbcTemplate.execute("DROP TABLE customers IF EXISTS");
+ jdbcTemplate.execute("DROP TABLE IF EXISTS customers");
jdbcTemplate.execute("CREATE TABLE customers(id SERIAL, first_name VARCHAR(255), last_name VARCHAR(255))");
// Split up the array of whole names into an array of first/last names
@@ -80,8 +80,9 @@ public void run(String... args) throws Exception {
log.info("Querying for customer records where first_name = 'Josh':");
jdbcTemplate.query(
- "SELECT id, first_name, last_name FROM customers WHERE first_name = ?", new Object[]{"Josh"},
- (rs, rowNum) -> new Customer(rs.getLong("id"), rs.getString("first_name"), rs.getString("last_name"))
+ "SELECT id, first_name, last_name FROM customers WHERE first_name = ?",
+ (rs, rowNum) -> new Customer(rs.getLong("id"), rs.getString("first_name"), rs.getString("last_name")),
+ "Josh"
).forEach(customer -> log.info(customer.toString()));
}