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

mvn gcloud:deploy failing due to missing default DockerFile for java7 #70

Closed wmwong closed 8 years ago

wmwong commented 8 years ago

"mvn gcloud:run" works and I'm able to hit my website locally.

Attempting to deploy results in an error:

[INFO] Beginning deployment...
[INFO] ERROR: (gcloud.preview.app.deploy) No default Dockerfile for runtime [java7] in the SDK. Use one of the supported runtimes: [python|nodejs|python-compat|java|go|python27|java7].
[ERROR] Error: gcloud app command with exit code : 1

gcloud version: 91.0.0 gcloud-maven-plugin: 2.0.9.90.v20151210

wmwong commented 8 years ago

Saw that there was a new version of gcloud. After updating to gcloud version 91.0.1, "mvn gcloud:run" fails.

Beginning interaction for module default...
0% Generated git repository information file.
Success.
Temporary staging for module default directory left in /usr/local/google/home/wesleywong/Documents/samples/examples/java/bookstore/target/appengine-staging
[INFO] Running python -S /usr/local/google/home/wesleywong/google-cloud-sdk/platform/google_appengine/dev_appserver.py --skip_sdk_update_check=true -A app /usr/local/google/home/wesleywong/Documents/samples/examples/java/bookstore/target/bookstore-1.0-SNAPSHOT/app.yaml
[INFO] INFO     2015-12-29 19:18:55,315 application_configuration.py:431] No version specified. Generated version id: 20151229t191855
[INFO] INFO     2015-12-29 19:18:55,315 devappserver2.py:769] Skipping SDK update check.
[INFO] INFO     2015-12-29 19:18:55,337 api_server.py:205] Starting API server at: http://localhost:35276
[INFO] INFO     2015-12-29 19:18:55,337 api_server.py:648] Applying all pending transactions and saving the datastore
[INFO] INFO     2015-12-29 19:18:55,337 api_server.py:651] Saving search indexes
[INFO] Traceback (most recent call last):
[INFO]   File "/usr/local/google/home/wesleywong/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 83, in <module>
[INFO]     _run_file(__file__, globals())
[INFO]   File "/usr/local/google/home/wesleywong/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 79, in _run_file
[INFO]     execfile(_PATHS.script_file(script_name), globals_)
[INFO]   File "/usr/local/google/home/wesleywong/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 1040, in <module>
[INFO]     main()
[INFO]   File "/usr/local/google/home/wesleywong/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 1033, in main
[INFO]     dev_server.start(options)
[INFO]   File "/usr/local/google/home/wesleywong/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 824, in start
[INFO]     self._dispatcher.start(options.api_host, apis.port, request_data)
[INFO]   File "/usr/local/google/home/wesleywong/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 193, in start
[INFO]     _module, port = self._create_module(module_configuration, port)
[INFO]   File "/usr/local/google/home/wesleywong/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 278, in _create_module
[INFO]     threadsafe_override=threadsafe_override)
[INFO]   File "/usr/local/google/home/wesleywong/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 1516, in __init__
[INFO]     super(ManualScalingModule, self).__init__(**kwargs)
[INFO]   File "/usr/local/google/home/wesleywong/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 537, in __init__
[INFO]     self._module_configuration)
[INFO]   File "/usr/local/google/home/wesleywong/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 234, in _create_instance_factory
[INFO]     module_configuration=module_configuration)
[INFO]   File "/usr/local/google/home/wesleywong/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/java_runtime.py", line 72, in __init__
[INFO]     self._java_command = self._make_java_command()
[INFO]   File "/usr/local/google/home/wesleywong/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/java_runtime.py", line 93, in _make_java_command
[INFO]     assert os.path.isdir(java_lib_dir), java_lib_dir
[INFO] AssertionError: /usr/local/google/home/wesleywong/google-cloud-sdk/platform/google_appengine/google/appengine/tools/java/lib
Exception in thread "standard-out-redirection-devappserver" [ERROR] Error: gcloud app command with exit code : 1
[ERROR]
java.lang.RuntimeException: The Java Dev Server has stopped.
org.apache.maven.plugin.MojoExecutionException: Error: gcloud app command exit code is: 1
        at com.google.appengine.gcloudapp.AbstractGcloudMojo$1.run(AbstractGcloudMojo.java:346)
        at com.google.appengine.gcloudapp.AbstractGcloudMojo.startCommand(AbstractGcloudMojo.java:380)
        at com.google.appengine.gcloudapp.GCloudAppRun.execute(GCloudAppRun.java:302)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
