-
Notifications
You must be signed in to change notification settings - Fork 0
Update project for Java 21 #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
31ee460
Update project for Java 21
mrMigles 13434d1
Ensure Java 21 toolchain and docker build
mrMigles dc491f8
Update GitHub workflows for Java 21
mrMigles 51c742b
Fix Lombok compilation on Java 21
mrMigles e55be6f
Update Lombok for Java 21
mrMigles 5d35baa
Update Groovy and surefire for Java 21
mrMigles 8b3b19f
Use stable surefire plugin version
mrMigles 2b84e3c
Use Apache Groovy BOM
mrMigles 8eaa3d3
Improve Java 21 test runtime
mrMigles File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED | ||
| --add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED | ||
| --add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED | ||
| --add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED | ||
| --add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED | ||
| --add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED | ||
| --add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED | ||
| --add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED | ||
| --add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED | ||
| --add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED | ||
| --add-opens=java.base/java.lang=ALL-UNNAMED | ||
| --add-opens=java.base/java.lang.invoke=ALL-UNNAMED | ||
| --add-opens=java.base/java.lang.reflect=ALL-UNNAMED | ||
| --add-opens=java.base/java.io=ALL-UNNAMED | ||
| --add-opens=java.base/java.util=ALL-UNNAMED |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <toolchains> | ||
| <toolchain> | ||
| <type>jdk</type> | ||
| <provides> | ||
| <version>21</version> | ||
| </provides> | ||
| <configuration> | ||
| <jdkHome>${env.JAVA_HOME}</jdkHome> | ||
| </configuration> | ||
| </toolchain> | ||
| </toolchains> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip | ||
| distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,25 @@ | ||
| FROM eclipse-temurin:8-jdk-alpine | ||
| FROM maven:3.9.6-eclipse-temurin-21 as builder | ||
| WORKDIR /workspace | ||
| COPY .mvn ./.mvn | ||
| COPY pom.xml . | ||
| COPY src ./src | ||
| RUN mvn -B -e -DskipTests clean package | ||
|
|
||
| FROM eclipse-temurin:21-jdk-alpine | ||
| VOLUME /tmp | ||
| COPY target/botplatform-0.0.1-SNAPSHOT.jar app.jar | ||
| COPY --from=builder /workspace/target/botplatform-0.0.1-SNAPSHOT.jar /app.jar | ||
| RUN apk update \ | ||
| && apk add --no-cache ca-certificates fontconfig ttf-dejavu \ | ||
| && update-ca-certificates \ | ||
| && rm -rf /var/cache/apk/* | ||
| ENTRYPOINT ["java","-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] | ||
| ENTRYPOINT ["java", | ||
| "--add-opens=java.base/java.lang=ALL-UNNAMED", | ||
| "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED", | ||
| "--add-opens=java.base/java.lang.reflect=ALL-UNNAMED", | ||
| "--add-opens=java.base/java.io=ALL-UNNAMED", | ||
| "--add-opens=java.base/java.net=ALL-UNNAMED", | ||
| "--add-opens=java.base/java.util=ALL-UNNAMED", | ||
| "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005", | ||
| "-Djava.security.egd=file:/dev/./urandom", | ||
| "-jar", | ||
| "/app.jar"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,2 @@ | ||
| mvn clean install | ||
|
|
||
| docker build -f Dockerfile -t mrmigles/pakhombot:latest . | ||
| docker push mrmigles/pakhombot:latest | ||
| docker push mrmigles/pakhombot:latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching the compiler target to Java 21 (
maven-compiler-pluginrelease 21) means the build now runs on a JDK that no longer shipsjavax.annotation(removed with the old Java EE modules). The codebase still importsjavax.annotation.PostConstruct/Nonnullin multiple classes (e.g.,src/main/java/ru/holyway/botplatform/BotPlatformApplication.java:13), and the POM does not declare ajavax.annotation-apidependency, so compilation on Java 21 will fail with “package javax.annotation does not exist.” Please add the API dependency or keep targeting a JDK that provides it.Useful? React with 👍 / 👎.