OWASP-Benchmark/BenchmarkJava

Mismatching JDK versions leads to mvn compile and docker build to fail

mortendaehli opened this issue · 7 comments

The current version in the CI is running on JDK11, while the docker image and tomcat still depends on JDK8.

I suggest that the Dockerfile points to openjdk-11 and that the pom.xml changes from <java.target>8</java.target> to <java.target>11</java.target>. This seems to resolve the issue.

@mortendaehli - I just pushed an update to the Benchmark Docker image to upgrade Java to Java 11. I didn't make the pom change but I don't think that matters. Please confirm this fixes the Docker image.

You push only the arm64 version of the image. So I cannot test on my machine the image amd64 from Docker Hub.

The recommanded modification from @mortendaehli seems to work !

@Qwarctick / @thc202 - I figured it out. I have now pushed an update which is for AMD64, and Java 11. Can you test to verify it works as expected? And if you can help me figure out how to generate a Multiplatform version for both AMD64 and ARM64, I'll push that. Right now I can generate 1 for each, but not 1 that supports both.

Yes Thanks ! The amd64 version of docker hub works. As far as I know, it is not possible to generate a cross-platform image. You have to push both for each modification. I recommend adding this step to your CI to avoid doing it every time. This question should be discussed in the issue #223

For the current issue, the problem is still the same. We cannot build locally the image. Migrating from java 8 to 11 seems to solve the problem. I also tried with java 19 and it works. But we should use java 11 to use the same version than the CI.

It appears this is now fixed, so I'm closing this issue, but I still need to also push an ARM64 version out too.