Skip to content

Commit

Permalink
First look for AE's project id, then GOOGLE_APPLICATION_CREDENTIALS'
Browse files Browse the repository at this point in the history
  • Loading branch information
mziccard committed Apr 4, 2016
1 parent 3be6174 commit cf6ac54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ Most `gcloud-java` libraries require a project ID. There are multiple ways to s

1. Project ID supplied when building the service options
2. Project ID specified by the environment variable `GCLOUD_PROJECT`
3. Project ID specified in the JSON credentials file pointed by the `GOOGLE_APPLICATION_CREDENTIALS` environment variable
4. App Engine project ID
3. App Engine project ID
4. Project ID specified in the JSON credentials file pointed by the `GOOGLE_APPLICATION_CREDENTIALS` environment variable
5. Google Cloud SDK project ID
6. Compute Engine project ID

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,10 @@ protected String defaultHost() {
protected String defaultProject() {
String projectId = System.getProperty(PROJECT_ENV_NAME, System.getenv(PROJECT_ENV_NAME));
if (projectId == null) {
projectId = serviceAccountProjectId();
projectId = appEngineProjectId();
}
if (projectId == null) {
projectId = appEngineProjectId();
projectId = serviceAccountProjectId();
}
return projectId != null ? projectId : googleCloudProjectId();
}
Expand Down

0 comments on commit cf6ac54

Please sign in to comment.