Skip to content

Commit 43c709a

Browse files
authored
chore: README template fix in google-cloud-java (#1785)
1 parent 647beb9 commit 43c709a

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

synthtool/gcp/templates/java_library/README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,35 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
3434
{{ metadata['snippets'][metadata['repo']['api_shortname'] + '_install_with_bom'] }}
3535
```
3636

37-
If you are using Maven without BOM, add this to your dependencies:
37+
If you are using Maven without the BOM, add this to your dependencies:
38+
{% elif monorepo %}
39+
If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
40+
41+
```xml
42+
<dependencyManagement>
43+
<dependencies>
44+
<dependency>
45+
<groupId>com.google.cloud</groupId>
46+
<artifactId>libraries-bom</artifactId>
47+
<version>{{ metadata['latest_bom_version'] }}</version>
48+
<type>pom</type>
49+
<scope>import</scope>
50+
</dependency>
51+
</dependencies>
52+
</dependencyManagement>
53+
54+
<dependencies>
55+
<dependency>
56+
<groupId>{{ group_id }}</groupId>
57+
<artifactId>{{ artifact_id }}</artifactId>
58+
</dependency>
59+
```
60+
61+
If you are using Maven without the BOM, add this to your dependencies:
3862
{% else %}
3963
If you are using Maven, add this to your pom.xml file:
40-
<!-- {x-version-update-start:{{ artifact_id }}:released} -->
4164
{% endif %}
65+
<!-- {x-version-update-start:{{ artifact_id }}:released} -->
4266

4367
```xml
4468
{% if 'snippets' in metadata and metadata['snippets'][metadata['repo']['api_shortname'] + '_install_without_bom'] -%}
@@ -248,7 +272,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
248272
[developer-console]: https://console.developers.google.com/
249273
[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects
250274
[cloud-cli]: https://cloud.google.com/cli
251-
[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting
275+
[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md
252276
[contributing]: https://github.com/{{metadata['repo']['repo']}}/blob/main/CONTRIBUTING.md
253277
[code-of-conduct]: https://github.com/{{metadata['repo']['repo']}}/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct
254278
[license]: https://github.com/{{metadata['repo']['repo']}}/blob/main/LICENSE

synthtool/languages/java.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ def common_templates(
490490
# Generate flat to tell this repository is a split repo that have migrated
491491
# to monorepo. The owlbot.py in the monorepo sets monorepo=True.
492492
monorepo = kwargs.get("monorepo", False)
493+
kwargs["monorepo"] = monorepo
493494
split_repo = not monorepo
494495
repo_metadata = metadata["repo"]
495496
repo_short = repo_metadata["repo_short"]

0 commit comments

Comments
 (0)