Skip to content

Commit

Permalink
fix: upgraded to micronaut 4 and resolve security issues (#62)
Browse files Browse the repository at this point in the history
* upgraded to micronaut 4

* upgraded gha

* revert upgrading native.gradle.plugin.version

* fixed error

* fixed build.gradle
  • Loading branch information
munishchouhan authored Dec 16, 2024
1 parent 6ca040c commit 8d6899b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: env | sort

- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
fetch-depth: 1

Expand Down
24 changes: 14 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
plugins {
id 'org.cadixdev.licenser' version '0.6.1'
id 'org.graalvm.buildtools.native'
id("io.micronaut.application") version "2.0.6"
id 'com.github.johnrengelman.shadow' version '7.1.2'
id("io.micronaut.application") version "4.4.2"
id 'com.github.johnrengelman.shadow' version '8.1.1'
}

version = project.file('VERSION').text.strip()
Expand Down Expand Up @@ -52,9 +52,11 @@ dependencies {
implementation("javax.annotation:javax.annotation-api")
implementation("javax.inject:javax.inject:1")
runtimeOnly("ch.qos.logback:logback-classic")
runtimeOnly("org.yaml:snakeyaml")
compileOnly("org.graalvm.nativeimage:svm")

implementation("io.micronaut:micronaut-validation")
implementation("io.micronaut.validation:micronaut-validation")
implementation("io.micronaut:micronaut-jackson-databind")

testImplementation(platform("org.junit:junit-bom:${junitVersion}"))
testImplementation('org.junit.jupiter:junit-jupiter')
Expand Down Expand Up @@ -91,12 +93,19 @@ task buildInfo {
}

compileJava {
sourceCompatibility = JavaVersion.toVersion("21")
targetCompatibility = JavaVersion.toVersion("21")
options.release.set(17)
sourceCompatibility = '21'
targetCompatibility = '21'
options.compilerArgs += ["-Aproject=${project.name}"]
dependsOn buildInfo
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

shadowJar {
archiveBaseName.set('tw-agent')
archiveClassifier.set('')
Expand All @@ -121,15 +130,10 @@ graalvmNative {
buildArgs.add('-H:+AddAllCharsets')
buildArgs.add('-H:EnableURLProtocols=https,http')
buildArgs.add('-H:+ReportExceptionStackTraces')

javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(17)
}
}

test {
verbose = true
agent = true
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
micronautVersion=3.1.0
native.gradle.plugin.version = 0.9.6
micronautVersion=4.7.1
native.gradle.plugin.version = 0.10.4
junit.jupiter.version = 5.8.1
junit.platform.version = 1.8.1
1 change: 0 additions & 1 deletion src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<configuration>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<withJansi>true</withJansi>
<encoder>
<pattern>%cyan(%d{HH:mm:ss.SSS}) %highlight(%-5level)- %msg%n</pattern>
</encoder>
Expand Down

0 comments on commit 8d6899b

Please sign in to comment.