Make defaultLibraryVersion() more robust#1436
Conversation
|
I don't have a whole lot of background on this, but I'm curious - why can't we use something as simple as -
That should do the work of getting the implementation version from Jar's metadata. |
|
@sai-pullabhotla I tried this approach but it did not work for me (the method simply returns null). |
|
@shinfan - as long as the class is loaded from JAR and JAR has manifest with the Implementation-Version defined, it should work. Below is what I get: Output |
| properties.load(inputStream); | ||
| return properties.getProperty(META_VERSION_KEY, ""); | ||
| } | ||
| } catch (Exception e) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| return version; | ||
| } | ||
|
|
||
| private static String getMavenVersion() { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
LIBRARY_NAME should be changed to "google-cloud-java". There are also a couple comments that reference the old name ("gcloud-java"). |
|
@sai-pullabhotla As I said, the method did not work under my environment and it returned null. If it happens to me it may happen to other users. My best guess is that my maven does not insert the correct manifest data into the JAR. |
|
@garrettjonesgoogle PTAL |
| version = manifestAttributes.getValue(MANIFEST_VERSION_KEY); | ||
| String version = getPomVersion(); | ||
| if (version == null) { | ||
| try { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
LGTM after Travis passes |
|
Travis passed for oraclejdk7/8 and openjdk. There is one "no_language_set" pending for 30 mins. |
|
The "no_language_set" one is for Mac. I have often seen it take longer. I have no concerns about your CL on mac so go ahead and merge it. |
@garrettjonesgoogle did you check this with @omaray and @jgeewax? Last time we discussed this (~2months ago) it was suggested to stick to I feel like a creep when I step in like this :) |
|
No, your feedback is always welcome :-) We have agreed internally to change all languages to |
|
I checked again internally and I was wrong - this needs to be changed back to |
|
Acknowledged. Will do. |
…14.5 (#1436) [](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.14.3` -> `2.14.6` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquerydatatransfer). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xNTguMCIsInVwZGF0ZWRJblZlciI6IjMyLjE1OC4wIn0=-->
* chore(deps): Update gapic-generator-java to 2.26.0 PiperOrigin-RevId: 567624307 Source-Link: googleapis/googleapis@2ecf4de Source-Link: https://github.com/googleapis/googleapis-gen/commit/a5cfbd9a05b3a134e92886114db776fb33cec9f2 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTVjZmJkOWEwNWIzYTEzNGU5Mjg4NjExNGRiNzc2ZmIzM2NlYzlmMiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
…1436) * Doc: Add more explanation and examples for logbackBatchingSettings * fix comments
…39.0 (#1436) * chore(deps): update dependency com.google.cloud:libraries-bom to v26.39.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
* chore(deps): Update gapic-generator-java to 2.26.0 PiperOrigin-RevId: 567624307 Source-Link: googleapis/googleapis@2ecf4de Source-Link: https://github.com/googleapis/googleapis-gen/commit/a5cfbd9a05b3a134e92886114db776fb33cec9f2 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTVjZmJkOWEwNWIzYTEzNGU5Mjg4NjExNGRiNzc2ZmIzM2NlYzlmMiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
…1436) * Doc: Add more explanation and examples for logbackBatchingSettings * fix comments
🤖 I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
…cies to v3.1.0 (#1436) * deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.0 * fix: update the pubsub fake executor to cancel a pending callables future when cancelled Co-authored-by: hannahrogers-google <[email protected]>
…cies to v3.1.0 (#1436) * deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.0 * fix: update the pubsub fake executor to cancel a pending callables future when cancelled Co-authored-by: hannahrogers-google <[email protected]>
defaultLibraryVersion()now reads version from pom.propertiesFixes #1434
Tested manually.