1

I have implementation 'mysql:mysql-connector-java' currently in my gradle.build.

And I look up in maven repository,it says mysql:mysql-connector-java have a complie dependency of com.google.protobuf:protobuf-java.

But if i execute gradle dependencies,this was shown:

enter image description here

So why there is no com.google.protobuf:protobuf-java after it??

ratsafalig
  • 442
  • 5
  • 21
  • This doesn’t really answer the question of “why,” but a possible workaround could be including the project-report plugin and viewing dependencies through that. This answer give more details: https://stackoverflow.com/a/41784667/3570769 – Logan Elandt May 30 '20 at 02:43
  • This might answer the “why” portion, but, without knowing what else is in the dependency report, I can’t be sure. From the Gradle documentation for the current version: “Dependencies with the same coordinates that occur multiple times in the graph are omitted and indicated by an asterisk.” [Listing Dependencies in a Project](https://docs.gradle.org/current/userguide/viewing_debugging_dependencies.html#sec:listing_dependencies) – Logan Elandt May 30 '20 at 02:51

1 Answers1

1

The com.google.protobuf:protobuf-java package is required for building the source of mysql:mysql-connector-java package mainly and gradle fetches build jar files from the maven repository. That's why that package is missing in the library list.

https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-installing-maven.html

Check the below link :

https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-installing-source.html

  • When I add a spring-boot-starter, some dependencies of the starter I can get from my project's classpath,so how can I determine which dependency is used to build source only,and which is that I can get from my project's classpath – ratsafalig May 30 '20 at 05:52
  • I hope you know spring is name of a collection of projects. When the 'spring-boot-starter' dependency is called it adds very specific set of jar packages like spring-core, annotation, logging etc. These doesn't provide the full-fledged web application features but provides a base for core java application with some spring specific features. Moreover there are many packages that start with this prefix 'spring-boot-starter' like 'spring-boot-starter-web','spring-boot-starter-thymeleaf' etc. I hope given link will do some help. https://www.baeldung.com/spring-boot-starters – Wasif Al Mahmud May 30 '20 at 16:02