ludoch commented 8 years ago

I cannot reproduce the issue with mvn gcloud:deploy

Can you share more info? (i.e do you have a dockerfile? what is the content of appengine-web.xml and the pom configuration for gcloud) Can you try first mvn clean?

ludoch commented 8 years ago

Can you send the output of gcloud components list

as well?

wmwong commented 8 years ago

I tried the following:

mvn clean
mvn gcloud:run

I'm still getting the same failure.

I don't have a Dockerfile.

appengine-web.xml

    <appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
        <threadsafe>true</threadsafe>
        <vm>true</vm>
        <manual-scaling>
            <instances>1</instances>
        </manual-scaling>
        <resources>
          <cpu>.5</cpu>
          <memory-gb>1.3</memory-gb>
          <disk-size-gb>10</disk-size-gb>
        </resources>
        <sessions-enabled>true</sessions-enabled>
        <precompilation-enabled>false</precompilation-enabled>
        <system-properties>
            <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
        </system-properties>
        <health-check>
          <!-- Disable health checking -->
          <enable-health-check>false</enable-health-check>
        </health-check>
        <static-files>
          <include path="/*.json" />
          <include path="/api-docs">
            <http-header name="Content-Type" value="application/json" />
          </include>
        </static-files>
    </appengine-web-app>

pom.xml

<build>
  <!-- Setting the output directory this way enables deploy-on-save integration. -->
  <outputDirectory>target/${project.artifactId}-${project.version}/WEB-INF/classes</outputDirectory>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <version>3.1</version>
      <artifactId>maven-compiler-plugin</artifactId>
      <configuration>
        <source>1.7</source>
        <target>1.7</target>
        <compilerArgs>
          <arg>-Xlint:all</arg>
        </compilerArgs>
      </configuration>
    </plugin>

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-war-plugin</artifactId>
      <version>2.6</version>
      <configuration>
        <archiveClasses>true</archiveClasses>
        <webResources>
          <!-- For interpolating version from pom into appengine-web.xml -->
          <resource>
            <directory>${basedir}/src/main/webapp/WEB-INF</directory>
            <filtering>true</filtering>
            <targetPath>WEB-INF</targetPath>
          </resource>
        </webResources>
      </configuration>
    </plugin>

    <plugin>
      <groupId>com.google.appengine</groupId>
      <artifactId>gcloud-maven-plugin</artifactId>
      <version>2.0.9.90.v20151210</version>
    </plugin>
  </plugins>
</build>

Output of gcloud components list:

    Your current Cloud SDK version is: 91.0.1
    The latest available version is: 91.0.1

    ┌─────────────────────────────────────────────────────────────────────────────────┐
    │                                    Components                                   │
    ├───────────────┬─────────────────────────────────┬───────────────────┬───────────┤
    │     Status    │               Name              │         ID        │    Size   │
    ├───────────────┼─────────────────────────────────┼───────────────────┼───────────┤
    │ Not Installed │ Cloud Datastore Emulator        │ gcd-emulator      │  38.1 MiB │
    │ Not Installed │ Cloud Pub/Sub Emulator          │ pubsub-emulator   │   9.8 MiB │
    │ Not Installed │ gcloud Beta Commands            │ beta              │   < 1 MiB │
    │ Not Installed │ gcloud app Java Extensions      │ app-engine-java   │ 101.1 MiB │
    │ Not Installed │ kubectl                         │ kubectl           │           │
    │ Installed     │ BigQuery Command Line Tool      │ bq                │   < 1 MiB │
    │ Installed     │ Cloud SDK Core Libraries        │ core              │   3.1 MiB │
    │ Installed     │ Cloud Storage Command Line Tool │ gsutil            │   2.6 MiB │
    │ Installed     │ Default set of gcloud commands  │ gcloud            │   < 1 MiB │
    │ Installed     │ gcloud Alpha Commands           │ alpha             │   < 1 MiB │
    │ Installed     │ gcloud app Python Extensions    │ app-engine-python │   7.2 MiB │
    └───────────────┴─────────────────────────────────┴───────────────────┴───────────┘
