GoogleCloudPlatform / gcloud-maven-plugin

Cloud SDK Maven Plugin for Google App Engine (Managed VMs and non Managed VMs)
Apache License 2.0
29 stars 24 forks source link

Utils getCloudSDKLocation() assumes sdk is installed in home directory #24

Closed itsjimbo closed 9 years ago

itsjimbo commented 9 years ago

Potential problem with Utils, getCloudSDKLocation() assumes that the google-cloud-sdk in in user.home, and there is no -D switch to override

gcloudDir = System.getProperty("user.home") + "/google-cloud-sdk";
[ERROR] 
org.apache.maven.plugin.MojoExecutionException: Unkown Google Cloud SDK location.
    at com.google.appengine.gcloudapp.AbstractGcloudMojo.setupInitialCommands(AbstractGcloudMojo.java:160)
    at com.google.appengine.gcloudapp.GCloudAppRun.getCommand(GCloudAppRun.java:306)
    at com.google.appengine.gcloudapp.GCloudAppRun.execute(GCloudAppRun.java:292)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)

Quick Solution (hack)

Symbolic link the directory.. in my case I installed google-cloud-sdk under /opt

j~$ mkdir -p /usr/local/share/google/
j:~$ ln -s /opt/google-cloud-sdk /usr/local/share/google/google-cloud-sdk
ludoch commented 9 years ago

The code is like: if (gcloud_directory == null) { gcloud_directory = Utils.getCloudSDKLocation(); } So you can specify your own sdk location via the the gcloud_directory config.

Doc contains: ( https://cloud.google.com/appengine/docs/java/managed-vms/maven)

To specify a non default Cloud SDK installation directory:

$ mvn gcloud:run -Dgcloud.gcloud_directory=YOUR_OWN_SPECIFIC_INSTALLATION_PATH

On Thu, Jul 23, 2015 at 1:00 AM, itsjimbo notifications@github.com wrote:

Potential problem with Utils, getCloudSDKLocation() assumes that the google-cloud-sdk in in user.home, and there is no -D switch to override

gcloudDir = System.getProperty("user.home") + "/google-cloud-sdk";

[ERROR] org.apache.maven.plugin.MojoExecutionException: Unkown Google Cloud SDK location. at com.google.appengine.gcloudapp.AbstractGcloudMojo.setupInitialCommands(AbstractGcloudMojo.java:160) at com.google.appengine.gcloudapp.GCloudAppRun.getCommand(GCloudAppRun.java:306) at com.google.appengine.gcloudapp.GCloudAppRun.execute(GCloudAppRun.java:292) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)

— Reply to this email directly or view it on GitHub https://github.com/GoogleCloudPlatform/gcloud-maven-plugin/issues/24.

itsjimbo commented 9 years ago

Thanks, missed that param (RTFM!!) sorry bout that