Add gradle9 module: Spring Boot 4 build migrated from Gradle 8 to Gradle 9

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gth99spB1CzQmBFofXmU4Z
This commit is contained in:
2026-09-28 09:00:03 +00:00
co-authored by Claude Sonnet 5
parent b4b43b94bf
commit 804c33f0d5
25 changed files with 689 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
plugins {
id 'java'
id 'org.springframework.boot' version '4.1.1'
id 'io.spring.dependency-management' version '1.1.7'
}
group = 'com.ankurm'
version = '0.0.1'
sourceCompatibility = '17'
archivesBaseName = 'g9demo-legacy'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test'
}
// Task that reads the project model and an environment variable while it EXECUTES
tasks.register('buildInfo') {
doLast {
def stamp = System.getenv('BUILD_STAMP') ?: 'local'
file("$buildDir/build-info.txt").text = "${project.name} ${project.version} ${stamp}\n"
}
}
tasks.named('test') {
useJUnitPlatform()
}
+1
View File
@@ -0,0 +1 @@
rootProject.name = 'g9demo'
@@ -0,0 +1,15 @@
package com.ankurm.g9;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
@RestController
public class G9Application {
public static void main(String[] args) { SpringApplication.run(G9Application.class, args); }
@GetMapping("/hello")
String hello() { return "hello"; }
}
@@ -0,0 +1,21 @@
package com.ankurm.g9;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
import org.springframework.test.web.servlet.MockMvc;
@SpringBootTest
@AutoConfigureMockMvc
class G9ApplicationTest {
@Autowired MockMvc mvc;
@Test
void hello() throws Exception {
mvc.perform(get("/hello")).andExpect(content().string("hello"));
}
}