Upgrade project environment to Java 25 and Gradle 9 (#1277)
This commit is contained in:
+2
-2
@@ -14,7 +14,7 @@ COPY ./booklore-ui /angular-app/
|
|||||||
RUN npm run build --configuration=production
|
RUN npm run build --configuration=production
|
||||||
|
|
||||||
# Stage 2: Build the Spring Boot app with Gradle
|
# 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
|
WORKDIR /springboot-app
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ RUN apk add --no-cache yq && \
|
|||||||
RUN gradle clean build -x test
|
RUN gradle clean build -x test
|
||||||
|
|
||||||
# Stage 3: Final image
|
# 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
|
RUN apk update && apk add nginx gettext su-exec
|
||||||
|
|
||||||
|
|||||||
+12
-14
@@ -2,8 +2,8 @@ plugins {
|
|||||||
id 'java'
|
id 'java'
|
||||||
id 'org.springframework.boot' version '3.5.1'
|
id 'org.springframework.boot' version '3.5.1'
|
||||||
id 'io.spring.dependency-management' version '1.1.7'
|
id 'io.spring.dependency-management' version '1.1.7'
|
||||||
id 'org.hibernate.orm' version '7.1.0.Final'
|
id 'org.hibernate.orm' version '7.1.3.Final'
|
||||||
id 'com.github.ben-manes.versions' version '0.52.0'
|
id 'com.github.ben-manes.versions' version '0.53.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
group = 'com.adityachandel'
|
group = 'com.adityachandel'
|
||||||
@@ -11,7 +11,7 @@ version = '0.0.1-SNAPSHOT'
|
|||||||
|
|
||||||
java {
|
java {
|
||||||
toolchain {
|
toolchain {
|
||||||
languageVersion = JavaLanguageVersion.of(21)
|
languageVersion = JavaLanguageVersion.of(25)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,18 +39,18 @@ dependencies {
|
|||||||
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
|
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
|
||||||
|
|
||||||
// --- Database & Migration ---
|
// --- Database & Migration ---
|
||||||
implementation 'org.mariadb.jdbc:mariadb-java-client:3.5.4'
|
implementation 'org.mariadb.jdbc:mariadb-java-client:3.5.6'
|
||||||
implementation 'org.flywaydb:flyway-mysql:11.11.0'
|
implementation 'org.flywaydb:flyway-mysql:11.13.2'
|
||||||
implementation 'jakarta.persistence:jakarta.persistence-api:3.2.0'
|
implementation 'jakarta.persistence:jakarta.persistence-api:3.2.0'
|
||||||
|
|
||||||
// --- Security & Authentication ---
|
// --- Security & Authentication ---
|
||||||
implementation 'io.jsonwebtoken:jjwt-api:0.12.6'
|
implementation 'io.jsonwebtoken:jjwt-api:0.13.0'
|
||||||
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.6'
|
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.13.0'
|
||||||
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.12.6'
|
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.13.0'
|
||||||
|
|
||||||
// --- Lombok (For Clean Code) ---
|
// --- Lombok (For Clean Code) ---
|
||||||
compileOnly 'org.projectlombok:lombok:1.18.38'
|
compileOnly 'org.projectlombok:lombok:1.18.42'
|
||||||
annotationProcessor 'org.projectlombok:lombok:1.18.38'
|
annotationProcessor 'org.projectlombok:lombok:1.18.42'
|
||||||
|
|
||||||
// --- Book & Image Processing ---
|
// --- Book & Image Processing ---
|
||||||
implementation 'org.apache.pdfbox:pdfbox:3.0.5'
|
implementation 'org.apache.pdfbox:pdfbox:3.0.5'
|
||||||
@@ -64,8 +64,8 @@ dependencies {
|
|||||||
implementation 'com.github.junrar:junrar:7.5.5'
|
implementation 'com.github.junrar:junrar:7.5.5'
|
||||||
|
|
||||||
// --- JSON & Web Scraping ---
|
// --- JSON & Web Scraping ---
|
||||||
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.19.2'
|
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.20.0'
|
||||||
implementation 'org.jsoup:jsoup:1.21.1'
|
implementation 'org.jsoup:jsoup:1.21.2'
|
||||||
|
|
||||||
// --- Mapping (DTOs & Entities) ---
|
// --- Mapping (DTOs & Entities) ---
|
||||||
implementation 'org.mapstruct:mapstruct:1.6.3'
|
implementation 'org.mapstruct:mapstruct:1.6.3'
|
||||||
@@ -80,8 +80,6 @@ dependencies {
|
|||||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||||
testImplementation 'org.assertj:assertj-core:3.27.3'
|
testImplementation 'org.assertj:assertj-core:3.27.3'
|
||||||
testImplementation "org.mockito:mockito-inline:5.2.0"
|
testImplementation "org.mockito:mockito-inline:5.2.0"
|
||||||
testImplementation 'org.testcontainers:junit-jupiter:1.20.4'
|
|
||||||
testImplementation 'org.testcontainers:mariadb:1.20.4'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hibernate {
|
hibernate {
|
||||||
|
|||||||
BIN
Binary file not shown.
+1
-1
@@ -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.14.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
Vendored
+4
-5
@@ -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
|
||||||
@@ -115,7 +114,7 @@ case "$( uname )" in #(
|
|||||||
NONSTOP* ) nonstop=true ;;
|
NONSTOP* ) nonstop=true ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
CLASSPATH="\\\"\\\""
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
@@ -206,7 +205,7 @@ fi
|
|||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command:
|
# 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.
|
# 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
|
# * 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.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
@@ -214,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
-classpath "$CLASSPATH" \
|
-classpath "$CLASSPATH" \
|
||||||
org.gradle.wrapper.GradleWrapperMain \
|
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
# Stop when "xargs" is not available.
|
# Stop when "xargs" is not available.
|
||||||
|
|||||||
Vendored
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
@rem
|
@rem
|
||||||
@rem Copyright 2015 the original authorEntity or authorEntities.
|
@rem Copyright 2015 the original author or authors.
|
||||||
@rem
|
@rem
|
||||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@rem you may not use this file except in compliance with the License.
|
@rem you may not use this file except in compliance with the License.
|
||||||
@@ -70,11 +70,11 @@ goto fail
|
|||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
set CLASSPATH=
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@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
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
|||||||
-4
@@ -1,7 +1,6 @@
|
|||||||
package com.adityachandel.booklore.service.bookdrop;
|
package com.adityachandel.booklore.service.bookdrop;
|
||||||
|
|
||||||
import com.adityachandel.booklore.config.AppProperties;
|
import com.adityachandel.booklore.config.AppProperties;
|
||||||
import com.adityachandel.booklore.exception.APIException;
|
|
||||||
import com.adityachandel.booklore.mapper.BookdropFileMapper;
|
import com.adityachandel.booklore.mapper.BookdropFileMapper;
|
||||||
import com.adityachandel.booklore.model.FileProcessResult;
|
import com.adityachandel.booklore.model.FileProcessResult;
|
||||||
import com.adityachandel.booklore.model.dto.Book;
|
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.BookdropFileEntity;
|
||||||
import com.adityachandel.booklore.model.entity.LibraryEntity;
|
import com.adityachandel.booklore.model.entity.LibraryEntity;
|
||||||
import com.adityachandel.booklore.model.entity.LibraryPathEntity;
|
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.BookRepository;
|
||||||
import com.adityachandel.booklore.repository.BookdropFileRepository;
|
import com.adityachandel.booklore.repository.BookdropFileRepository;
|
||||||
import com.adityachandel.booklore.repository.LibraryRepository;
|
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.metadata.MetadataRefreshService;
|
||||||
import com.adityachandel.booklore.service.monitoring.MonitoringRegistrationService;
|
import com.adityachandel.booklore.service.monitoring.MonitoringRegistrationService;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Disabled;
|
import org.junit.jupiter.api.Disabled;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
@@ -44,7 +41,6 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.time.Instant;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -13,10 +13,9 @@ import com.adityachandel.booklore.service.FileFingerprint;
|
|||||||
import com.adityachandel.booklore.service.fileprocessor.BookFileProcessor;
|
import com.adityachandel.booklore.service.fileprocessor.BookFileProcessor;
|
||||||
import com.adityachandel.booklore.service.fileprocessor.BookFileProcessorRegistry;
|
import com.adityachandel.booklore.service.fileprocessor.BookFileProcessorRegistry;
|
||||||
import com.adityachandel.booklore.util.FileUtils;
|
import com.adityachandel.booklore.util.FileUtils;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.mockito.MockedStatic;
|
import org.mockito.MockedStatic;
|
||||||
import org.mockito.Mockito;
|
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
@@ -28,8 +27,8 @@ import java.util.Map;
|
|||||||
|
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
import static org.mockito.ArgumentMatchers.anyLong;
|
import static org.mockito.ArgumentMatchers.anyLong;
|
||||||
import static org.mockito.Mockito.when;
|
|
||||||
import static org.mockito.Mockito.lenient;
|
import static org.mockito.Mockito.lenient;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test builder for creating Library-related test objects.
|
* Test builder for creating Library-related test objects.
|
||||||
|
|||||||
Reference in New Issue
Block a user