ludoch commented 8 years ago

component app-engine-java does not seem to be installed.

On Wed, Dec 30, 2015 at 2:36 PM, Wesley Wong notifications@github.com wrote:

I tried the following:

mvn clean mvn gcloud:run

I'm still getting the same failure.

I don't have a Dockerfile.

appengine-web.xml

<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <threadsafe>true</threadsafe>
    <vm>true</vm>
    <manual-scaling>
        <instances>1</instances>
    </manual-scaling>
    <resources>
      <cpu>.5</cpu>
      <memory-gb>1.3</memory-gb>
      <disk-size-gb>10</disk-size-gb>
    </resources>
    <sessions-enabled>true</sessions-enabled>
    <precompilation-enabled>false</precompilation-enabled>
    <system-properties>
        <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
    </system-properties>
    <health-check>
      <!-- Disable health checking -->
      <enable-health-check>false</enable-health-check>
    </health-check>
    <static-files>
      <include path="/*.json" />
      <include path="/api-docs">
        <http-header name="Content-Type" value="application/json" />
      </include>
    </static-files>
</appengine-web-app>

pom.xml

target/${project.artifactId}-${project.version}/WEB-INF/classes org.apache.maven.plugins 3.1 maven-compiler-plugin 1.7 1.7 -Xlint:all ``` org.apache.maven.plugins maven-war-plugin 2.6 true ${basedir}/src/main/webapp/WEB-INF true WEB-INF com.google.appengine gcloud-maven-plugin 2.0.9.90.v20151210 ```

Output of gcloud components list:

Your current Cloud SDK version is: 91.0.1
The latest available version is: 91.0.1

┌─────────────────────────────────────────────────────────────────────────────────┐
│                                    Components                                   │
├───────────────┬─────────────────────────────────┬───────────────────┬───────────┤
│     Status    │               Name              │         ID        │    Size   │
├───────────────┼─────────────────────────────────┼───────────────────┼───────────┤
│ Not Installed │ Cloud Datastore Emulator        │ gcd-emulator      │  38.1 MiB │
│ Not Installed │ Cloud Pub/Sub Emulator          │ pubsub-emulator   │   9.8 MiB │
│ Not Installed │ gcloud Beta Commands            │ beta              │   < 1 MiB │
│ Not Installed │ gcloud app Java Extensions      │ app-engine-java   │ 101.1 MiB │
│ Not Installed │ kubectl                         │ kubectl           │           │
│ Installed     │ BigQuery Command Line Tool      │ bq                │   < 1 MiB │
│ Installed     │ Cloud SDK Core Libraries        │ core              │   3.1 MiB │
│ Installed     │ Cloud Storage Command Line Tool │ gsutil            │   2.6 MiB │
│ Installed     │ Default set of gcloud commands  │ gcloud            │   < 1 MiB │
│ Installed     │ gcloud Alpha Commands           │ alpha             │   < 1 MiB │
│ Installed     │ gcloud app Python Extensions    │ app-engine-python │   7.2 MiB │
└───────────────┴─────────────────────────────────┴───────────────────┴───────────┘

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

wmwong commented 8 years ago

That has fixed "mvn gcloud:run". In order to upgrade my gcloud earlier, I had to re-install it and I forgot to re-install app-engine-java. The error message was cryptic and it did not prompt me to install the component either.

However, "mvn gcloud:deploy" is still failing, but with a different error now:

[INFO] ERROR: (gcloud.preview.app.deploy) We were unable to detect the runtime to use for this application. Please specify the [runtime] field in your application yaml file or check that your application is configured correctly.

I looked into target/appengine-staging/app.yaml and it has

runtime: java7
ludoch commented 8 years ago

Works for me, do not know what is going on...

Cloud you try to clone https://github.com/GoogleCloudPlatform/appengine-java-vm-guestbook-extras cd stage1 replace the correct newer version plugin in the pom and mvn gcloud:deploy ?

