@@ -55,35 +55,92 @@ information, refer to [documentation](https://cloud.google.com/docs/authenticati
5555
5656## Quickstart
5757
58+ ### Preferred method: using ` java-libraries-bom `
59+ If your use case is to enable authentication for a GAPIC library such as ` google-cloud-datastore ` ,
60+ you may want simply add ` libraries-bom ` , which automatically imports the auth bom, to your pom.xml
61+ as follows:
62+
63+ [ // ] : # ( {x-version-update-start:google-auth-library-bom:released} )
64+ ``` xml
65+ <dependencyManagement >
66+ <dependencies >
67+ <dependency >
68+ <groupId >com.google.cloud</groupId >
69+ <artifactId >libraries-bom</artifactId >
70+ <version >26.53.0</version >
71+ <type >pom</type >
72+ <scope >import</scope >
73+ </dependency >
74+ </dependencies >
75+ </dependencyManagement >
76+ ```
77+
78+ Otherwise, if you don't plan using libraries-bom, see the next section on
79+ _ Google Auth Library Bill of Materials_ .
80+
81+ ### Using Maven
82+
83+ #### Google Auth Library Bill of Materials
84+ In order to ensure transitive dependencies and the modules themselves are aligned with each other,
85+ we rely on the Google Auth Library Bill of Materials. Please add this to your dependency management
86+ section as follows:
87+
88+ [ // ] : # ( {x-version-update-start:google-auth-library-bom:released} )
89+ ``` xml
90+ <dependencyManagement >
91+ <dependencies >
92+ <dependency >
93+ <groupId >com.google.auth</groupId >
94+ <artifactId >google-auth-library-bom</artifactId >
95+ <version >1.30.1</version >
96+ <type >pom</type >
97+ <scope >import</scope >
98+ </dependency >
99+ </dependencies >
100+ </dependencyManagement >
101+ ```
102+ [ // ] : # ( {x-version-update-end} )
103+
104+ #### Choosing your implementation
105+
58106If you are using Maven, add this to your pom.xml file (notice that you can replace
59107` google-auth-library-oauth2-http ` with any of ` google-auth-library-credentials ` and
60108` google-auth-library-appengine ` , depending on your application needs):
61109
62- [ // ] : # ( {x-version-update-start:google-auth-library-oauth2-http:released} )
63-
64110``` xml
65111<dependency >
66112 <groupId >com.google.auth</groupId >
113+ <!-- Let the BOM manage the module and dependency versions -->
114+ <!-- Replace with the module(s) that are needed -->
67115 <artifactId >google-auth-library-oauth2-http</artifactId >
68- <version >1.19.0</version >
69116</dependency >
70117```
71- [ // ] : # ( {x-version-update-end} )
72-
73118
119+ ### Using Gradle
74120If you are using Gradle, add this to your dependencies
75121
76- [ // ] : # ( {x-version-update-start:google-auth-library-oauth2-http :released} )
122+ [ // ] : # ( {x-version-update-start:google-auth-library-bom :released} )
77123``` Groovy
78- implementation 'com.google.auth:google-auth-library-oauth2-http:1.19.0'
124+ dependencies {
125+ // The BOM will manage the module versions and transitive dependencies
126+ implementation platform('com.google.auth:google-auth-library-bom:1.30.1')
127+ // Replace with the module(s) that are needed
128+ implementation 'com.google.auth:google-auth-library-oauth2-http'
129+ }
130+
79131```
80132[ // ] : # ( {x-version-update-end} )
81133
134+ Unfortunately, SBT [ cannot] ( https://github.com/sbt/sbt/issues/4531 ) manage dependencies via Maven
135+ Bills of Materials. Therefore, you will have to add the submodule directly. Make sure the module
136+ versions are aligned in case you are using more than one authentication module in order to prevent
137+ transitive dependency conflicts.
82138If you are using SBT, add this to your dependencies
83139
84140[ // ] : # ( {x-version-update-start:google-auth-library-oauth2-http:released} )
85141``` Scala
86- libraryDependencies += " com.google.auth" % " google-auth-library-oauth2-http" % " 1.19.0"
142+ // Replace this with the implementation module that suits your needs
143+ libraryDependencies += " com.google.auth" % " google-auth-library-oauth2-http" % " 1.30.1"
87144```
88145[ // ] : # ( {x-version-update-end} )
89146
0 commit comments