Skip to content

Commit dbf9c76

Browse files
kolea2dzlier-gcp
authored andcommitted
Add instructions for using the libraries-bom in dependencies. (#1778)
1 parent afb943e commit dbf9c76

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

SAMPLE_FORMAT.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,30 @@ Project should have a `pom.xml` that is readably formatted, declares a parent po
4747
</parent>
4848
```
4949

50+
When adding a dependency to a GCP client library, the [libraries-bom](https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM)
51+
should be used instead of explicitly declaring the client version. See the below example:
52+
53+
```xml
54+
<dependencyManagement>
55+
<dependencies>
56+
<dependency>
57+
<groupId>com.google.cloud</groupId>
58+
<artifactId>libraries-bom</artifactId>
59+
<version>SPECIFY_LATEST_VERSION</version>
60+
<type>pom</type>
61+
<scope>import</scope>
62+
</dependency>
63+
</dependencies>
64+
</dependencyManagement>
65+
66+
<dependencies>
67+
<dependency>
68+
<groupId>com.google.cloud</groupId>
69+
<artifactId>google-cloud-storage</artifactId>
70+
</dependency>
71+
</dependencies>
72+
```
73+
5074
### Project Configuration
5175
Use of environment variables over system properties is strongly preferred for configuration.
5276

0 commit comments

Comments
 (0)