From f09518146fbafdc7e677a3c24f1f91c42ac89c64 Mon Sep 17 00:00:00 2001 From: Shin Fan Date: Fri, 10 Mar 2017 16:49:26 -0800 Subject: [PATCH] Update PR comment. Add README file --- APPENGINE.md | 33 +++++++++++++++++++ README.md | 2 ++ .../java/com/google/cloud/ServiceOptions.java | 3 +- 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 APPENGINE.md diff --git a/APPENGINE.md b/APPENGINE.md new file mode 100644 index 000000000000..0fa6e4e3641c --- /dev/null +++ b/APPENGINE.md @@ -0,0 +1,33 @@ +Use Google Cloud Java Client with GoogleAppEngine +================================================= + +Quickstart +---------- +This file provides extra instructions to setup Google Cloud Java client with GoogleAppEngine. +See [Quickstart](./README.md#quickstart) for Google Cloud Java common instructions. +See [Quickstart](https://cloud.google.com/appengine/docs/standard/java/quickstart) for extra GAE instructions. + +git clone https://github.com/GoogleCloudPlatform/java-docs-samples.git + +If you are using Maven, add this to your pom.xml file +```xml + + com.google.appengine + appengine-api-1.0-sdk + 1.9.50 + +``` + +If you are using Gradle, add this to your dependencies +```Groovy +compile 'com.google.appengine:appengine-api-1.0-sdk:1.9.50' +``` +If you are using SBT, add this to your dependencies +```Scala +libraryDependencies += "com.google.appengine" % "appengine-api-1.0-sdk" % "1.9.50" +``` + +To test with local dev server, run +``` +mvn appengine:devserver +``` \ No newline at end of file diff --git a/README.md b/README.md index df6e3b45a659..ebe95e0e552f 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,8 @@ If you are using SBT, add this to your dependencies libraryDependencies += "com.google.cloud" % "google-cloud" % "0.9.4-alpha" ``` +For GoogleAppEngine use case, see [more instructions here](./APPENGINE.md). + Example Applications -------------------- diff --git a/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java b/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java index 7b4968271d24..6113271a37b4 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java +++ b/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java @@ -397,7 +397,8 @@ protected static String getAppEngineProjectId() { } catch (Exception exception) { if (System.getProperty("com.google.appengine.runtime.version") != null) { // Could not resolve appengine classes under GAE environment. - throw new RuntimeException("Unable to resolve appengine classes. Missing dependency."); + throw new RuntimeException("Unable to resolve appengine-sdk classes. For more details see " + + "https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/APPENGINE.md"); } return null; }