1
0
Fork 0

Compile with JDK 21 & optimize
Build & Release / build-application (push) Failing after 2m54s Details
Build & Release / build-docker-image (push) Has been skipped Details
Build & Release / deploy-to-production (push) Has been skipped Details

This commit is contained in:
John Ahlroos 2025-02-15 21:03:16 +01:00
parent c74e10e016
commit 4cab62f66b
Signed by: john
GPG Key ID: 258D0F70DB84CD5D
9 changed files with 28 additions and 25 deletions

View File

@ -1,14 +1,15 @@
plugins { plugins {
id "java" id "java"
id "io.micronaut.application" version "$micronautApplicationVersion" id "io.micronaut.application" version "$micronautApplicationVersion"
id "io.micronaut.aot" version "$micronautApplicationVersion"
} }
version = findProperty('BUILD_VERSION') ?: 'latest' version = findProperty('BUILD_VERSION') ?: 'latest'
group = "com.devsoap" group = "com.devsoap"
java { java {
sourceCompatibility = JavaVersion.VERSION_17 sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_21
} }
repositories { repositories {
@ -19,17 +20,16 @@ dependencies {
annotationProcessor 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok' testAnnotationProcessor 'org.projectlombok:lombok'
compileOnly 'org.projectlombok:lombok'
annotationProcessor(platform("io.micronaut:micronaut-bom:$micronautVersion")) implementation(platform("io.micronaut.platform:micronaut-platform"))
testAnnotationProcessor(platform("io.micronaut:micronaut-bom:$micronautVersion"))
implementation(platform("io.micronaut:micronaut-bom:$micronautVersion"))
implementation 'org.projectlombok:lombok'
implementation 'com.fasterxml.jackson.core:jackson-databind' implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'javax.validation:validation-api'
implementation 'io.micronaut.views:micronaut-views-handlebars' implementation 'io.micronaut.views:micronaut-views-handlebars'
implementation 'jakarta.validation:jakarta.validation-api:3.1.1'
implementation 'jakarta.annotation:jakarta.annotation-api:3.0.0'
implementation "io.github.resilience4j:resilience4j-micronaut:$resilience4jVersion" implementation "io.github.resilience4j:resilience4j-micronaut:$resilience4jVersion"
implementation "io.github.resilience4j:resilience4j-ratelimiter:$resilience4jVersion" implementation "io.github.resilience4j:resilience4j-ratelimiter:$resilience4jVersion"
implementation "io.github.resilience4j:resilience4j-consumer:$resilience4jVersion" implementation "io.github.resilience4j:resilience4j-consumer:$resilience4jVersion"
@ -55,10 +55,17 @@ application {
micronaut { micronaut {
version "$micronautVersion" version "$micronautVersion"
runtime("netty") runtime("netty")
aot {
cacheEnvironment = true
optimizeServiceLoading = true
optimizeClassLoading = true
convertYamlToJava = true
precomputeOperations = true
}
} }
wrapper { wrapper {
gradleVersion = '8.0' gradleVersion = '8.12.1'
} }
test { test {

View File

@ -1,5 +1,5 @@
micronautApplicationVersion=3.7.0 micronautApplicationVersion=4.4.5
micronautVersion=3.8.3 micronautVersion=4.7.6
julToSlf4jVersion=1.7.29 julToSlf4jVersion=1.7.29
guavaVersion=31.0.1-jre guavaVersion=31.0.1-jre
resilience4jVersion=2.0.2 resilience4jVersion=2.0.2

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

3
gradlew vendored
View File

@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034 # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum MAX_FD=maximum

View File

@ -33,10 +33,10 @@ import io.micronaut.http.annotation.*;
import io.micronaut.http.annotation.Error; import io.micronaut.http.annotation.Error;
import io.micronaut.http.server.util.HttpHostResolver; import io.micronaut.http.server.util.HttpHostResolver;
import io.micronaut.views.View; import io.micronaut.views.View;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import javax.validation.Valid;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.Map; import java.util.Map;

View File

@ -23,9 +23,9 @@ import com.devsoap.tincheck.tin.TinGenerator;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import io.micronaut.core.annotation.Introspected; import io.micronaut.core.annotation.Introspected;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDate; import java.time.LocalDate;
@Introspected @Introspected

View File

@ -21,11 +21,9 @@ package com.devsoap.tincheck.routes.requests;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import io.micronaut.core.annotation.Introspected; import io.micronaut.core.annotation.Introspected;
import lombok.Getter; import jakarta.validation.constraints.NotBlank;
import lombok.RequiredArgsConstructor; import jakarta.validation.constraints.NotNull;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Introspected @Introspected
public record TinValidateRequest( public record TinValidateRequest(

View File

@ -23,15 +23,14 @@ import com.devsoap.tincheck.tin.TinGenerator;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import io.micronaut.core.annotation.Introspected; import io.micronaut.core.annotation.Introspected;
import jdk.jfr.Timestamp; import jakarta.validation.constraints.NotNull;
import javax.validation.constraints.NotNull;
import java.time.LocalDate; import java.time.LocalDate;
@Introspected @Introspected
public record GenerationResult( public record GenerationResult(
@JsonProperty("value") String value, @JsonProperty("value") String value,
@JsonProperty("dateOfBirth") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") @Timestamp LocalDate dateOfBirth, @JsonProperty("dateOfBirth") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") LocalDate dateOfBirth,
@JsonProperty("gender") @NotNull TinGenerator.Gender gender, @JsonProperty("gender") @NotNull TinGenerator.Gender gender,
@JsonProperty("availableTokens") Long tokens @JsonProperty("availableTokens") Long tokens
){ } ){ }

View File

@ -24,11 +24,11 @@ import com.devsoap.tincheck.tin.TinGenerator;
import com.devsoap.tincheck.routes.responses.GenerationResult; import com.devsoap.tincheck.routes.responses.GenerationResult;
import com.devsoap.tincheck.routes.responses.ValidationResult; import com.devsoap.tincheck.routes.responses.ValidationResult;
import io.github.resilience4j.micronaut.annotation.RateLimiter; import io.github.resilience4j.micronaut.annotation.RateLimiter;
import jakarta.annotation.PostConstruct;
import jakarta.inject.Singleton; import jakarta.inject.Singleton;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import javax.annotation.PostConstruct;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;