Skip to content

Commit 58c0eeb

Browse files
committed
Update Quarkus version to 3.28.2 and Gradle wrapper to 9.1.0; refactor build configuration and enhance application properties and fix warnings.
1 parent ada0179 commit 58c0eeb

File tree

7 files changed

+35
-23
lines changed

7 files changed

+35
-23
lines changed

.vscode/mcp.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"servers": {
3+
"scala3-quarkus-quickstart-metals": {
4+
"url": "http://localhost:55387/sse",
5+
"type": "sse"
6+
}
7+
}
8+
}

build.gradle

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id "java"
33
id "scala"
4-
id "io.quarkus"
4+
id "io.quarkus" version "3.28.2"
55
id 'cz.augi.gradle.scalafmt' version '1.21.5'
66
id 'io.github.cosmicsilence.scalafix' version '0.2.5'
77
id "com.github.ben-manes.versions" version "0.53.0"
@@ -11,10 +11,11 @@ plugins {
1111
repositories {
1212
mavenCentral()
1313
mavenLocal()
14+
gradlePluginPortal()
1415
}
1516

1617
def VERSIONS = [
17-
QUARKUS : "3.26.3",
18+
QUARKUS : "3.28.2",
1819
QUARKUS_SCALA3: "1.0.0",
1920
SCALA3 : "3.7.3",
2021
MAGNUM : "1.3.1",
@@ -65,8 +66,8 @@ dependencies {
6566
implementation "com.augustnagro:magnum_3:${VERSIONS.MAGNUM}"
6667
}
6768

68-
group "org.acme"
69-
version "1.0.0-SNAPSHOT"
69+
group = "org.acme"
70+
version = "1.0.0-SNAPSHOT"
7071

7172
java {
7273
sourceCompatibility = JavaVersion.VERSION_21
@@ -89,32 +90,34 @@ test {
8990
exclude '**/*IT*'
9091
}
9192

92-
compileJava {
93-
options.encoding = "UTF-8"
94-
options.compilerArgs << "-parameters"
93+
// Configure Java compile tasks lazily to avoid classloader/name collisions
94+
// (some plugins may register Named objects that conflict with direct task properties)
95+
tasks.withType(org.gradle.api.tasks.compile.JavaCompile).configureEach {
96+
options.encoding = 'UTF-8'
9597
}
9698

97-
compileTestJava {
98-
options.encoding = "UTF-8"
99+
// Only the main compile task needs the -parameters flag
100+
tasks.named('compileJava', org.gradle.api.tasks.compile.JavaCompile).configure {
101+
options.compilerArgs << '-parameters'
99102
}
100103

101104
scalafix {
102105
ignoreSourceSets = [ 'quarkus-generated-sources', 'quarkus-test-generated-sources' ]
103106
}
104107

105108
testlogger {
106-
theme 'mocha'
107-
slowThreshold 5000
109+
theme = 'mocha'
110+
slowThreshold = 5000
108111
}
109112

110113
// Custom Tasks (run with ./gradlew lint, ./gradlew deps)
111114
task lint(type: GradleBuild) {
112-
group 'Custom project tasks'
113-
description 'Run code linting tasks (scalafmt, scalafix, etc)'
115+
group = 'Custom project tasks'
116+
description = 'Run code linting tasks (scalafmt, scalafix, etc)'
114117
tasks = ['scalafmt', 'scalafix']
115118
}
116119
task deps(type: GradleBuild) {
117-
group 'Custom project tasks'
118-
description 'Check for dependency updates'
120+
group = 'Custom project tasks'
121+
description = 'Check for dependency updates'
119122
tasks = ['dependencyUpdates']
120123
}

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1414
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
1515
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
16-
<quarkus.platform.version>3.26.3</quarkus.platform.version>
16+
<quarkus.platform.version>3.28.2</quarkus.platform.version>
1717
<scala-maven-plugin.version>4.9.6</scala-maven-plugin.version>
1818
<scalafmt-plugin.version>1.1.1713302731.c3d0074</scalafmt-plugin.version>
1919
<scalafix-plugin.version>0.1.10_0.14.2</scalafix-plugin.version>

settings.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ pluginManagement {
22
repositories {
33
mavenCentral()
44
gradlePluginPortal()
5-
mavenLocal()
6-
}
7-
plugins {
8-
id "io.quarkus" version "3.25.4"
95
}
106
}
117

src/main/resources/application.properties

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ quarkus.banner.path=quarkus-banner.txt
1414
# kafka.bootstrap.servers=localhost:29092
1515
# or the following to use on production mode only
1616
%prod.kafka.bootstrap.servers=localhost:29092
17+
kafka.group.id=scala3-quarkus-quickstart-group
1718
# If none of the above is set, the internal Quarkus dev services will be used
1819
%test.quarkus.kafka.devservices.enabled=false
1920
# Pre-create topics for the dev services
@@ -47,7 +48,6 @@ quarkus.datasource.db-kind=postgresql
4748
quarkus.datasource.username=quickstart
4849
quarkus.datasource.password=quickstart
4950
# Drop and create the database at startup (use `update` to only update the schema)
50-
quarkus.hibernate-orm.database.generation=none
5151
quarkus.flyway.migrate-at-start=true
5252
### -------------------SWAGGER CONFIGURATION------------------------- ###
5353
quarkus.swagger-ui.always-include=true
@@ -59,3 +59,8 @@ greeting.message=World
5959
greeting.suffix=!
6060
### -------------------NATIVE-IMAGE ADDITIONAL INITIALIZATION ARGS ------------------------- ###
6161
quarkus.native.additional-build-args=--initialize-at-run-time=scala.util.Random
62+
63+
# Add the Scala 2.13 standard library (pulled transitively by some dependencies such as quarkus-bom)
64+
# so Quarkus will create a Jandex index for it and avoid missing-class warnings (eg. scala.collection.Iterator).
65+
quarkus.index-dependency.scala2.group-id=org.scala-lang
66+
quarkus.index-dependency.scala2.artifact-id=scala-library

src/main/scala/org/acme/ScalaFutureResource.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ScalaFutureResource():
3636
val futureSum = Future.sequence((1 to numsAmount).map(_ => generateNum())).map(_.sum)
3737
// Get the IP address asynchronously
3838
val IPFuture = getOwnIP().map(_.body).recover:
39-
case e: Exception =>
39+
case _: Exception =>
4040
Log.error("Failed to get the IP address.")
4141
Left("Failed to get IP")
4242

0 commit comments

Comments
 (0)