On Wed, Dec 30, 2015 at 3:29 PM, Wesley Wong notifications@github.com wrote:

That has fixed "mvn gcloud:run". In order to upgrade my gcloud earlier, I had to re-install it and I forgot to re-install app-engine-java. The error message was cryptic and it did not prompt me to install the component either.

However, "mvn gcloud:deploy" is still failing, but with a different error now:

[INFO] ERROR: (gcloud.preview.app.deploy) We were unable to detect the runtime to use for this application. Please specify the [runtime] field in your application yaml file or check that your application is configured correctly.

I looked into target/appengine-staging/app.yaml and it has

runtime: java7

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

wmwong commented 8 years ago

I am getting the same error:

[INFO] ERROR: (gcloud.preview.app.deploy) We were unable to detect the runtime to use for this application. Please specify the [runtime] field in your application yaml file or check that your application is configured correctly. 
tswast commented 8 years ago

I ran into this today, too. I'm using the latest version of gcloud and the following version of the maven plugin.

  <plugin>
    <groupId>com.google.appengine</groupId>
    <artifactId>gcloud-maven-plugin</artifactId>
    <version>2.0.9.90.v20151210</version>
  </plugin>

Running with mvn gcloud:run worked but mvn gcloud:deploy failed with

[INFO] ERROR: (gcloud.preview.app.deploy) We were unable to detect the runtime to use for this application. Please specify the [runtime] field in your application yaml file or check that your application is configured correctly. 

I'm still seeing it with the app-engine-java component installed.

┌─────────────────────────────────────────────────────────────────────────────────┐
│                                    Components                                   │
├───────────────┬─────────────────────────────────┬───────────────────┬───────────┤
│     Status    │               Name              │         ID        │    Size   │
├───────────────┼─────────────────────────────────┼───────────────────┼───────────┤
│ Not Installed │ Cloud Datastore Emulator        │ gcd-emulator      │  38.1 MiB │
│ Not Installed │ Cloud Pub/Sub Emulator          │ pubsub-emulator   │   9.9 MiB │
│ Not Installed │ gcloud Alpha Commands           │ alpha             │   < 1 MiB │
│ Not Installed │ gcloud Beta Commands            │ beta              │   < 1 MiB │
│ Not Installed │ kubectl                         │ kubectl           │           │
│ Installed     │ BigQuery Command Line Tool      │ bq                │   < 1 MiB │
│ Installed     │ Cloud SDK Core Libraries        │ core              │   3.1 MiB │
│ Installed     │ Cloud Storage Command Line Tool │ gsutil            │   2.6 MiB │
│ Installed     │ Default set of gcloud commands  │ gcloud            │           │
│ Installed     │ gcloud app Java Extensions      │ app-engine-java   │ 101.1 MiB │
│ Installed     │ gcloud app Python Extensions    │ app-engine-python │   7.2 MiB │
└───────────────┴─────────────────────────────────┴───────────────────┴───────────┘
ludoch commented 8 years ago

Can you attach the entire output of the maven command? I still cannot reproduce it with my project:-(

tswast commented 8 years ago

Here is my maven output:

% mvn gcloud:deploy -Dgcloud_project=java-docs-samples-swast-1
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building appidentity 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> gcloud-maven-plugin:2.0.9.90.v20151210:deploy (default-cli) > package @ appidentity >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ appidentity ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ appidentity ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ appidentity ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ appidentity ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ appidentity ---
[INFO] Surefire report directory: /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.example.appengine.appidentity.IdentityServletTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.218 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-war-plugin:2.2:war (default-war) @ appidentity ---
[INFO] Packaging webapp
[INFO] Assembling webapp [appidentity] in [/usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appidentity-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/src/main/webapp]
[INFO] Webapp assembled in [58 msecs]
[INFO] Building war: /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appidentity-1.0-SNAPSHOT.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] 
[INFO] <<< gcloud-maven-plugin:2.0.9.90.v20151210:deploy (default-cli) < package @ appidentity <<<
[INFO] 
[INFO] --- gcloud-maven-plugin:2.0.9.90.v20151210:deploy (default-cli) @ appidentity ---
[INFO] Creating staging directory in: /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appengine-staging
[INFO] Running appcfg --disable_update_check -A notused stage /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appidentity-1.0-SNAPSHOT /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appengine-staging
Reading application configuration data...

