deps: do not re-declare grpc dependencies as test dependencies#278
deps: do not re-declare grpc dependencies as test dependencies#278
Conversation
elharo
left a comment
There was a problem hiding this comment.
I don't think this is correct. If they're not needed by this project's compile classpath, they should be added in the downstream project; not here.
Codecov Report
@@ Coverage Diff @@
## master #278 +/- ##
=========================================
Coverage 71.40% 71.40%
Complexity 1104 1104
=========================================
Files 24 24
Lines 3396 3396
Branches 525 525
=========================================
Hits 2425 2425
Misses 756 756
Partials 215 215 Continue to review full report at Codecov.
|
@elharo It seems that there are a couple of problems here:
@suztomo Any ideas what the best approach would be for the last point? |
…r-jdbc into include-grpc-deps
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.cloud</groupId> | ||
| <artifactId>google-cloud-spanner</artifactId> |
There was a problem hiding this comment.
The version that is used here will be determined by the version defined at line 72 for the import of google-cloud-spanner-bom (currently 2.0.2). That is the version of google-cloud-spanner that anyone using google-cloud-spanner-jdbc should be using. But:
- Any application that adds only
google-cloud-spanner-jdbc(version 1.17.3) as a dependency without importing thelibraries-bomwill getgoogle-cloud-spannerversion 2.0.2. - Any application that adds
google-cloud-spanner-jdbcas a dependency and imports thelibraries-bom, will get the versions ofgoogle-cloud-spanner-jdbcandgoogle-cloud-spannerthat are defined in thelibraries-bom. The version ofgoogle-cloud-spannerin the BOM can be different from the one defined ingoogle-cloud-spanner-jdbc.
|
I agree with Elliotte's point. If some artifacts are missing proper dependencies, we should fix that there. Let me dig your finding further. GoogleCloudPlatform/java-docs-samples#4278 (comment) |
Yes, I agree with that. But in this case it should be a transitive dependency, but seems to have lost that status. And that seems to be caused by the fact that it was added as a test dependency in the pom of this project, while it was already a compile-time dependency. I have not been able to find a satisfactory explanation as to why the dependency was still transitive in earlier versions of the JDBC driver, but not anymore. |
elharo
left a comment
There was a problem hiding this comment.
I'm a little surprised Maven doesn't flag this issue (declaring the same dependency in multiple scopes) as an error.
Removes the re-declaration of
grpc-google-cloud-spanner-...as test dependencies as they are already transitive compile-time dependencies.Fixes the failure in GoogleCloudPlatform/java-docs-samples#4278