Upgrade project environment to Java 25 and Gradle 9 (#1277)

This commit is contained in:
Aditya Chandel
2025-10-06 12:53:34 -06:00
committed by GitHub
parent b591fa95ae
commit 7133ef1a69
8 changed files with 24 additions and 32 deletions

View File

@@ -14,7 +14,7 @@ COPY ./booklore-ui /angular-app/
RUN npm run build --configuration=production
# Stage 2: Build the Spring Boot app with Gradle
FROM gradle:8-jdk21-alpine AS springboot-build
FROM gradle:9.1-jdk25-alpine AS springboot-build
WORKDIR /springboot-app
@@ -29,7 +29,7 @@ RUN apk add --no-cache yq && \
RUN gradle clean build -x test
# Stage 3: Final image
FROM eclipse-temurin:21-jre-alpine
FROM eclipse-temurin:25-jre-alpine
RUN apk update && apk add nginx gettext su-exec

View File

@@ -2,8 +2,8 @@ plugins {
id 'java'
id 'org.springframework.boot' version '3.5.1'
id 'io.spring.dependency-management' version '1.1.7'
id 'org.hibernate.orm' version '7.1.0.Final'
id 'com.github.ben-manes.versions' version '0.52.0'
id 'org.hibernate.orm' version '7.1.3.Final'
id 'com.github.ben-manes.versions' version '0.53.0'
}
group = 'com.adityachandel'
@@ -11,7 +11,7 @@ version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
languageVersion = JavaLanguageVersion.of(25)
}
}
@@ -39,18 +39,18 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
// --- Database & Migration ---
implementation 'org.mariadb.jdbc:mariadb-java-client:3.5.4'
implementation 'org.flywaydb:flyway-mysql:11.11.0'
implementation 'org.mariadb.jdbc:mariadb-java-client:3.5.6'
implementation 'org.flywaydb:flyway-mysql:11.13.2'
implementation 'jakarta.persistence:jakarta.persistence-api:3.2.0'
// --- Security & Authentication ---
implementation 'io.jsonwebtoken:jjwt-api:0.12.6'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.6'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.12.6'
implementation 'io.jsonwebtoken:jjwt-api:0.13.0'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.13.0'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.13.0'
// --- Lombok (For Clean Code) ---
compileOnly 'org.projectlombok:lombok:1.18.38'
annotationProcessor 'org.projectlombok:lombok:1.18.38'
compileOnly 'org.projectlombok:lombok:1.18.42'
annotationProcessor 'org.projectlombok:lombok:1.18.42'
// --- Book & Image Processing ---
implementation 'org.apache.pdfbox:pdfbox:3.0.5'
@@ -64,8 +64,8 @@ dependencies {
implementation 'com.github.junrar:junrar:7.5.5'
// --- JSON & Web Scraping ---
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.19.2'
implementation 'org.jsoup:jsoup:1.21.1'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.20.0'
implementation 'org.jsoup:jsoup:1.21.2'
// --- Mapping (DTOs & Entities) ---
implementation 'org.mapstruct:mapstruct:1.6.3'
@@ -80,8 +80,6 @@ dependencies {
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.assertj:assertj-core:3.27.3'
testImplementation "org.mockito:mockito-inline:5.2.0"
testImplementation 'org.testcontainers:junit-jupiter:1.20.4'
testImplementation 'org.testcontainers:mariadb:1.20.4'
}
hibernate {

View File

Binary file not shown.

View File

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

View File

@@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# 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
' "$PWD" ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -115,7 +114,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
CLASSPATH="\\\"\\\""
# Determine the Java command to use to start the JVM.
@@ -206,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
@@ -214,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.

View File

@@ -1,5 +1,5 @@
@rem
@rem Copyright 2015 the original authorEntity or authorEntities.
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@@ -70,11 +70,11 @@ goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
set CLASSPATH=
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell

View File

@@ -1,7 +1,6 @@
package com.adityachandel.booklore.service.bookdrop;
import com.adityachandel.booklore.config.AppProperties;
import com.adityachandel.booklore.exception.APIException;
import com.adityachandel.booklore.mapper.BookdropFileMapper;
import com.adityachandel.booklore.model.FileProcessResult;
import com.adityachandel.booklore.model.dto.Book;
@@ -14,7 +13,6 @@ import com.adityachandel.booklore.model.entity.BookEntity;
import com.adityachandel.booklore.model.entity.BookdropFileEntity;
import com.adityachandel.booklore.model.entity.LibraryEntity;
import com.adityachandel.booklore.model.entity.LibraryPathEntity;
import com.adityachandel.booklore.model.enums.BookFileType;
import com.adityachandel.booklore.repository.BookRepository;
import com.adityachandel.booklore.repository.BookdropFileRepository;
import com.adityachandel.booklore.repository.LibraryRepository;
@@ -25,7 +23,6 @@ import com.adityachandel.booklore.service.fileprocessor.BookFileProcessorRegistr
import com.adityachandel.booklore.service.metadata.MetadataRefreshService;
import com.adityachandel.booklore.service.monitoring.MonitoringRegistrationService;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Ignore;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@@ -44,7 +41,6 @@ import org.springframework.data.domain.Pageable;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.time.Instant;
import java.util.List;
import java.util.Optional;

View File

@@ -13,10 +13,9 @@ import com.adityachandel.booklore.service.FileFingerprint;
import com.adityachandel.booklore.service.fileprocessor.BookFileProcessor;
import com.adityachandel.booklore.service.fileprocessor.BookFileProcessorRegistry;
import com.adityachandel.booklore.util.FileUtils;
import jakarta.validation.constraints.NotNull;
import org.apache.commons.io.FilenameUtils;
import org.jetbrains.annotations.NotNull;
import org.mockito.MockedStatic;
import org.mockito.Mockito;
import java.nio.file.Path;
import java.security.MessageDigest;
@@ -28,8 +27,8 @@ import java.util.Map;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.when;
/**
* Test builder for creating Library-related test objects.