Beginning interaction for module default...
Success.
Temporary staging for module default directory left in /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appengine-staging
[INFO] Running gcloud app deploy...
[INFO] Running python -S /usr/local/google/home/swast/google-cloud-sdk/lib/gcloud.py --quiet preview app deploy /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appengine-staging/app.yaml
[INFO] You are about to deploy the following modules:
[INFO]  - java-docs-samples-swast-1/default (from [/usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appengine-staging/app.yaml])
[INFO]      Deployed URL: [https://java-docs-samples-swast-1.appspot.com]
[INFO] 
[INFO] Beginning deployment...
[INFO] 
[INFO] WARNING: Could not generate [/usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appengine-staging/source-context.json]: Found multiple Git Repositories (and no Google Cloud Repository) in the remote URLs for source directory: /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appengine-staging
[INFO] ERROR: (gcloud.preview.app.deploy) We were unable to detect the runtime to use for this application. Please specify the [runtime] field in your application yaml file or check that your application is configured correctly. 
[ERROR] Error: gcloud app command with exit code : 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:03 min
[INFO] Finished at: 2016-01-04T16:25:33-08:00
[INFO] Final Memory: 18M/480M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.appengine:gcloud-maven-plugin:2.0.9.90.v20151210:deploy (default-cli) on project appidentity: Error: gcloud app command exit code is: 1 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

If I checkout a fresh repository without my changes I get a different error.

% git clone git@github.com:GoogleCloudPlatform/java-docs-samples.git java-docs-samples-clean
% cd java-docs-samples-clean/appengine/appidentity
% mvn gcloud:deploy -Dgcloud_project=java-docs-samples-swast-1
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building appidentity 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> gcloud-maven-plugin:2.0.9.90.v20151210:deploy (default-cli) > package @ appidentity >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ appidentity ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ appidentity ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appidentity-1.0-SNAPSHOT/WEB-INF/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ appidentity ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ appidentity ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ appidentity ---
[INFO] Surefire report directory: /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.example.appengine.appidentity.IdentityServletTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.201 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-war-plugin:2.2:war (default-war) @ appidentity ---
[INFO] Packaging webapp
[INFO] Assembling webapp [appidentity] in [/usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appidentity-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/src/main/webapp]
[INFO] Webapp assembled in [36 msecs]
[INFO] Building war: /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appidentity-1.0-SNAPSHOT.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] 
[INFO] <<< gcloud-maven-plugin:2.0.9.90.v20151210:deploy (default-cli) < package @ appidentity <<<
[INFO] 
[INFO] --- gcloud-maven-plugin:2.0.9.90.v20151210:deploy (default-cli) @ appidentity ---
[INFO] Creating staging directory in: /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appengine-staging
2016/01/04 16:35:31
[INFO] Running appcfg --disable_update_check -A notused stage /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appidentity-1.0-SNAPSHOT /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appengine-staging
Reading application configuration data...

Beginning interaction for module default...
0% Generated git repository information file.
Success.
Temporary staging for module default directory left in /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appengine-staging
[INFO] Running gcloud app deploy...
[INFO] Running python -S /usr/local/google/home/swast/google-cloud-sdk/lib/gcloud.py --quiet preview app deploy /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appengine-staging/app.yaml
[INFO] ERROR: (gcloud.preview.app.deploy) An error occurred while parsing file: [/usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appengine-staging/app.yaml]
[INFO] Bad repository URI: git@github.com:GoogleCloudPlatform/java-docs-samples.git
[INFO]   in "/usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appengine-staging/app.yaml", line 19, column 1 
[ERROR] Error: gcloud app command with exit code : 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 43.520 s
[INFO] Finished at: 2016-01-04T16:35:32-08:00
[INFO] Final Memory: 18M/480M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.appengine:gcloud-maven-plugin:2.0.9.90.v20151210:deploy (default-cli) on project appidentity: Error: gcloud app command exit code is: 1 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

