Bug #111164 Make dependency to Protocol Buffers optional
Submitted: 26 May 2023 9:30 Modified: 26 May 2023 10:21
Reporter: Björn Michael (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / J Severity:S4 (Feature request)
Version:8 OS:Any
Assigned to: CPU Architecture:Any

[26 May 2023 9:30] Björn Michael
Description:
The size of Protocol Buffers artifact reaches 1,59 MB (protobuf-java-3.21.9.jar) already but it's only used for X DevAPI. It forces one to make an exclusion to protobuf-java whenever the default Connector/J is used. 
Therefore change the default to opt-in i.e. if one requires protobuf-java then the dependency can be easily added.

Then Connector/J pom.xml should contain protobuf-java as an optional dependency.
E.g.
<dependency>
    <groupId>com.google.protobuf</groupId>
    <artifactId>protobuf-java</artifactId>
    <version>3.21.9</version>
    <optional>true</optional>
</dependency>

How to repeat:
Add mysql-connector-j dependency in your sample pom.xml and
mvn dependency:list
shouldn't contain "com.google.protobuf:protobuf-java:jar:3.21.9:compile" anymore.

Suggested fix:
Use <optional>true</optional> for protobuf-java dependency.
[26 May 2023 10:19] MySQL Verification Team
Hello Björn,

Thank you for the report and feedback.

regards,
Umesh