From 663a974dc2a52d773deb620b0bc65f0049f63693 Mon Sep 17 00:00:00 2001 From: Gagan Gupta Date: Thu, 7 Nov 2024 12:11:52 +0530 Subject: [PATCH] docs: Update samples' README.md to ensure given (#3420) commands run samples. --- samples/README.md | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/samples/README.md b/samples/README.md index 914c455b46f..d4ad2ac7035 100644 --- a/samples/README.md +++ b/samples/README.md @@ -18,29 +18,23 @@ Install [Maven](http://maven.apache.org/). Build your project from the root directory (`java-spanner`): mvn clean package -DskipTests + cd samples/snippets + mvn package -Every subsequent command here should be run from a subdirectory (`cd samples/snippets`). +Every subsequent command here should be run from a subdirectory `samples/snippets`. -You can run a given `ClassName` via: +### Running samples - mvn exec:java -Dexec.mainClass=com.example.spanner.ClassName \ - -DpropertyName=propertyValue \ - -Dexec.args="any arguments to the app" +Usage: -### Running a simple query (using the quickstart sample) + java -jar target/spanner-snippets/spanner-google-cloud-samples.jar operation my-instance my-database - mvn exec:java -Dexec.mainClass=com.example.spanner.QuickstartSample -Dexec.args="my-instance my-database" +#### Examples -## Tutorial +Create Database: -### Running the tutorial - mvn exec:java -Dexec.mainClass=com.example.spanner.admin.archived.SpannerSample -Dexec.args=" my-instance my-database" + java -jar target/spanner-google-cloud-samples-jar-with-dependencies.jar my-instance my-database -## Tracing sample -`TracingSample.java` demonstrates how to export traces generated by client library to StackDriver and to /tracez page. +Listing database operations: -### Running the tracing sample - mvn exec:java -Dexec.mainClass=com.example.spanner.TracingSample -Dexec.args="my-instance my-database" - -## Test - mvn verify -Dspanner.test.instance= -Dspanner.sample.database= -Dspanner.quickstart.database= + java -jar target/spanner-snippets/spanner-google-cloud-samples.jar listdatabaseoperations my-instance my-database \ No newline at end of file