Skip to content
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

Java 17 #3510

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Java 17 #3510

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ jobs:

- run: make acceptance-tests-up
- run: make acceptance-tests-run
- run: make acceptance-tests-down
- run: c2cciutils-docker-logs || true
if: always()

Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gradle:8.10.2-jdk11 AS builder
FROM gradle:8.10.2-jdk17 AS builder

RUN --mount=type=cache,target=/var/cache,sharing=locked \
--mount=type=cache,target=/root/.cache \
Expand Down Expand Up @@ -31,10 +31,10 @@ RUN --mount=type=cache,target=/home/gradle/.gradle \
gradle --parallel --exclude-task=:core:test \
--exclude-task=:core:spotbugsMain --exclude-task=:core:checkstyleMain \
--exclude-task=:core:spotbugsTest --exclude-task=:core:checkstyleTest --exclude-task=:core:testCLI \
:core:build :core:explodedWar :publish:build :examples:build :docs:buildDocs :core:libSourcesJar :core:libJavadocJar
:core:build :core:explodedWar :publish:build :examples:build :core:libSourcesJar :core:libJavadocJar

RUN mkdir -p core/build/resources/test/org/mapfish/print/ \
&& chmod -R go=u /home/gradle /tmp/mapfish-print/ . \
&& chmod -R go=u /home/gradle . \
&& chmod o+t -R core/build/resources

# Backup cache
Expand Down
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ acceptance-tests-run: .env
.PHONY: acceptance-tests-down
acceptance-tests-down: .env
docker compose down || true
docker run --rm --volume=/tmp/geoserver-data:/mnt/geoserver_datadir camptocamp/geoserver \
bash -c 'rm -rf /mnt/geoserver_datadir/*'
rmdir /tmp/geoserver-data

.PHONY: dist
dist: build-builder
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ configure(subprojects.findAll { ['core', 'examples'].contains(it.name) }) {
reportLevel = "high"
}

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

compileJava.options.compilerArgs = ['-Xlint:deprecation', '-Xlint:unchecked']

Expand All @@ -65,9 +65,9 @@ configure(subprojects.findAll { ['core', 'examples'].contains(it.name) }) {
}

test {
jvmArgs '-XX:+CMSClassUnloadingEnabled'
jvmArgs '--add-opens=java.desktop/sun.awt.image=ALL-UNNAMED'
minHeapSize = "128m"
maxHeapSize = "512m"
maxHeapSize = "768m"
testLogging {
exceptionFormat = 'full'
}
Expand Down
6 changes: 6 additions & 0 deletions ci/dpkg-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ camptocamp/mapfish_print:latest:
ubuntu_22_04/apt: 2.4.11
ubuntu_22_04/base-passwd: 3.5.52build1
ubuntu_22_04/bash: 5.1-6ubuntu1
ubuntu_22_04/binutils: 2.38-4ubuntu2.6
ubuntu_22_04/binutils-common: 2.38-4ubuntu2.6
ubuntu_22_04/binutils-x86-64-linux-gnu: 2.38-4ubuntu2.6
ubuntu_22_04/bsdutils: 1:2.37.2-4ubuntu3
ubuntu_22_04/ca-certificates: 20230311ubuntu0.22.04.1
ubuntu_22_04/coreutils: 8.32-4.1ubuntu1
Expand Down Expand Up @@ -43,6 +46,7 @@ camptocamp/mapfish_print:latest:
ubuntu_22_04/libattr1: 1:2.5.1-1build1
ubuntu_22_04/libaudit-common: 1:3.0.7-1build1
ubuntu_22_04/libaudit1: 1:3.0.7-1build1
ubuntu_22_04/libbinutils: 2.38-4ubuntu2.6
ubuntu_22_04/libblkid1: 2.37.2-4ubuntu3
ubuntu_22_04/libbrotli1: 1.0.9-2build6
ubuntu_22_04/libbz2-1.0: 1.0.8-5build1
Expand All @@ -52,6 +56,8 @@ camptocamp/mapfish_print:latest:
ubuntu_22_04/libcap2: 1:2.44-1ubuntu0.22.04.1
ubuntu_22_04/libcom-err2: 1.46.5-2ubuntu1.1
ubuntu_22_04/libcrypt1: 1:4.4.27-1
ubuntu_22_04/libctf-nobfd0: 2.38-4ubuntu2.6
ubuntu_22_04/libctf0: 2.38-4ubuntu2.6
ubuntu_22_04/libcurl4: 7.81.0-1ubuntu1.15
ubuntu_22_04/libdb5.3: 5.3.28+dfsg1-0.8ubuntu3
ubuntu_22_04/libdebconfclient0: 0.261ubuntu1
Expand Down
4 changes: 2 additions & 2 deletions core/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM mapfish_print_builder AS builder

FROM tomcat:9.0.96-jdk11-temurin-jammy AS runner
FROM tomcat:9.0.96-jdk17-temurin-jammy AS runner
LABEL maintainer="Camptocamp <info@camptocamp.com>"

RUN --mount=type=cache,target=/var/cache,sharing=locked \
Expand Down Expand Up @@ -43,7 +43,7 @@ ENV LOG_LEVEL=INFO \
TOMCAT_LOG_TYPE=classic \
EXTRA_JARS= \
PRINT_YAML_MAX_ALIASES=50 \
JAVA_OPTS=-Dsun.net.inetaddr.ttl=30 \
JAVA_OPTS="--add-opens=java.desktop/sun.awt.image=ALL-UNNAMED -Dsun.net.inetaddr.ttl=30" \
Copy link
Member

@sbrunner sbrunner Nov 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For backward compatibility, it's better to put this option in docker-start-print
because this option is necessary for the print and here it's too easy to override.
Eventually, we can use in intermediate environment variable named REQUIRED_JAVA_OPTS.

SENTRY_DSN=

CMD ["/usr/local/tomcat/bin/docker-start-print"]
Expand Down
1 change: 1 addition & 0 deletions core/docker/usr/local/tomcat/bin/docker-start-print
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
cd /usr/local/tomcat/webapps/ROOT
PG_LIB=$(find WEB-INF/lib -name "postgresql-*")

# Checks if Database is present (DB is compulsory in cluster mode)
if java ${CATALINA_OPTS} -cp WEB-INF/classes/:$PG_LIB org.mapfish.print.WaitDB; then
cp WEB-INF/classes/mapfish-spring-application-context-override-db.xml \
WEB-INF/classes/mapfish-spring-application-context-override.xml
Expand Down
Loading