This same error occurs when I fall back to the previous version of gcloud, so maybe that's a separate issue?

I'm not sure what there could be about my changes that make the Java runtime not be found? The only difference in the pom.xml is I add the json.org dependency. It is used in this sample: https://cloud.google.com/appengine/docs/java/appidentity/#asserting_identity_to_other_app_engine_apps

diff --git a/appengine/appidentity/pom.xml b/appengine/appidentity/pom.xml
index 2755948..dd70ef9 100644
--- a/appengine/appidentity/pom.xml
+++ b/appengine/appidentity/pom.xml
@@ -40,6 +40,11 @@ Copyright 2015 Google Inc. All Rights Reserved.
       <type>jar</type>
       <scope>provided</scope>
     </dependency>
+    <dependency>
+      <groupId>org.json</groupId>
+      <artifactId>json</artifactId>
+      <version>20151123</version>
+    </dependency>

     <!-- Test Dependencies -->
     <dependency>

Now that I switch back to my project using the released version of gcloud and running gcloud components update, I'm able to deploy. I'll see if I can reproduce and open an issue with the gcloud team, if so.

ludoch commented 8 years ago

So it means you are using the Cloud SDK from head, and not the released one?

On Mon, Jan 4, 2016 at 4:57 PM, Tim Swast notifications@github.com wrote:

Here is my maven output:

