From 3db0e34d264e6f4739a536c11b050c5a28468232 Mon Sep 17 00:00:00 2001 From: Diego Alonso Marquez Palacios Date: Thu, 16 Jan 2025 15:24:38 -0500 Subject: [PATCH 1/6] docs: promote use of bill of materials in quickstart documentation Fixes #1552 --- README.md | 50 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5ea6fc028..f4e254bac 100644 --- a/README.md +++ b/README.md @@ -50,35 +50,69 @@ credentials as well as utility methods to create them and to get Application Def ## Quickstart +### Using Maven + +#### Google Auth Library Bill of Materials +In order to ensure transitive dependencies and the modules themselves are aligned with each other, +we rely on the Google Auth Library Bill of Materials. Please add this to your dependency management +section as follows: + +[//]: # ({x-version-update-start:google-auth-library-bom:released}) +```xml + + + + com.google.auth + google-auth-library-bom + 1.30.1 + pom + import + + + +``` +[//]: # ({x-version-update-end}) + +#### Choosing your implementation + If you are using Maven, add this to your pom.xml file (notice that you can replace `google-auth-library-oauth2-http` with any of `google-auth-library-credentials` and `google-auth-library-appengine`, depending on your application needs): -[//]: # ({x-version-update-start:google-auth-library-oauth2-http:released}) - ```xml com.google.auth + + google-auth-library-oauth2-http - 1.19.0 ``` -[//]: # ({x-version-update-end}) - +### Using Gradle If you are using Gradle, add this to your dependencies -[//]: # ({x-version-update-start:google-auth-library-oauth2-http:released}) +[//]: # ({x-version-update-start:google-auth-library-bom:released}) ```Groovy -implementation 'com.google.auth:google-auth-library-oauth2-http:1.19.0' +dependencies { + // The BOM will manage the module versions and transitive dependencies + implementation platform('com.google.auth:google-auth-library-bom:1.30.1') + // Replace this with the implementation module that suits your needs + implementation 'com.google.auth:google-auth-library-oauth2-http' +} + ``` [//]: # ({x-version-update-end}) +Unfortunately, SBT [cannot](https://github.com/sbt/sbt/issues/4531) manage dependencies via Maven +Bills of Materials. Therefore, you will have to add the submodule directly. Make sure the module +versions are aligned in case you are using more than one authentication module in order to prevent +transitive dependency conflicts. If you are using SBT, add this to your dependencies [//]: # ({x-version-update-start:google-auth-library-oauth2-http:released}) ```Scala -libraryDependencies += "com.google.auth" % "google-auth-library-oauth2-http" % "1.19.0" +// Replace this with the implementation module that suits your needs +libraryDependencies += "com.google.auth" % "google-auth-library-oauth2-http" % "1.30.1" ``` [//]: # ({x-version-update-end}) From d9e9ef26b3c7dd1d557fcab10ecef1e6c67f65bf Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Fri, 17 Jan 2025 14:57:53 -0500 Subject: [PATCH 2/6] Update README.md Co-authored-by: Lawrence Qiu --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f4e254bac..8bf49d258 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ If you are using Maven, add this to your pom.xml file (notice that you can repla com.google.auth - + google-auth-library-oauth2-http ``` From a6adb90de788d4b7402ccf12374d9c7c5c39b7c6 Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Fri, 17 Jan 2025 14:57:59 -0500 Subject: [PATCH 3/6] Update README.md Co-authored-by: Lawrence Qiu --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8bf49d258..b52e28936 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ If you are using Gradle, add this to your dependencies dependencies { // The BOM will manage the module versions and transitive dependencies implementation platform('com.google.auth:google-auth-library-bom:1.30.1') - // Replace this with the implementation module that suits your needs + // Replace with the module(s) that are needed implementation 'com.google.auth:google-auth-library-oauth2-http' } From ea53f06fe6dd8a7bc64fbee66c7e936ff0b1d320 Mon Sep 17 00:00:00 2001 From: Diego Alonso Marquez Palacios Date: Fri, 17 Jan 2025 15:12:36 -0500 Subject: [PATCH 4/6] add instructions for libraries-bom --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index f4e254bac..f072909e6 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,29 @@ credentials as well as utility methods to create them and to get Application Def ## Quickstart +### Alternative: using `java-libraries-bom` +If your use case is to enable authentication for a GAPIC library such as `google-cloud-datastore`, +you may want simply add `libraries-bom`, which automatically imports the auth bom, to your pom.xml +as follows: + +[//]: # ({x-version-update-start:google-auth-library-bom:released}) +```xml + + + + com.google.cloud + libraries-bom + 26.53.0 + pom + import + + + +``` + +Otherwise, if you don't plan using libraries-bom, see the next section on +_Google Auth Library Bill of Materials_. + ### Using Maven #### Google Auth Library Bill of Materials From 77655f1f68a85432e2f4daaf462feffd601b9c2b Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Mon, 20 Jan 2025 11:05:27 -0500 Subject: [PATCH 5/6] Update README.md Co-authored-by: Lawrence Qiu --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d823204b6..13cc078e7 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ If you are using Maven, add this to your pom.xml file (notice that you can repla ```xml com.google.auth - + google-auth-library-oauth2-http From 121ee1384ae788301ca9d6e8b67f3636728751e1 Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Mon, 20 Jan 2025 11:06:10 -0500 Subject: [PATCH 6/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 13cc078e7..1be9d85fa 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ credentials as well as utility methods to create them and to get Application Def ## Quickstart -### Alternative: using `java-libraries-bom` +### Preferred method: using `java-libraries-bom` If your use case is to enable authentication for a GAPIC library such as `google-cloud-datastore`, you may want simply add `libraries-bom`, which automatically imports the auth bom, to your pom.xml as follows: