Skip to content

Make defaultLibraryVersion() more robust#1436

Merged
shinfan merged 4 commits intogoogleapis:masterfrom
shinfan:master
Dec 1, 2016
Merged

Make defaultLibraryVersion() more robust#1436
shinfan merged 4 commits intogoogleapis:masterfrom
shinfan:master

Conversation

@shinfan
Copy link
Copy Markdown
Contributor

@shinfan shinfan commented Nov 30, 2016

defaultLibraryVersion() now reads version from pom.properties

Fixes #1434
Tested manually.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 30, 2016
@sai-pullabhotla
Copy link
Copy Markdown

I don't have a whole lot of background on this, but I'm curious - why can't we use something as simple as -

ServiceOptions.class.getPackage().getImplementationVersion();

That should do the work of getting the implementation version from Jar's metadata.

@shinfan
Copy link
Copy Markdown
Contributor Author

shinfan commented Dec 1, 2016

@sai-pullabhotla I tried this approach but it did not work for me (the method simply returns null).

@sai-pullabhotla
Copy link
Copy Markdown

@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:

Package pack = ServiceOptions.class.getPackage();
System.out.println("Impl Title: " + pack.getImplementationTitle());
System.out.println("Impl Version: " + pack.getImplementationVersion());
System.out.println("Spec Title: " + pack.getSpecificationTitle());
System.out.println("Spec Version: " + pack.getSpecificationVersion());

Output

Impl Title: Google Cloud Core
Impl Version: 0.7.0
Spec Title: Google Cloud Core
Spec Version: 0.7.0

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.01%) to 84.33% when pulling e21fc25 on shinfan:master into 5dfb904 on GoogleCloudPlatform:master.

properties.load(inputStream);
return properties.getProperty(META_VERSION_KEY, "");
}
} catch (Exception e) {

This comment was marked as spam.

This comment was marked as spam.

return version;
}

private static String getMavenVersion() {

This comment was marked as spam.

This comment was marked as spam.

@garrettjonesgoogle
Copy link
Copy Markdown
Contributor

LIBRARY_NAME should be changed to "google-cloud-java". There are also a couple comments that reference the old name ("gcloud-java").

@shinfan
Copy link
Copy Markdown
Contributor Author

shinfan commented Dec 1, 2016

@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.

@shinfan
Copy link
Copy Markdown
Contributor Author

shinfan commented Dec 1, 2016

@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.

@garrettjonesgoogle
Copy link
Copy Markdown
Contributor

LGTM after Travis passes

@shinfan
Copy link
Copy Markdown
Contributor Author

shinfan commented Dec 1, 2016

Travis passed for oraclejdk7/8 and openjdk. There is one "no_language_set" pending for 30 mins.
AppVeyor CI failed but I believe it is caused by flakiness. I will go ahead and merge if no objection @garrettjonesgoogle

@garrettjonesgoogle
Copy link
Copy Markdown
Contributor

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.

@shinfan shinfan merged commit 15e2e2d into googleapis:master Dec 1, 2016
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.04%) to 84.3% when pulling 2ff6851 on shinfan:master into 5dfb904 on GoogleCloudPlatform:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.04%) to 84.303% when pulling c3077da on shinfan:master into 5dfb904 on GoogleCloudPlatform:master.

@mziccard
Copy link
Copy Markdown
Contributor

mziccard commented Dec 2, 2016

LIBRARY_NAME should be changed to "google-cloud-java". There are also a couple comments that reference the old name ("gcloud-java").

@garrettjonesgoogle did you check this with @omaray and @jgeewax? Last time we discussed this (~2months ago) it was suggested to stick to gcloud-java for the time being.

I feel like a creep when I step in like this :)

@garrettjonesgoogle
Copy link
Copy Markdown
Contributor

No, your feedback is always welcome :-)

We have agreed internally to change all languages to google-cloud-java for this value.

@garrettjonesgoogle
Copy link
Copy Markdown
Contributor

I checked again internally and I was wrong - this needs to be changed back to gcloud-java. @shinfan , could you fix that up? Sorry for the churn.

@shinfan
Copy link
Copy Markdown
Contributor Author

shinfan commented Dec 5, 2016

Acknowledged. Will do.

github-actions Bot pushed a commit that referenced this pull request Aug 16, 2022
…14.5 (#1436)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](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` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.6/compatibility-slim/2.14.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.6/confidence-slim/2.14.3)](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=-->
meltsufin pushed a commit that referenced this pull request Dec 22, 2025
* 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>
chingor13 pushed a commit that referenced this pull request Jan 6, 2026
…1436)

* Doc: Add more explanation and examples for logbackBatchingSettings

* fix comments
chingor13 pushed a commit that referenced this pull request Jan 22, 2026
…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>
chingor13 pushed a commit that referenced this pull request Feb 24, 2026
🤖 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).
suztomo pushed a commit to suztomo/google-cloud-java that referenced this pull request Mar 11, 2026
* 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>
chingor13 pushed a commit that referenced this pull request Mar 12, 2026
🤖 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).
lqiu96 pushed a commit that referenced this pull request Mar 20, 2026
…1436)

* Doc: Add more explanation and examples for logbackBatchingSettings

* fix comments
suztomo pushed a commit to suztomo/google-cloud-java that referenced this pull request Mar 23, 2026
meltsufin pushed a commit that referenced this pull request Apr 29, 2026
…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]>
meltsufin pushed a commit that referenced this pull request May 1, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants