diff --git a/gcloud-java-examples/README.md b/gcloud-java-examples/README.md index 6a2903eb2e9b..57a35d7ef9d5 100644 --- a/gcloud-java-examples/README.md +++ b/gcloud-java-examples/README.md @@ -33,7 +33,7 @@ libraryDependencies += "com.google.cloud" % "gcloud-java-examples" % "0.2.4" To run examples from your command line: -1. Login using gcloud SDK (`gcloud auth login` in command line) +1. Log in using gcloud SDK (`gcloud auth login` in command line) 2. Set your current project using `gcloud config set project PROJECT_ID`. This step is not necessary for `ResourceManagerExample`. diff --git a/gcloud-java-examples/src/main/java/com/google/cloud/examples/bigquery/BigQueryExample.java b/gcloud-java-examples/src/main/java/com/google/cloud/examples/bigquery/BigQueryExample.java index 3ac1335cca7a..3dc14f13a07c 100644 --- a/gcloud-java-examples/src/main/java/com/google/cloud/examples/bigquery/BigQueryExample.java +++ b/gcloud-java-examples/src/main/java/com/google/cloud/examples/bigquery/BigQueryExample.java @@ -60,11 +60,12 @@ * *
Steps needed for running the example: *
{@code mvn exec:java -Dexec.mainClass="com.google.cloud.examples.bigquery.BigQueryExample" - * -Dexec.args="[] + * - log in using gcloud SDK - {@code gcloud auth login}.
+ *- compile using maven - {@code cd gcloud-java-examples; + * mvn package appassembler:assemble -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true} + *
+ *- run - + *
{@code target/appassembler/bin/BigQueryExample [] * list datasets | * list tables | * list jobs | diff --git a/gcloud-java-examples/src/main/java/com/google/cloud/examples/datastore/DatastoreExample.java b/gcloud-java-examples/src/main/java/com/google/cloud/examples/datastore/DatastoreExample.java index 4b83f04e7165..15381ab05ba3 100644 --- a/gcloud-java-examples/src/main/java/com/google/cloud/examples/datastore/DatastoreExample.java +++ b/gcloud-java-examples/src/main/java/com/google/cloud/examples/datastore/DatastoreExample.java @@ -43,15 +43,11 @@ * * Steps needed for running the example:
*
* *- login using gcloud SDK - {@code gcloud auth login}.
- *- compile using maven - {@code mvn compile}
- *- run using maven - - *
{@code mvn exec:java -Dexec.mainClass="com.google.cloud.examples.datastore.DatastoreExample" - * -Dexec.args="+ *- * delete | - * display | - * add | - * set } - compile using maven - {@code cd gcloud-java-examples; + * mvn package appassembler:assemble -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true} *
+ *- run - {@code target/appassembler/bin/DatastoreExample + * [projectId] [user] [delete|display|add comment|set
*]} If no action is provided {@code display} is executed. diff --git a/gcloud-java-examples/src/main/java/com/google/cloud/examples/nio/Stat.java b/gcloud-java-examples/src/main/java/com/google/cloud/examples/nio/Stat.java index 39b4df39e89c..ee9c4387a71a 100644 --- a/gcloud-java-examples/src/main/java/com/google/cloud/examples/nio/Stat.java +++ b/gcloud-java-examples/src/main/java/com/google/cloud/examples/nio/Stat.java @@ -19,7 +19,8 @@ * or you can directly pass in a GCS file name to use. In that case you have to * be logged in (using e.g. the gcloud auth command). * - *
See the README for a command line to run this example. + *
See the README for compilation instructions. Run this code with + * {@code target/appassembler/bin/Stat --help | --check | --list |
} * * In short, this version (in gcloud-java-examples) is in a package that lists gcloud-java-nio * as a dependency, so it will work directly without having to do any special work. diff --git a/gcloud-java-examples/src/main/java/com/google/cloud/examples/resourcemanager/ResourceManagerExample.java b/gcloud-java-examples/src/main/java/com/google/cloud/examples/resourcemanager/ResourceManagerExample.java index fd2eb3ed6d91..57dc81f44e50 100644 --- a/gcloud-java-examples/src/main/java/com/google/cloud/examples/resourcemanager/ResourceManagerExample.java +++ b/gcloud-java-examples/src/main/java/com/google/cloud/examples/resourcemanager/ResourceManagerExample.java @@ -32,12 +32,13 @@ * *
This example creates, deletes, gets, and lists projects. * - *
Steps needed for running the example:
- *
- login using gcloud SDK - {@code gcloud auth login}.
- *- compile using maven - {@code mvn compile}
- *- run using maven - {@code mvn exec:java - * -Dexec.mainClass="com.google.cloud.examples.resourcemanager.ResourceManagerExample" - * -Dexec.args="[list | [create | delete | get] projectId]"}
+ *Steps needed for running the example:
+ *
*/ public class ResourceManagerExample { diff --git a/gcloud-java-examples/src/main/java/com/google/cloud/examples/storage/StorageExample.java b/gcloud-java-examples/src/main/java/com/google/cloud/examples/storage/StorageExample.java index d8273e65797d..aea9dffd3f6b 100644 --- a/gcloud-java-examples/src/main/java/com/google/cloud/examples/storage/StorageExample.java +++ b/gcloud-java-examples/src/main/java/com/google/cloud/examples/storage/StorageExample.java @@ -66,11 +66,12 @@ * *- log in using gcloud SDK - {@code gcloud auth login}.
+ *- compile using maven - {@code cd gcloud-java-examples; + * mvn package appassembler:assemble -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true} + *
+ *- run - {@code target/appassembler/bin/ResourceManagerExample + * [list | [create | delete | get] projectId]}
*Steps needed for running the example: *
- *
- login using gcloud SDK - {@code gcloud auth login}.
- *- compile using maven - {@code mvn compile}
- *- run using maven - - *
{@code mvn exec:java -Dexec.mainClass="com.google.cloud.examples.storage.StorageExample" - * -Dexec.args="[] + * - log in using gcloud SDK - {@code gcloud auth login}.
+ *- compile using maven - {@code cd gcloud-java-examples; + * mvn package appassembler:assemble -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true} + *
+ *- run - + *
{@code target/appassembler/bin/StorageExample [] * list [ ] | * info [ [ ]] | * download [local_file] |