Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on May 8, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions 25 samples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# How to run the samples

1. Clone this repo and navigate to the `snippets` directory.
```shell
git clone https://github.com/googlepis/java-pubsub
cd java-pubsub/samples/snippets
```

1. [Obtain GCP user access credentials] via a web flow for your application.
```shell
gcloud auth application-default login
```

1. With [Maven] installed, run a sample that has the to-do section completed:
```shell
mvn clean compile exec:java -Dexec.mainClass=pubsub.CreateTopicExample
```

1. To run the samples test:
```shell
mvn -Dtest=pubsub.AdminIT test
```

[Maven]: https://maven.apache.org/
[Obtain GCP user access credentials]: https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login
Morty Proxy This is a proxified and sanitized view of the page, visit original site.