aws-mysql-jdbc
aws-mysql-jdbc copied to clipboard
Please build and ship this library with source code
Hi. After using MariaDB connector and experimenting with the MySQL connector itself for our Aurora cluster, I now hope to find the best option in this project. However, I dearly miss the option to also retrieve the source code for this library. So please, build and ship this library with the option to fetch the source code via the IDE. In my case IntelliJ IDEA with Maven as build tool. Thanks!
Huh, I noticed that a sources.jar file exists (https://repo1.maven.org/maven2/software/aws/rds/aws-mysql-jdbc/1.1.0/), but it appears that my IDE isn't happy with it. This could be a problem on my end, I need to double check.
Doesn't seem to be an IDE problem. I can see the source code for class software.aws.rds.jdbc.mysql.Driver, but it appears for everything in package software.aws.rds.jdbc.mysql.shading the source code is unavailable.
Hello @weaselmetal
Thank you for reaching out! As you mentioned snapshot of sources is available on Maven Central. Also, you can fetch sources from github by a release tag. Most of IDE supports git repositories and can fetch sources by commit ID or a tag.
https://github.com/awslabs/aws-mysql-jdbc/tree/1.1.0
During a build process some of dependent libraries are shading into a software.aws.rds.jdbc.mysql.shading package. That's why such package can't be found in driver sources.
Thanks @sergiyvamz. I don't understand what's happening exactly, but the result of that build process is: in my project, I only see class software.aws.rds.jdbc.mysql.shading.com.mysql.cj.jdbc.ConnectionImpl
(to give one example), which - I think - is somehow the class that's created based on https://github.com/awslabs/aws-mysql-jdbc/blob/main/src/main/user-impl/java/com/mysql/cj/jdbc/ConnectionImpl.java which lives in package com.mysql.cj.jdbc
.
It seems impossible to see the source code of software.aws.rds.jdbc.mysql.shading.com.mysql.cj.jdbc.ConnectionImpl
in my IDE, hence, it's also impossible to debug any of that code in the shading
package.
I consider the inability to debug complex behavior (fail over and hopefully read-write splitting soon too) as a real issue.
Hello @weaselmetal
Shading definitely adds some complexity to debugging process however it helps to make AWS Mysql JDBC Driver compatible with Mysql JDBC Driver when both drivers are used in the same application.
When debugging the driver project, shading is not applicable and IDE recognises classes in their original packages, for example com.mysql.cj.jdbc.ConnectionImpl
.
When debugging a user application that uses the driver jar, IDE still recognises shaded packages and properly navigates to the classes, for example software.aws.rds.jdbc.mysql.shading.com.mysql.cj.jdbc.ConnectionImpl