-
Notifications
You must be signed in to change notification settings - Fork 1
Upgrade Java 8 → 17 (LTS) and Spring Boot 2.0.2 → 2.7.18 (Maven + Gradle) #59
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
a2d7eab
ab36719
859e3ef
2754276
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 +1,4 @@ | ||
| /.idea/ | ||
| /.idea/ | ||
| /target/ | ||
| /build/ | ||
| /.gradle/ |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,19 @@ | ||
| distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| wrapperVersion=3.3.2 | ||
| distributionType=only-script | ||
| distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,8 @@ buildscript { | |
| mavenCentral() | ||
| } | ||
| dependencies { | ||
| classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.2.RELEASE") | ||
| classpath("org.springframework.boot:spring-boot-gradle-plugin:2.7.18") | ||
| classpath("io.spring.gradle:dependency-management-plugin:1.0.15.RELEASE") | ||
|
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. 📝 Info: Explicit dependency-management-plugin classpath entry duplicates the Boot plugin's own dependency
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, per the agreed upgrade plan, which called for pinning |
||
| } | ||
| } | ||
|
|
||
|
|
@@ -13,20 +14,31 @@ apply plugin: 'idea' | |
| apply plugin: 'org.springframework.boot' | ||
| apply plugin: 'io.spring.dependency-management' | ||
|
|
||
| group = 'org.springframework' | ||
| version = '0.1.0' | ||
|
|
||
| java { | ||
| toolchain { | ||
| languageVersion = JavaLanguageVersion.of(17) | ||
| } | ||
| } | ||
|
|
||
| tasks.withType(JavaCompile) { | ||
| options.release = 17 | ||
| } | ||
|
Comment on lines
+20
to
+28
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. 📝 Info: Java toolchain 17 without a toolchain resolver requires a locally installed JDK 17 Gradle 7.6 can only auto-provision toolchains via the (unconfigured here) Adoptium/Foojay resolver plugin; with just 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. Accurate, and it's the intended consequence of the upgrade: the whole point is that this project now requires JDK 17, so a hard "No matching toolchains found" is better than silently compiling with whatever JDK happens to be running. Adding |
||
|
|
||
| bootJar { | ||
| baseName = 'gs-spring-boot' | ||
| version = '0.1.0' | ||
| archiveBaseName = 'gs-spring-boot' | ||
| } | ||
|
devin-ai-integration[bot] marked this conversation as resolved.
|
||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } | ||
|
|
||
| sourceCompatibility = 1.8 | ||
| targetCompatibility = 1.8 | ||
|
|
||
| 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("javax.annotation:javax.annotation-api:1.3.2") | ||
| runtimeOnly("com.h2database:h2") | ||
| testImplementation("junit:junit") | ||
|
devin-ai-integration[bot] marked this conversation as resolved.
|
||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| #Thu Mar 01 09:01:15 CST 2018 | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip | ||
| networkTimeout=10000 | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip |
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: Maven wrapper jar removed in favour of script-only distribution
The head commit deletes
.mvn/wrapper/maven-wrapper.jarand switches.mvn/wrapper/maven-wrapper.propertiestowrapperVersion=3.3.2/distributionType=only-script. The regeneratedmvnw/mvnw.cmddownload and unpack the Maven distribution themselves, so the missing jar is consistent with the new scripts, and CI (./mvnw -B clean package) will work on Linux with wget/curl present. Worth noting for reviewers that some tooling that shells out to the wrapper by classpath (older IDE integrations expectingmaven-wrapper.jar, or anyone invokingjava -cp .mvn/wrapper/maven-wrapper.jar org.apache.maven.wrapper.MavenWrapperMain) will no longer work with this checkout.(Refers to lines 35-37)
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.
Correct and intended — that's what
mvn -N wrapper:wrapper -Dmaven=3.9.6generates with maven-wrapper-plugin 3.3.2 (defaultdistributionType=only-script), and it was the fix for the previous round's flag about the 2015 Takari jar. Verified:./mvnw -B clean package-> BUILD SUCCESS locally and the maven CI job is green. Thanks for calling out thejava -cp .mvn/wrapper/maven-wrapper.jar .../ old-IDE-integration caveat — if the team wants the jar back, regenerating with-Dtype=binrestores it.