New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deps: do not re-declare grpc dependencies as test dependencies #278
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
pom.xml
Outdated
<dependency> | ||
<groupId>com.google.api.grpc</groupId> | ||
<artifactId>proto-google-common-protos</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.cloud</groupId> | ||
<artifactId>google-cloud-spanner</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-bom
will getgoogle-cloud-spanner
version 2.0.2. - Any application that adds
google-cloud-spanner-jdbc
as a dependency and imports thelibraries-bom
, will get the versions ofgoogle-cloud-spanner-jdbc
andgoogle-cloud-spanner
that are defined in thelibraries-bom
. The version ofgoogle-cloud-spanner
in 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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