Skip to content

Commit

Permalink
chore(java): skip bom install instructions if there's no snippet (#494)
Browse files Browse the repository at this point in the history
* chore(java): skip bom install instructions if there's no snippet

Moving forward, new clients won't be added to the google-cloud-bom until
they are stable. Thus, we should not add the default libraries-bom
install instructions if there's no bom install snippet.

* chore: fix formatting to avoid churn
  • Loading branch information
chingor13 authored Apr 17, 2020
1 parent 6980131 commit 5ff2afc
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions synthtool/gcp/templates/java_library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,16 @@ Java idiomatic client for [{{metadata['repo']['name_pretty']}}][product-docs].
{% endif %}
## Quickstart

{% if 'snippets' in metadata and metadata['snippets'][metadata['repo']['name'] + '_install_with_bom'] -%}
If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
```xml
{% if 'snippets' in metadata and metadata['snippets'][metadata['repo']['name'] + '_install_with_bom'] -%}
{{ metadata['snippets'][metadata['repo']['name'] + '_install_with_bom'] }}
{% else -%}
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>{{ metadata['latest_bom_version'] }}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>{{ group_id }}</groupId>
<artifactId>{{ artifact_id }}</artifactId>
</dependency>
</dependencies>
{% endif -%}
```

If you are using Maven without BOM, add this to your dependencies:

{% else %}
If you are using Maven, add this to your pom.xml file:
{% endif %}
```xml
{% if 'snippets' in metadata and metadata['snippets'][metadata['repo']['name'] + '_install_without_bom'] -%}
{{ metadata['snippets'][metadata['repo']['name'] + '_install_without_bom'] }}
Expand Down

0 comments on commit 5ff2afc

Please sign in to comment.