From 7fbdf98ce25b5ce9def05158e6a01cc1fed049c5 Mon Sep 17 00:00:00 2001
From: Vincent Massol <vincent@massol.net>
Date: Fri, 2 Apr 2021 11:19:31 +0200
Subject: [PATCH] XDOCKER-186: Deprecated 'com.mysql.jdbc.Driver' class warning
 when using MySQL version 8 connector * Also update the MySQL driver from
 8.0.22 to 8.0.23

---
 template/Dockerfile              | 4 ++--
 template/xwiki/hibernate.cfg.xml | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/template/Dockerfile b/template/Dockerfile
index f53b550..53e4990 100644
--- a/template/Dockerfile
+++ b/template/Dockerfile
@@ -62,10 +62,10 @@ RUN rm -rf /usr/local/tomcat/webapps/* && \\
 <% if (db == 'mysql') {
   println "# For MYSQL, download the MySQL driver version from the Maven Central repository since there's no up to "
   println "# date Debian repository for it anymore."
-  println "ENV MYSQL_JDBC_VERSION=\"8.0.22\""
+  println "ENV MYSQL_JDBC_VERSION=\"8.0.23\""
   // Get the SHA256 from the JAR at https://search.maven.org/artifact/mysql/mysql-connector-java and using the
   // command line defined in build.gradle.
-  println "ENV MYSQL_JDBC_SHA256=\"5019defbd12316295e97a6e88f2a9b07f118345a4e982710bba232e499b22f4f\""
+  println "ENV MYSQL_JDBC_SHA256=\"ff7d5b402afd39c12787471505a33a304103b238ec1b7a44e8936d3329da7535\""
   println "ENV MYSQL_JDBC_PREFIX=\"https://repo1.maven.org/maven2/mysql/mysql-connector-java/\${MYSQL_JDBC_VERSION}\""
   println "ENV MYSQL_JDBC_ARTIFACT=\"mysql-connector-java-\${MYSQL_JDBC_VERSION}.jar\""
   println "ENV MYSQL_JDBC_TARGET=\"/usr/local/tomcat/webapps/ROOT/WEB-INF/lib/\${MYSQL_JDBC_ARTIFACT}\""
diff --git a/template/xwiki/hibernate.cfg.xml b/template/xwiki/hibernate.cfg.xml
index 2c2e3f8..8765173 100644
--- a/template/xwiki/hibernate.cfg.xml
+++ b/template/xwiki/hibernate.cfg.xml
@@ -86,7 +86,7 @@
     <property name="connection.url">jdbc:mysql://replacecontainer/replacedatabase?useSSL=false</property>
     <property name="connection.username">replaceuser</property>
     <property name="connection.password">replacepassword</property>
-    <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
+    <property name="connection.driver_class">com.mysql.cj.jdbc.Driver</property>
     <property name="dbcp.poolPreparedStatements">true</property>
     <property name="dbcp.maxOpenPreparedStatements">20</property>
 
-- 
GitLab