-
Notifications
You must be signed in to change notification settings - Fork 1
feature: migrate Gradle build to Spring Boot 3.3.13 / Java 17 #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,32 +1,32 @@ | ||
| buildscript { | ||
| repositories { | ||
| mavenCentral() | ||
| } | ||
| dependencies { | ||
| classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.2.RELEASE") | ||
| } | ||
| plugins { | ||
| id 'java' | ||
| id 'eclipse' | ||
| id 'idea' | ||
| id 'org.springframework.boot' version '3.3.13' | ||
| id 'io.spring.dependency-management' version '1.1.7' | ||
| } | ||
|
|
||
| apply plugin: 'java' | ||
| apply plugin: 'eclipse' | ||
| apply plugin: 'idea' | ||
| apply plugin: 'org.springframework.boot' | ||
| apply plugin: 'io.spring.dependency-management' | ||
|
|
||
| bootJar { | ||
| baseName = 'gs-spring-boot' | ||
| version = '0.1.0' | ||
| archiveBaseName = 'gs-spring-boot' | ||
| archiveVersion = '0.1.0' | ||
| } | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } | ||
|
|
||
| sourceCompatibility = 1.8 | ||
| targetCompatibility = 1.8 | ||
| java { | ||
| sourceCompatibility = JavaVersion.VERSION_17 | ||
| targetCompatibility = JavaVersion.VERSION_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") | ||
| implementation("com.h2database:h2") | ||
|
Comment on lines
23
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔍 Gradle dependency set does not fully match pom.xml (properties-migrator missing) The PR states the Gradle dependency set now matches Was this helpful? React with 👍 or 👎 to provide feedback. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Intentional: |
||
| testImplementation("org.springframework.boot:spring-boot-starter-test") | ||
| } | ||
|
|
||
| tasks.named('test') { | ||
| useJUnitPlatform() | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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.5-bin.zip | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔍 Wrapper JAR and scripts are still Gradle 2.13 while the distribution URL jumps to 8.x
Was this helpful? React with 👍 or 👎 to provide feedback. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct, and intentionally left out of this PR: the scope for this session is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔍 Gradle 8.14.5 distribution must be verified to exist If Was this helpful? React with 👍 or 👎 to provide feedback. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verified — the wrapper actually downloaded and ran that distribution in this session: |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Info: source/targetCompatibility instead of a Java toolchain
Setting
sourceCompatibility/targetCompatibilityinsidejava { }only asserts the language level; the build still requires the invoking JDK to be 17+ and fails with a confusing 'invalid source release' / plugin-incompatibility error on an older JDK. Since this repo previously built on JDK 8,java { toolchain { languageVersion = JavaLanguageVersion.of(17) } }would make the requirement explicit and let Gradle provision/select the right JDK.Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deliberate for this PR — the migration plan specifies
sourceCompatibility/targetCompatibility1.8 → 17, and a toolchain would additionally make Gradle try to auto-provision/select a JDK, which changes build behaviour beyond the scope here. Happy to switch tojava { toolchain { languageVersion = JavaLanguageVersion.of(17) } }as a follow-up if preferred.