This PR upgrades MySQL Connector/J to version 8.0.31, switches to the new group id and artifact id, and extends dependency management to the new identifiers.

As of 8.0.31, the Maven group id and artifact id of MySQL Connector/J have been changed to com.mysql and mysql-connector-j, respectively. The previous ids will still work in the near future as relocation POMs are published to forward to the new coordinates: https://dev.mysql.com/doc/relnotes/connector-j/8.0/en/news-8-0-31.html

Comment From: wilkinsona

Thanks for the proposal. Unfortunately, I don't think we can merge this as it will break people's applications due to what appears to be a mistake in the artifacts published to Maven Central.

If an existing application depends on mysql:mysql-connector-java:8.0.30 and we upgrade to 8.0.31, building that application will try to resolve the pom file for mysql:mysql-connector-java:8.0.31. Unfortunately, it does not exist. It looks to me as if the relocation pom has been misnamed as the artifact id in its path does not match the artifact id in the file name:

https://repo.maven.apache.org/maven2/mysql/mysql-connector-java/8.0.31/mysql-connector-j-8.0.31.pom

Here's a failure for a Maven build that's trying to use 8.0.31 but with the previous coordinates:

 ./mvnw package
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------< com.example:mysql-relocation >--------------------
[INFO] Building mysql-relocation 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for mysql:mysql-connector-java:jar:8.0.31 is missing, no dependency information available
Downloading from central: https://repo.maven.apache.org/maven2/mysql/mysql-connector-java/8.0.31/mysql-connector-java-8.0.31.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.907 s
[INFO] Finished at: 2022-10-17T08:29:43+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project mysql-relocation: Could not resolve dependencies for project com.example:mysql-relocation:jar:0.0.1-SNAPSHOT: Could not find artifact mysql:mysql-connector-java:jar:8.0.31 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

Please report this to the MySQL project. We can consider this again if they fix the relocation pom.

Comment From: hpoettker

Thanks! I only tested the new identifiers and checked that there was a pom online.

A bug has been opened in the MySQL bug tracker: https://bugs.mysql.com/bug.php?id=108799

Comment From: wilkinsona

Thanks for the link to the MySQL issue. I've subscribed to it.

Comment From: fjssilva

You are absolutely right, there's a mistake in the relocation POM name. We are fixing it as soon as possible.

Mind that we'll be publishing relocation POMs for a limited number of releases and you should move on to using the new maven coordinates as soon as possible.

Thank you for making us aware of the issue.

Comment From: hpoettker

The relocation pom seems to have been added with the correct file name:

https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.31/mysql-connector-java-8.0.31.pom

The artifact resolution through the relocation pom also works smoothly in the builds that I tested.

Comment From: wilkinsona

Thanks very much, @fjssilva and @hpoettker.