% mvn gcloud:deploy -Dgcloud_project=java-docs-samples-swast-1 [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building appidentity 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> gcloud-maven-plugin:2.0.9.90.v20151210:deploy (default-cli) > package @ appidentity >>> [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ appidentity --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ appidentity --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ appidentity --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ appidentity --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ appidentity --- [INFO] Surefire report directory: /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/surefire-reports


T E S T S

Running com.example.appengine.appidentity.IdentityServletTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.218 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] [INFO] --- maven-war-plugin:2.2:war (default-war) @ appidentity --- [INFO] Packaging webapp [INFO] Assembling webapp [appidentity] in [/usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appidentity-1.0-SNAPSHOT] [INFO] Processing war project [INFO] Copying webapp resources [/usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/src/main/webapp] [INFO] Webapp assembled in [58 msecs] [INFO] Building war: /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appidentity-1.0-SNAPSHOT.war [INFO] WEB-INF/web.xml already added, skipping [INFO] [INFO] <<< gcloud-maven-plugin:2.0.9.90.v20151210:deploy (default-cli) < package @ appidentity <<< [INFO] [INFO] --- gcloud-maven-plugin:2.0.9.90.v20151210:deploy (default-cli) @ appidentity --- [INFO] Creating staging directory in: /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appengine-staging [INFO] Running appcfg --disable_update_check -A notused stage /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appidentity-1.0-SNAPSHOT /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appengine-staging Reading application configuration data...

Beginning interaction for module default... Success. Temporary staging for module default directory left in /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appengine-staging [INFO] Running gcloud app deploy... [INFO] Running python -S /usr/local/google/home/swast/google-cloud-sdk/lib/gcloud.py --quiet preview app deploy /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appengine-staging/app.yaml [INFO] You are about to deploy the following modules: [INFO] - java-docs-samples-swast-1/default (from [/usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appengine-staging/app.yaml]) [INFO] Deployed URL: [https://java-docs-samples-swast-1.appspot.com] [INFO] [INFO] Beginning deployment... [INFO] [INFO] WARNING: Could not generate [/usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appengine-staging/source-context.json]: Found multiple Git Repositories (and no Google Cloud Repository) in the remote URLs for source directory: /usr/local/google/home/swast/src/java-docs-samples/appengine/appidentity/target/appengine-staging [INFO] ERROR: (gcloud.preview.app.deploy) We were unable to detect the runtime to use for this application. Please specify the [runtime] field in your application yaml file or check that your application is configured correctly. [ERROR] Error: gcloud app command with exit code : 1 [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:03 min [INFO] Finished at: 2016-01-04T16:25:33-08:00 [INFO] Final Memory: 18M/480M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.google.appengine:gcloud-maven-plugin:2.0.9.90.v20151210:deploy (default-cli) on project appidentity: Error: gcloud app command exit code is: 1 -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

If I checkout a fresh repository without my changes I get a different error.

% git clone git@github.com:GoogleCloudPlatform/java-docs-samples.git java-docs-samples-clean % cd java-docs-samples-clean/appengine/appidentity % mvn gcloud:deploy -Dgcloud_project=java-docs-samples-swast-1 [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building appidentity 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> gcloud-maven-plugin:2.0.9.90.v20151210:deploy (default-cli) > package @ appidentity >>> [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ appidentity --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ appidentity --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 1 source file to /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appidentity-1.0-SNAPSHOT/WEB-INF/classes [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ appidentity --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ appidentity --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 1 source file to /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/test-classes [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ appidentity --- [INFO] Surefire report directory: /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/surefire-reports


T E S T S

Running com.example.appengine.appidentity.IdentityServletTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.201 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] [INFO] --- maven-war-plugin:2.2:war (default-war) @ appidentity --- [INFO] Packaging webapp [INFO] Assembling webapp [appidentity] in [/usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appidentity-1.0-SNAPSHOT] [INFO] Processing war project [INFO] Copying webapp resources [/usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/src/main/webapp] [INFO] Webapp assembled in [36 msecs] [INFO] Building war: /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appidentity-1.0-SNAPSHOT.war [INFO] WEB-INF/web.xml already added, skipping [INFO] [INFO] <<< gcloud-maven-plugin:2.0.9.90.v20151210:deploy (default-cli) < package @ appidentity <<< [INFO] [INFO] --- gcloud-maven-plugin:2.0.9.90.v20151210:deploy (default-cli) @ appidentity --- [INFO] Creating staging directory in: /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appengine-staging 2016/01/04 16:35:31 [INFO] Running appcfg --disable_update_check -A notused stage /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appidentity-1.0-SNAPSHOT /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appengine-staging Reading application configuration data...

Beginning interaction for module default... 0% Generated git repository information file. Success. Temporary staging for module default directory left in /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appengine-staging [INFO] Running gcloud app deploy... [INFO] Running python -S /usr/local/google/home/swast/google-cloud-sdk/lib/gcloud.py --quiet preview app deploy /usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appengine-staging/app.yaml [INFO] ERROR: (gcloud.preview.app.deploy) An error occurred while parsing file: [/usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appengine-staging/app.yaml] [INFO] Bad repository URI: git@github.com:GoogleCloudPlatform/java-docs-samples.git [INFO] in "/usr/local/google/home/swast/src/java-docs-samples-clean/appengine/appidentity/target/appengine-staging/app.yaml", line 19, column 1 [ERROR] Error: gcloud app command with exit code : 1 [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 43.520 s [INFO] Finished at: 2016-01-04T16:35:32-08:00 [INFO] Final Memory: 18M/480M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.google.appengine:gcloud-maven-plugin:2.0.9.90.v20151210:deploy (default-cli) on project appidentity: Error: gcloud app command exit code is: 1 -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

This same error occurs when I fall back to the previous version of gcloud, so maybe that's a separate issue?

I'm not sure what there could be about my changes that make the Java runtime not be found? The only difference in the pom.xml is I add the json.org dependency. It is used in this sample:

https://cloud.google.com/appengine/docs/java/appidentity/#asserting_identity_to_other_app_engine_apps

diff --git a/appengine/appidentity/pom.xml b/appengine/appidentity/pom.xml index 2755948..dd70ef9 100644 --- a/appengine/appidentity/pom.xml +++ b/appengine/appidentity/pom.xml @@ -40,6 +40,11 @@ Copyright 2015 Google Inc. All Rights Reserved.

jar
   <scope>provided</scope>
 </dependency>
  • org.json
  • json
  • 20151123

Now that I switch back to my project using the released version of gcloud and running gcloud components update, I'm able to deploy. I'll see if I can reproduce and open an issue with the gcloud team, if so.

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

tswast commented 8 years ago

Yeah, correct. There was a separate issue I was encountering with the released one where it failed when I had both and origin and upstream remote defined, which is fixed in head but wasn't in the released one yet.

ludoch commented 8 years ago

The issue is in the new Cloud SDK. Fix will be in next week. Not a maven plugin issue