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 fix #3537

Closed
wants to merge 8 commits into from
Closed
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
2 changes: 1 addition & 1 deletion 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
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.98-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" \
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
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,10 @@ private String doCreateAndPollAndGetReport(

timeElapsed = statusJson.getInt(MapPrinterServlet.JSON_ELAPSED_TIME);
assertTrue(
"lastTimeElapsed: " + lastTimeElapsed + ", timeElapsed: " + timeElapsed,
"lastTimeElapsed: "
+ lastTimeElapsed
+ " is not less or equal to timeElapsed: "
+ timeElapsed,
lastTimeElapsed <= timeElapsed);
lastTimeElapsed = timeElapsed;

Expand Down
28 changes: 15 additions & 13 deletions docs/src/main/groovy/Javadoc7Parser.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@ class Javadoc7Parser {
String findJavadocDescription(String objectName, Class cls, String obj, Closure errorHandler) {
try {
def html = loadJavadocFile(cls)

def contentContainer = html.depthFirst().find {
it.name() == 'div' && it.@class == 'contentContainer'
it.name() == 'main' && it.@role == 'main'
}
def detailsEl = contentContainer.depthFirst().find {
it.name() == 'div' && it.@class == 'details'
it.name() == 'section' && it.@class == 'details'
}

def descDiv = detailsEl.depthFirst().find {

if (it.name() == "li") {
def h4 = it.h4
return h4.size() > 0 && !h4.text().isEmpty() && obj == h4.text()
def h3 = it.section.h3
return h3.size() > 0 && !h3.text().isEmpty() && obj == h3.text()
} else {
return false
}
}

def description = descDiv.breadthFirst().find {
return it.name() == 'div' && it.@class == 'block'
}

def firstDescriptionDiv = descDiv.div[0]
return DocsXmlSupport.toXmlString(firstDescriptionDiv)
return DocsXmlSupport.toXmlString(description)
} catch (Exception e) {
if (cls.getSuperclass() != null) {
try {
Expand All @@ -58,7 +58,7 @@ class Javadoc7Parser {
throw new IllegalArgumentException(errorHandler(obj, objectName))
}
} else {
throw new IllegalArgumentException(errorHandler(obj, objectName))
return ""
}
}
}
Expand All @@ -67,17 +67,19 @@ class Javadoc7Parser {
return "Unable to find javadoc for method '$method' in '$objectName'"
}


String findClassDescription(Class cls) {
def html = loadJavadocFile(cls)

def contentContainer = html.depthFirst().find {
it.name() == 'div' && it.@class == 'contentContainer'
it.name() == 'main' && it.@role == 'main'
}
def descriptionEl = contentContainer.depthFirst().find {
it.name() == 'div' && it.@class == 'description'
it.name() == 'section' && it.@class == 'class-description'
}
def result = contentContainer.depthFirst().find {
it.name() == 'div' && it.@class == 'block'
}
return DocsXmlSupport.toXmlString(descriptionEl.ul.li.div[0])
return DocsXmlSupport.toXmlString(result)
}
def xmlCache = [:]

Expand Down
Loading