Git Product home page Git Product logo

gradle-appengine-plugin's Introduction

project status image
NOTE: All App Engine users are encouraged to transition to the new gradle plugin for their projects. Android Studio users can migrate their projects using migration guide.

Google Cloud Platform Logo

Gradle App Engine plugin Build Status

The plugin provides tasks for uploading, downloading, running and managing Google App Engine (App Engine) projects in any given Gradle build.

Usage

To use the App Engine plugin, include in your build script:

apply plugin: 'appengine'

The plugin JAR needs to be defined in the classpath of your build script. It is directly available on Maven Central. Alternatively, you can download it from GitHub and deploy it to your local repository. The following code snippet shows an example on how to retrieve it from Maven Central:

buildscript {
  repositories {
    mavenCentral()
  }

  dependencies {
    classpath 'com.google.appengine:gradle-appengine-plugin:1.9.59'
  }
}

Note: The plugin requires you to set the environment variable APPENGINE_HOME or the system property appengine.sdk.root pointing to your current Google App Engine SDK installation. In case you have both variables set the system property takes precedence over the environment variable. Alternatively, you can choose to automatically download the SDK by setting the convention property downloadSdk to true. This option requires you to specify the SDK version you want to use by setting the configuration appengineSdk.

dependencies {
  appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.59'
}

Tasks

The App Engine plugin defines the following tasks:

  • appengineConfigureBackends: Dynamically updates settings in backends.xml without having to stop the backend. The setting is defined by the project property setting.
  • appengineCronInfo: Verifies and prints the scheduled task (cron) configuration.
  • appengineDeleteBackend: Deletes the indicated backend. The backend is defined by the project property backend.
  • appengineDownloadApp: Retrieves the most current version of your application.
  • appengineDownloadSdk: Downloads and sets Google App Engine SDK.
  • appengineEndpointsGetClientLibs: Download Endpoints client libraries. (this makes network calls)
  • appengineEndpointsGetDiscoveryDocs: Download Endpoints discovery docs, you should run appengineExplodeApp with this to ensure the discovery docs are copied into the project after download. (this makes network calls)
  • appengineEndpointsInstallClientLibraries: Install client libraries to the local maven repo.
  • appengineEndpointsExportClientLibraries: Export client libraries to user-defined destination.
  • appengineEnhance: Enhances DataNucleus classes by using byte-code manipulation to make your normal Java classes "persistable". This requires you to add the necessary enhancer jars as dependencies to your project.
  • appengineExplodeApp: Extends the war/ear task to generate WAR/EAR file and explodes the artifact into build/exploded-app.
  • appengineFunctionalTest: Runs the tests from functionalTest source set against a local development server started in daemon mode.
  • appengineListBackends: Lists all the backends configured for the app specified in appengine-web.xml.
  • appengineLogs: Retrieves log data for the application running on App Engine.
  • appengineRollback: Undoes a partially completed update for the given application.
  • appengineRollbackBackend: Rolls back a backend update that was interrupted by the user or stopped due to a configuration error. The backend is defined by the project property backend.
  • appengineRun: Starts a local development server running your project code. By default the WAR file is created, exploded and used as web application directory each time you run this task. This behavior can be changed by setting the convention property warDir.
  • appengineSetDefaultVersion : Sets the default version of the given module based on appengine-web.xml.
  • appengineStartBackend: Sets the backend state to START, allowing it to receive HTTP requests. The backend is defined by the project property backend.
  • appengineStop: Stops the local development server.
  • appengineStopBackend: Sets the backend state to STOP and shuts down any running instances. The backend is defined by the project property backend.
  • appengineUpdateAllBackends: Creates or updates all backends configured in backends.xml.
  • appengineUpdateBackend: Creates or updates backend configured in backends.xml. The backend is defined by the project property backend.
  • appengineUpdateCron: Updates the schedule task (cron) configuration for the app, based on the cron.xml file.
  • appengineUpdateDispatch: Updates the dispatch configuration for the app, based on the dispatch.xml file.
  • appengineUpdateDos: Updates the DoS protection configuration for the app, based on the dos.xml file.
  • appengineUpdateIndexes: Updates datastore indexes in App Engine to include newly added indexes.
  • appengineUpdateQueues: Updates the task queue configuration (queue.xml) in App Engine.
  • appengineUpdate: Uploads files for an application given the application's root directory. The application ID and version are taken from the appengine-web.xml file.
  • appengineUpdateAll: Uploads your application to App Engine and updates all backends by running the task appengineUpdate and appengineUpdateAllBackends.
  • appengineVacuumIndexes: Deletes unused indexes in App Engine server.
  • appengineVersion: Prints detailed version information about the SDK, Java and the operating system.

Project layout

The App Engine plugin uses the same layout as the Gradle War plugin. The only difference is the addition of the functionalTest source set (located in src/functionalTest by default) which is used by the appengineFunctionalTest task.

Convention properties

The App Engine plugin defines the following convention properties in the appengine closure:

  • httpAddress: The IP address for the local development server (if server is to be accessed from network). Default is localhost.
  • httpPort: The TCP port which local development server should listen for HTTP requests on (defaults to 8080).
  • daemon: Specifies whether the local development server should run in the background. When true, this task completes as soon as the server has started. When false, this task blocks until the local development server is stopped (defaults to false).
  • Running the App Engine local development server in daemon mode requires that Gradle is also run as a daemon. The local development server will always be stopped when Gradle exits.
  • warDir: Web application directory used for local development server (defaults to build/exploded-war).
  • disableUpdateCheck: Disables the Google App Engine update check if set to true.
  • jvmFlags: The JVM flags to pass on to the local development server. The data type is a List.
  • downloadSdk: Downloads the Google App Engine SDK defined by the configuration name appengineSdk and explodes the artifact into ~/.gradle/appengine-sdk (defaults to false). If set to true the given SDK is used for running all plugin tasks which takes precedence over APPENGINE_HOME and the system property appengine.sdk.root.
  • enhancerVersion: The version (v1/v2) parameter for App Engine datanucleus enhancer task Deprecated
  • enhancerApi: The api (jdo/jpa) parameter for the App Engine datanucleas enhancer task Deprecated

Within appengine you can define optional properties in a closure named appcfg:

  • email: The email address of the Google account of an administrator for the application, for actions that require signing in. If omitted and no cookie is stored from a previous use of the command, the command will prompt for this value.
  • server: The App Engine server hostname (defaults to appengine.google.com).
  • host: The hostname of the local machine for use with remote procedure calls.
  • noCookies: Do not store the administrator sign-in credentials. Prompt for a password every time. (or go through the OAuth2 flow when the oauth2 option is used).
  • passIn: Do not store the administrator sign-in credentials as a cookie; prompt for a password every time. If the property password was provided then this value will always be true.
  • password: The password in plain text to be used whenever a task requires one. The password is only applied if the email convention property was provided also. Alternatively, you can set the password in your gradle.properties via the property appenginePassword. The password in gradle.properties takes precedence over the one set in this convention property.
  • httpProxy: Use the given HTTP proxy to contact App Engine.
  • httpsProxy: Use the given HTTPS proxy to contact App Engine, when using HTTPS. If httpProxy is given but httpsProxy is not, both HTTP and HTTPS requests will use the given proxy.
  • oauth2: Use OAuth2 authentication instead of password-based authentication.
  • extraOptions: A list of extra command line options for the AppCfg tool (defaults to [])

Within appengine you can also define a closure named enhancer:

  • version: The version (v1/v2) parameter for App Engine datanucleus enhancer task
  • api: The api (jdo/jpa) parameter for the App Engine datanucleas enhancer task
  • enhanceOnBuild: Automatically run the enhancer (defaults to false)

Within appengine you can also define a closure named endpoints:

  • discoveryDocFormat: A list of discovery doc formats. (defaults to ['rpc', 'rest'])
  • serviceClasses: A list of endpoints classes to generate discovery docs or client libs for (overrides values read from web.xml)
  • getDiscoveryDocsOnBuild: Automatically download discovery docs before the war task is called. (defaults to false)
  • getClientLibsOnBuild: Automatically download client libraries before the war task is called. (defaults to false)
  • installClientLibsOnBuild: Automatically install client libs, will get client libs if necessary. (defaults to false) [this task will never be UP-TO-DATE, careful when making part of your build]
  • exportClientLibsOnBuild: Automatically export client libs, will get client libs if necessary. (defaults to false)
  • clientLibJarOut: Output directory of client library jars when exporting. (Must be of type: File, will be created if doesn't exist)
  • clientLibSrcJarOut: Output directory of client library source jars when exporting, if not specified no source jars will be copied. (Must be of type: File, will be created if doesn't exist)
  • googleClientVersion: Override the version of the Google Api Client Library that builds with endpoints artifacts. (Only works with endpoints and android-endpoints configurations)

The task appengineDownloadApp requires you to at least define the application ID and directory to write the files to. Define the tasks' properties in the closure app:

  • id: The application ID.
  • version: The current application version (defaults to current default version).
  • outputDirectory: The directory where you wish to save the files (defaults to build/downloaded-app).

The task appengineLogs requires you to at least define the file to write the logs to. Define the tasks' properties in the closure logs:

  • numDays: The number of days of log data to retrieve, ending on the current date at midnight UTC. A value of 0 retrieves all available logs. If append is given, then the default is 0, otherwise the default is 1.
  • severity: The minimum log level for the log messages to retrieve. The value is a number corresponding to the log level: 4 for CRITICAL, 3 for ERROR, 2 for WARNING, 1 for INFO, 0 for DEBUG. All messages at the given log level and above will be retrieved (defaults to 1 (INFO)).
  • append: Tells the plugin to append logs to the log output file instead of overwriting the file. This simply appends the requested data, it does not guarantee the file won't contain duplicate error messages. If this argument is not specified, the plugin will overwrite the log output file.
  • includeAll: Include everything in log messages.
  • outputFile: The file the logs get written to.

The task appengineUpdate allows you to specify upload specific settings. Define the tasks' properties in the closure update:

  • useJava7: Deprecated, has no effect

Example

appengine {
  httpPort = 8085

  appcfg {
    email = '[email protected]'
      passIn = true

      logs {
        severity = 1
          outputFile = file('mylogs.txt')
      }

    app {
      id = 'sample-app'
    }
  }
}

FAQ

Can I use the plugin with a Gaelyk project?

Gaelyk's template project uses this plugin out-of-the-box so no additional configuration needs to be done. If you start your project from scratch and decide to use the plugin please refer to the following sections to configure it properly.

Gaelyk <= 1.1

Yes, you just have to configure the WAR plugin to point to the correct web application (by default war) and source code (by default src) directory. If you want to stick to the default source directory simply create the subdirectory src/main/groovy.

apply plugin: 'groovy'

sourceSets {
    main {
        groovy {
            srcDirs = ['src']
        }
    }
}

webAppDirName = file('war')

When editing a Groovlets/Groovy templates in Gaelyk the server automatically deploys the change and you see it take effect almost instantly. The plugin provides support for that. Simply set the warDir convention property and leave the server running.

appengine {
    warDir = file('war')
}

Gaelyk >= 1.2

Starting with version 1.2 Gaelyk adopted Gradle's default directory structure. The following changes are required to leverage Gaelyk's hot-reloading feature.

appengine {
    warDir = file('src/main/webapp')
}

sourceSets.main.output.classesDir = 'src/main/webapp/WEB-INF/classes'

**How do I remote debug the local development server?**

You can use the convention property jvmFlags to set the JVM debug parameters. Make sure to set the TCP port you want your JVM to listen on. The following example show how to set the JVM flags to listen on port 8000.

appengine {
    jvmFlags = ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000']
}


How do I use OAuth2 passwordless login to authenticate?

You can configure your app to use OAuth2 with the option

appengine {
    appcfg {
        oauth2 = true
    }
}

For more details on the authentication flow see App Engine OAuth2 docs


**How do I run functional tests on the local development server?**

If you want to execute your tests in the container alongside the rest of your application you have to configure the appengineRun task to run in daemon mode. Starting with version 0.7 of the plugin this has become even easier. It provides the task appengineFunctionalTest which lets you define your functional test dependencies via the configuration functionalTestCompile. On top of that the task has been fully integrated into the build lifecycle.

One of the most prominent functional testing libraries in the Groovy ecosystem is Geb, an expressive and powerful browser automation solution. Please refer to this short and sweet tutorial for a quickstart.


**Why is my exploded-war still using old discovery docs even though I ran appengineEndpointsGetDisoveryDocs?**

The task appengineEndpointsGetDiscoveryDocs only downloads the Discovery Docs for an endpoint to a cache in build/discovery-docs, the war task copies this into the WEB-INF folder when packaging. If you want them to be copied in, just run build or appengineExplodeApp again. Why do we do this? The endpoints calls are network calls to a service and some users may not want to do this on every build. The user can update their endpoints discovery docs when they know they need to and it will be packaged in on every subsequent build without needing to be regenerated.


**How do I use a compile dependency on my endpoints client libraries from another project?**

Using the new configurations in the appengine plugin (endpoints/android-endpoints) you can do

 dependencies {
     compile project(path: '<appengine-module>', configuration: 'endpoints')
 }

or in an android project

dependencies {
    compile project(path: '<appengine-module>', configuration: 'android-endpoints')
}

**Enhancer failed with "Java returned: 1", how do I know what's wrong?**

Run using the --info flag when building to find the location of the error log file, that log file might have details on what went wrong. On linux machines it may appear as "/tmp/enhance(some number).log"


**How do I deploy with gcloud?**

If you're using gcloud to deploy your application, the newest version of app deploy doesn't support war directories, you will need to provide it with an app.yaml OR you can use the appengineStage task to create a directory that is deployable in <project>/build/staged-app

$ ./gradlew appengineStage
$ gcloud app deploy build/staged-app/app.yaml --project [app id] --version [some version]

NOTES:

  • You must explicitly define all config files your want to upload (cron.yaml, etc)
  • This does not work with EAR formatted projects.

**How do I create client libraries for iOS?**

You can generate a discovery document for your Api using the appengineEndpointsGetDiscoveryDocs task. Discovery documents can then be found in the <project>/build/discovery-docs directory. Follow the iOS endpoints instructions to create client libraries for your iOS application.

gradle-appengine-plugin's People

Contributors

bmuschko avatar erdi avatar houglum avatar jaredsburrows avatar jaystgelais avatar kdabir avatar loosebazooka avatar mattstep avatar msgilligan avatar musketyr avatar patflynn avatar rdayal avatar seano314 avatar stefma avatar wilford avatar wtanaka avatar xylo04 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gradle-appengine-plugin's Issues

testCompile don't works correctly with appengine plugin

using the 'appengine' plugin I got the following error during the compileJava task:

:compileJava
warning: No processor claimed any of these annotations: Test,Before,BeforeClass,After,AfterClass

... package org.junit does not exist import static org.junit.Assert.*;

if I change the junit dependencies from testCompile to compile the problem dosen't occurs

This means that for some reason the appengine plugin is ignoring the jars with the testCompile dependencies.

The functionalTestCompile statement doesn't change the result.

functionalTestCompile 'junit:junit:4.+' // compileJava error
testCompile 'junit:junit:4.+' // compileJava error
compile 'junit:junit:4.+'  // OK but then the junit jar is copyed to the lib folder, this is wrong
//  /WEB-INF/lib/junit-4.11.jar

build.gradle

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'war'
apply plugin: 'appengine'

def gaeVersion = '1.9.5'

dependencies {
    // download app engine sdk
    appengineSdk 'com.google.appengine:appengine-java-sdk:' + gaeVersion

    // app engine
    compile 'com.google.appengine:appengine:' + gaeVersion
    compile 'com.google.appengine:appengine-api-1.0-sdk:' + gaeVersion
    compile 'com.google.appengine:appengine-endpoints:' + gaeVersion
    compile 'com.google.appengine:appengine-endpoints-deps:' + gaeVersion
    compile 'com.google.appengine:appengine-jsr107cache:' + gaeVersion
    compile 'com.google.appengine:appengine-api-labs:' + gaeVersion

    // appengine datanucleus appengine 1.9.5
    compile 'com.google.appengine.orm:datanucleus-appengine:2.1.2'
    compile 'org.datanucleus:datanucleus-core:3.1.3'

    //  version=1.1
    //  groupId=net.sf.jsr107cache
    //  artifactId=jsr107cache
    //  appengine 1.9.5
    compile 'net.sf.jsr107cache:jsr107cache:1.1'

    // jta 1.1 appengine 1.9.5
    compile 'javax.transaction:jta:1.1'

    // asm-4.0 appengine 1.9.5
    compile 'org.ow2.asm:asm:4.0'

    testCompile 'junit:junit:4.+'
}

appEngine plugin doesn't respect proxy

Hi. I have proxy settings in Gradle VM options:
-Dhttp.proxyHost=192.168.100.1 -Dhttp.proxyPort=8080
When I try to build endpoint I get this error

Execution failed for task ':api:appengineEndpointsGetClientLibs'.
There was an error running endpoints command get-client-lib: connect timed out

But the internet is available for other tasks. Why can't I use proxy?

Split appengine plugin into multiple plugins

This is a proposal to split the appengine plugin into multiple plugins. I believe this will alleviate some of the annoyances with multi module builds (appcfg tasks or devappserver tasks being run on ALL modules instead of just the main one)

Maybe during this time we could move towards using extensions instead of conventions.

Here are the proposed plugins.

  • appengine (build / enhancer / endpoints) [ perhaps this can be 3 plugins? ]
  • appengine-appcfg (appcfg)
  • appengine-run (devappserver)

The plugin structure doesn't need to change too much, still a single code base and all plugins can share code, we just need to expose certain tasks differently.

  • Need to add AppEngineAppCfgPlugin.groovy and appengine-appcfg.properties
    • Tasks : DownloadApp, DownloadLogs, Rollback, Update, UpdateDos, UpdateIndexes, UpdateQueues, VacuumIndexes, Version
    • Backends : Optionally keep or remove these tasks in light of their deprecation
  • Need to add AppEngineRunPlugin.groovy and appengine-run.properties
    • Tasks : Run, Stop

Importing into a project would still be a single buildscript dependency on gradle-appengine-plugin. Any appcfg task would require the build.gradle file to apply plugin: 'appengine-appcfg', similarly for devappserver apply plugin: 'appengine-run'

error executing 'gradle build'

com.google.appengine.task.endpoints.EndpointsTest > smokeTest FAILED
org.gradle.tooling.BuildException
Caused by: org.gradle.internal.exceptions.LocationAwareException
Caused by: org.gradle.api.ProjectConfigurationException
Caused by: org.gradle.api.artifacts.ResolveException
Caused by: org.gradle.api.internal.artifacts.ivyservice.ModuleVersionNotFoundException

4 tests completed, 1 failed
:test FAILED

Hot code replace

Allow for changes to happen without the need to start and stop AppEngine

Error using gradle 'appengine' plugin in Eclipse workspace

This don't create an error, executing from the prompt:

$gradle cleanEclipse eclipse
:cleanEclipseClasspath
:cleanEclipseJdt
:cleanEclipseProject
:cleanEclipse
:eclipseClasspath
:eclipseJdt
:eclipseProject
:eclipse

BUILD SUCCESSFUL

Total time: 4.841 secs

But in Eclipse:
After create a Gradle project (Java Quickstart), cfg the build.gradle file as bellow and call the option in eclipse "Gradle/Refresh All" the follow error occurs.
build.gradle

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'war'
apply plugin: 'appengine'

sourceCompatibility = 1.7
targetCompatibility = 1.7

version = '1.0.0'
jar {
    manifest {
        attributes 'Implementation-Title': 'Gradle Quickstart', 'Implementation-Version': version
    }
}

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'com.google.appengine:gradle-appengine-plugin:1.8.6'
    }
}

repositories {
    mavenCentral()
    mavenLocal()
}

dependencies {
    appengineSdk 'com.google.appengine:appengine-java-sdk:1.8.9'

    compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
    testCompile group: 'junit', name: 'junit', version: '4.+'
}

Error ouput in Eclipse Console:

FAILURE: Build failed with an exception.

* Where:
Build file '/home/eschlei/workspaces/test/ValidateAppEnginePlugin/build.gradle' line: 5

* What went wrong:
A problem occurred evaluating root project 'ValidateAppEnginePlugin'.
> Could not find method create() for arguments [appengineDownloadSdk, class com.google.appengine.task.DownloadSdkTask] on task set.

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'ValidateAppEnginePlugin'.
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:127)
    at org.gradle.configuration.BuildScriptProcessor.evaluate(BuildScriptProcessor.java:38)
    at org.gradle.configuration.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:44)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:464)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:77)
    at org.gradle.configuration.DefaultBuildConfigurer$ConfigureProject.execute(DefaultBuildConfigurer.java:38)
    at org.gradle.configuration.DefaultBuildConfigurer$ConfigureProject.execute(DefaultBuildConfigurer.java:36)
    at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:440)
    at org.gradle.api.internal.project.AbstractProject.allprojects(AbstractProject.java:435)
    at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:32)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
    at org.gradle.initialization.DefaultGradleLauncher.getBuildAnalysis(DefaultGradleLauncher.java:92)
    at org.gradle.tooling.internal.provider.BuildModelAction.run(BuildModelAction.java:73)
    at org.gradle.tooling.internal.provider.DelegatingBuildModelAction.run(DelegatingBuildModelAction.java:44)
    at org.gradle.tooling.internal.provider.ConfiguringBuildAction.run(ConfiguringBuildAction.java:103)
    at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:39)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:45)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:42)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAndStop.java:33)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.ReturnResult.execute(ReturnResult.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:70)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:68)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:68)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:59)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:45)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator.runCommand(DaemonStateCoordinator.java:186)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy.doBuild(StartBuildOrRespondWithBusy.java:49)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.HandleStop.execute(HandleStop.java:36)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.CatchAndForwardDaemonFailure.execute(CatchAndForwardDaemonFailure.java:32)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.DefaultDaemonCommandExecuter.executeCommand(DefaultDaemonCommandExecuter.java:48)
    at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.handleCommand(DefaultIncomingConnectionHandler.java:155)
    at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.receiveAndHandleCommand(DefaultIncomingConnectionHandler.java:128)
    at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.run(DefaultIncomingConnectionHandler.java:116)
    at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
Caused by: org.gradle.api.internal.MissingMethodException: Could not find method create() for arguments [appengineDownloadSdk, class com.google.appengine.task.DownloadSdkTask] on task set.
    at org.gradle.api.internal.AbstractDynamicObject.methodMissingException(AbstractDynamicObject.java:68)
    at org.gradle.api.internal.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:56)
    at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:172)
    at org.gradle.api.internal.tasks.DefaultTaskContainer_Decorated.invokeMethod(Unknown Source)
    at com.google.appengine.AppEnginePlugin.configureDownloadSdk(AppEnginePlugin.groovy:165)
    at com.google.appengine.AppEnginePlugin.this$2$configureDownloadSdk(AppEnginePlugin.groovy)
    at com.google.appengine.AppEnginePlugin$this$2$configureDownloadSdk.callCurrent(Unknown Source)
    at com.google.appengine.AppEnginePlugin.apply(AppEnginePlugin.groovy:100)
    at com.google.appengine.AppEnginePlugin.apply(AppEnginePlugin.groovy)
    at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.providePlugin(DefaultProjectsPluginContainer.java:107)
    at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.addPluginInternal(DefaultProjectsPluginContainer.java:71)
    at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.apply(DefaultProjectsPluginContainer.java:37)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:101)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:32)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:72)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)
    at org.gradle.api.internal.project.AbstractProject.apply(AbstractProject.java:846)
    at org.gradle.api.Project$apply.call(Unknown Source)
    at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)
    at org.gradle.api.Script$apply.callCurrent(Unknown Source)
    at build_2v28i2iifi2t9hnaob3v7d4i13.run(/home/eschlei/workspaces/test/ValidateAppEnginePlugin/build.gradle:5)
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
    ... 53 more


BUILD FAILED

Total time: 0.236 secs

"daemon = true" doesn't work unless using Gradle in daemon mode too

I'm trying out the plugin's feature of running the App Engine dev server in daemon mode by specifying daemon = true in the build file, but when I run Gradle normally, the dev server dies as soon as Gradle finishes. When I run Gradle with the --daemon switch, the dev server keeps running. Is this expected? If so, that's fine, but I'm new to Gradle and wasn't aware of Gradle's daemon mode, so it's worth documenting that running the dev server as a daemon depends on Gradle daemon as well.

appengineEndpointsGetDiscoveryDocs doesn't work with Guice app

Build fails with the following error:

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':appengineEndpointsGetDiscoveryDocs'.

    There was an error running endpoints command get-discovery-doc: web.xml must have 1 (found:0) SystemServiceServlet servlet

The problem is that a Guice webapp using com.google.api.server.spi.guice.GuiceSystemServiceServletModule to define the servlet paths won't have any servlets defined in the web.xml, just the GuiceFilter filter and the GuiceServletContextListener listener.

Password is visible when typing Edit

Hi,
First of all thanks for building this gradle plugin. Its been really helpful in our workflow. I would like to report an issue with password input. When we are prompted with password, Its taking it as a standard text without masking it. Making my password visible to my colleagues. Can you please address the issue when you have time.

Thanks.

appengineFunctionalTest sometimes stalls due to failure to capture process output of dev server

I've reproduced this problem quite a few times on OSX Mavericks (my local machine) and on Linux (Travis, not sure what version of Linux they use). On the former it is only sometimes (and never when running gradlew with the --debug option), on the latter it's always happend.

This using 1.9.3 release.

When running gradle (version 1.11) with only the appengineFunctionalTest task the problem makes itself known by the dev server logging output appearing on the console.

Looking at the code, gradle-appengine-plugin attempts to capture and parse System.out for the line that indicates the dev server has started, due to the output going to console instead it's never considered to be started, so the command stalls.

I've build gradle-appengine-plugin locally and can confirm that the daemon mode is correctly enabled, and the code to parse System.out also works, it seems that the output of the external process of the Dev server is not always sent to System.out.

Since this redirection of the output stream is in an external library from Google I've been unable to debug this further (though looking at it's source I can't spot what the bug could be). It's likely though that the bug is in that project, but I'm not sure where to file a bug for that, and perhaps gradle-appengine-plugin could use a more reliable method of ensuring the dev server has started.

Modules support

The plugin currently only support WAR packaging. Please, add support for EAR packaging as well so we can use this plugin with modules altogether.

Install client libs configuration

I really like the addition of the install client libs task. There are two things that I like to configure:

  1. Have a installClientLibsOnBuild or installClientLibsOnGet property. The second one is probably better, because it's independent from getClientLibsOnBuild.
  2. Specify a different local repository. We have some private artifacts distributed in a repository that is checked in to version control.

Too many threads with IOException while running UpdateAll

Exception in thread "Thread-988" java.io.IOException: Read end dead
    at java.io.PipedInputStream.checkStateForReceive(PipedInputStream.java:263)
    at java.io.PipedInputStream.receive(PipedInputStream.java:227)
    at java.io.PipedOutputStream.write(PipedOutputStream.java:149)
    at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
    at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:282)
    at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)
    at java.io.OutputStreamWriter.write(OutputStreamWriter.java:207)
    at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:129)
    at java.io.BufferedWriter.flush(BufferedWriter.java:253)
    at java_io_Flushable$flush.call(Unknown Source)
    at com.google.appengine.task.appcfg.AppConfigTaskTemplate$PasswordWriterRunnable.run(AppConfigTaskTemplate.groovy:147)
    at java.lang.Thread.run(Thread.java:744)
Exception in thread "Thread-981" java.io.IOException: Read end dead
    at java.io.PipedInputStream.checkStateForReceive(PipedInputStream.java:263)
    at java.io.PipedInputStream.receive(PipedInputStream.java:227)
    at java.io.PipedOutputStream.write(PipedOutputStream.java:149)
    at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
    at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:282)
    at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)
    at java.io.OutputStreamWriter.write(OutputStreamWriter.java:207)
    at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:129)
    at java.io.BufferedWriter.flush(BufferedWriter.java:253)
    at java_io_Flushable$flush.call(Unknown Source)
    at com.google.appengine.task.appcfg.AppConfigTaskTemplate$PasswordWriterRunnable.run(AppConfigTaskTemplate.groovy:147)
    at java.lang.Thread.run(Thread.java:744)

improve enhancer/jdo/jpa flow

Document this better, it's terribly confusing otherwise (dependencies etc)

Maybe add a enhanceOnBuild option or explain that war HAS to depend on enhance or it wont really work too well.

Could not resolve all dependencies for configuration ':android-endpoints'

After upgrading to 1.9.7 and running the 'dependencies' task I get this now:

------------------------------------------------------------
Root project
------------------------------------------------------------

android-endpoints
:dependencies FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':dependencies'.
> Could not resolve all dependencies for configuration ':android-endpoints'.
   > A conflict was found between the following modules:
      - com.google.http-client:google-http-client:1.18.0-rc
      - com.google.http-client:google-http-client:1.19.0

Do you know how I can fix this (without downgrading)?

optimizeWar option documented but not working

From the readme:
optimizeWar: Specifies whether the generated classes and dependencies should be bundled into one single JAR file. The Gradle FatJar Plugin must be applied to your project. Otherwise the flag has no effect.

However when I try to use this option I get a Gradle warning:
Deprecated dynamic property: "optimizeWar" on "root project

I checked the source code of this plugin but the optimizeWar convention does not seem to exist.

Sample application with GAE plugin

Hi,

I'm trying to set a project with use of 'appengine' plugin. I've multiple errors, probably because I don't know how to tie it all together.

For instance, when gradle appengineRun is executed, everything works fine till the moment I open the site in the browser. Then I receive:

org.datanucleus.exceptions.NucleusUserException: 
Found Meta-Data for class com.sample.Message but this class is not enhanced!!
Please enhance the class before running DataNucleus.

Quick look at a task list shows that there is appropriate task: appengineEnhance. Unfortunately when the task is run it fails with an enigmatic exception Java returned: 1

To be honest, no idea what's exactly happening, thus I'm looking for a good example. Any help, suggestions, ideas would be greatly appreciated.

functionalTestCompile and Gradle 2.1

When building an app engine server with Gradle 2.1 I get the following:

Error:(16, 0) You can't change configuration 'functionalTestCompile' because it is already resolved!

build.gradle:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.google.appengine:gradle-appengine-plugin:1.9.12'
    }
}

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'

dependencies {
  appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.12'
  functionalTestCompile 'org.mockito:mockito-core:1.9.5'
}

appengine {
  downloadSdk = true
  appcfg {
    oauth2 = true
  }
}

Is there any known workaround for this?

appengineEndpointsInstallClientLibs ignores entity parameters when api methodName starts with "get"

The following @apimethod in an endpoint:

@apimethod(name = "getEntityByOtherEntity", path = "getEntityByOtherEntity")
public Contact getEntityByOtherEntity(@nAmed("a") long a, @nAmed("b") String b, Contact entity) {
return entity;
}

Will result the the following entry in the generated client library when using appengineEndpointsInstallClientLibs:

public GetEntityByOtherEntity getEntityByOtherEntity(java.lang.Long a, java.lang.String b) throws java.io.IOException {
GetEntityByOtherEntity result = new GetEntityByOtherEntity(a, b);
initialize(result);
return result;
}

The "Entity parameter" is missing in the generated client library

Rename the apiMethod to something that doesn't start with "get" gives expacted results.

No warnings or error messages :(
only cost me 2 days.

Customizable install location for client libraries

Currently appengineEndpointsInstallClientLibraries install to local maven repo. If the user would like to install to a local repo somewhere else, it is not possible. Add an option to specify the repo location.

Classpath Problem: Plugin (Bundle) "org.datanucleus" is already registered.

Hi,
after addition of classpath to appengineEnhance task (Issue #44). Enahncement task fails with Exception: Plugin (Bundle) "org.datanucleus" is already registered.

It seems that enahancer plugin tries to put v1 of datanucleus-core from GAE SDK on the classapath which causes problem of multiple data nucleus instances.

I use GAE 1.8.9, GWT 2.5.1, JPA 2.

build.gradle and logs: https://gist.github.com/sankotm/a52f51d46eee06ce02cb

appengineDownloadSdk does not work after upgrading from bmuschko

After upgrading to from bmuschko to GoogleCloudPlatform I get the below error.
Note that I'm using the downloadSdk = true option.

* What went wrong:
A problem occurred evaluating root project 'spring-appengine-samples'.
> Could not find method create() for arguments [appengineDownloadSdk, class com.google.appengine.task.DownloadSdkTask] on task set.

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'spring-appengine-samples'.
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:127)
    at org.gradle.configuration.BuildScriptProcessor.evaluate(BuildScriptProcessor.java:38)
    at org.gradle.configuration.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:44)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:464)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:77)
    at org.gradle.configuration.DefaultBuildConfigurer$ConfigureProject.execute(DefaultBuildConfigurer.java:38)
    at org.gradle.configuration.DefaultBuildConfigurer$ConfigureProject.execute(DefaultBuildConfigurer.java:36)
    at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:440)
    at org.gradle.api.internal.project.AbstractProject.allprojects(AbstractProject.java:435)
    at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:32)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
    at org.gradle.initialization.DefaultGradleLauncher.getBuildAnalysis(DefaultGradleLauncher.java:92)
    at org.gradle.tooling.internal.provider.BuildModelAction.run(BuildModelAction.java:73)
    at org.gradle.tooling.internal.provider.DelegatingBuildModelAction.run(DelegatingBuildModelAction.java:44)
    at org.gradle.tooling.internal.provider.ConfiguringBuildAction.run(ConfiguringBuildAction.java:103)
    at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:39)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:45)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:42)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAndStop.java:33)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.ReturnResult.execute(ReturnResult.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:70)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:68)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:68)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:59)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:45)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator.runCommand(DaemonStateCoordinator.java:186)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy.doBuild(StartBuildOrRespondWithBusy.java:49)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.HandleStop.execute(HandleStop.java:36)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.CatchAndForwardDaemonFailure.execute(CatchAndForwardDaemonFailure.java:32)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.DefaultDaemonCommandExecuter.executeCommand(DefaultDaemonCommandExecuter.java:48)
    at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.handleCommand(DefaultIncomingConnectionHandler.java:155)
    at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.receiveAndHandleCommand(DefaultIncomingConnectionHandler.java:128)
    at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.run(DefaultIncomingConnectionHandler.java:116)
    at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
Caused by: org.gradle.api.internal.MissingMethodException: Could not find method create() for arguments [appengineDownloadSdk, class com.google.appengine.task.DownloadSdkTask] on task set.
    at org.gradle.api.internal.AbstractDynamicObject.methodMissingException(AbstractDynamicObject.java:68)
    at org.gradle.api.internal.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:56)
    at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:172)
    at org.gradle.api.internal.tasks.DefaultTaskContainer_Decorated.invokeMethod(Unknown Source)
    at com.google.appengine.AppEnginePlugin.configureDownloadSdk(AppEnginePlugin.groovy:165)
    at com.google.appengine.AppEnginePlugin.this$2$configureDownloadSdk(AppEnginePlugin.groovy)
    at com.google.appengine.AppEnginePlugin$this$2$configureDownloadSdk.callCurrent(Unknown Source)
    at com.google.appengine.AppEnginePlugin.apply(AppEnginePlugin.groovy:100)
    at com.google.appengine.AppEnginePlugin.apply(AppEnginePlugin.groovy)
    at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.providePlugin(DefaultProjectsPluginContainer.java:107)
    at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.addPluginInternal(DefaultProjectsPluginContainer.java:71)
    at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.apply(DefaultProjectsPluginContainer.java:37)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:101)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:32)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:72)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)
    at org.gradle.api.internal.project.AbstractProject.apply(AbstractProject.java:846)
    at build_7e0sae6vb1qosirag8r1v2u29q$_run_closure1.doCall(/Users/marceloverdijk/workspace/spring-appengine-samples/build.gradle:22)
    at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:58)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:133)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:94)
    at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:866)
    at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:871)
    at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:216)
    at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:122)
    at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
    at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java:83)
    at build_7e0sae6vb1qosirag8r1v2u29q.run(/Users/marceloverdijk/workspace/spring-appengine-samples/build.gradle:16)
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
    ... 53 more


BUILD FAILED

Total time: 0.42 secs

EAR with two modules won't update

When running appengineUpdate on EAR referring two different modules (default and another one to be specific) I get following error each time when the plugin tries to update the second (non-default) module:

com.google.appengine.tools.admin.HttpIoException: Error posting to URL: https://appengine.google.com/api/appversion/create?module=queuesmodule&app_id=myappid&version=381-earmodules&
409 Conflict
Another transaction by user vladimir is already in progress for app: s~myappid, version: 381-earmodules. That user can undo the transaction with "appcfg rollback".

Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?module=queuesmodule&app_id=myappid&version=381-earmodules&
409 Conflict
Another transaction by user vladimir is already in progress for app: s~myappid, version: 381-earmodules. That user can undo the transaction with "appcfg rollback".

Please see the logs [/tmp/appcfg1492123480967328438.log] for further information.

The referred log doesn't say anything important.

appengineExplodeWar gets skipped when running appengineRun

Hi,

For some reason, the appengineExplodeWar task is always skipped whenever I try and run my local server. This is problematic because if I make some changes, then re-run ./gradlew appengineRun, instead of regenerating a new war, the local server runs with the old war unless I run ./gradlew appengineExplodeWar.

Here's the debug output:

17:11:27.555 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :war (Thread[Task worker 1,5,main]) - complete
17:11:27.555 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :appengineExplodeApp (Thread[Task worker 1,5,main] - start
17:11:27.555 [LIFECYCLE] [org.gradle.TaskExecutionLogger] :appengineExplodeApp
17:11:27.556 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Starting to execute task ':appengineExplodeApp'
17:11:27.556 [INFO] [org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter] Skipping task ':appengineExplodeApp' as task onlyIf is false.
17:11:27.556 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':appengineExplodeApp'
17:11:27.557 [LIFECYCLE] [org.gradle.TaskExecutionLogger] :appengineExplodeApp SKIPPED

I can't seem to figure out what "onlyIf" condition for appengineExplodeApp is false. Any ideas?

javax.servlet.ServletResponse class not found

Using appengine 1.9.8 api spawns this error when trying to run (appengineRun).

my dependencies are :

dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.8'
compile 'com.google.appengine:appengine-endpoints:1.9.8'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.8'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.googlecode.objectify:objectify:4.0b3'
compile 'com.ganyo:gcm-server:1.0.2'
}

How to solve this error?

gradle plugin questions

Hey all -

I've noticed a couple of odd things while using the appengine gradle plugin:

  1. Running 'gradle build' with an extremely vanilla configuration (copied from the java modules example) builds the source and silently starts the dev server. This happens regardless of the value of the appengine.daemon setting in my build.gradle. Is this the intended behavior?
  2. Doing 'gradle appengineStop' yields the following error message:

jrvb@jrvb:~/clients/test1/worldserver$ gradle appengineStop
👂appengineDownloadSdk
👂appengineStop FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':ear:appengineStop'.

    Could not find property 'port' on task ':ear:appengineStop'.

Interestingly, the devserver actually does stop, so this seems to be spurious. Adding appengine.httpPort or appengine.stopPort as suggested by the gradle plugin README has no effect. Adding the following quells the error message, though:

appengineStop {
port = 8080
}

This looks like a case where the documentation has diverged from the code a bit? (Or maybe a bug in the plugin?)

Best,

-Rob

Convertin to modules

Moved this here from #1

Our "default module" is currently in the root of the source repository. It seems I'd need to move it to a sub-directory in order to mirror the sample project. This isn't feasible.

I'd need to configure Gradle to have this layout:

/ myapp
  | module-root
    | build.gradle
    | settings.gradle
  | module-ear
    | build.gradle
  | src
     | main
     | test
  | build.gradle

Can someone maybe point me in the right direction?

Some rough edges with Gradle 2.0

Using Gradle 2.0, I was trying to start a functional test suite and was running into JUnit initialization issues. Those cleared up after I switched back to Gradle 1.12. I'll stick with the older version for now. FWIW, everything else I tried so far worked with 2.0!

20:45:08.835 [DEBUG] [TestEventLogger]     java.lang.Exception: No runnable methods
20:45:08.835 [DEBUG] [TestEventLogger]         at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:169)
20:45:08.835 [DEBUG] [TestEventLogger]         at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:104)
20:45:08.836 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner.validate(ParentRunner.java:355)
20:45:08.836 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner.<init>(ParentRunner.java:76)
20:45:08.836 [DEBUG] [TestEventLogger]         at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:57)
20:45:08.836 [DEBUG] [TestEventLogger]         at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10)
20:45:08.836 [DEBUG] [TestEventLogger]         at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
20:45:08.837 [DEBUG] [TestEventLogger]         at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
20:45:08.837 [DEBUG] [TestEventLogger]         at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
20:45:08.837 [DEBUG] [TestEventLogger]         at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26)
20:45:08.837 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:80)
20:45:08.837 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:49)
20:45:08.838 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:69)

shared ear libs being ignored causing ClassNotFoundException

I've started using 1.8.6 version in our project and when I run appengineRun task of our ear project, I get bunch of ClassNotFoundException occurs even the class is present in the jars contained in the lib folder.

It looks the ear's lib folder is ignored. The app engine modules documentation doesn't say anything about how is the ear's lib folder handled so it's hard to tell if this is bug or feature.

1.8.8 release?

Are there plans to deploy 1.8.8 version to Maven Central?

Classpath issues

I have made a minimal test project to test this plugin. It builds and deploys but when running the app I get

Unresolved compilation problems: 
The import com.google.appengine.api cannot be resolved
Queue cannot be resolved to a type
QueueFactory cannot be resolved
    ...

See https://github.com/oakstair/gradle-gae-plugin-tryout

Could not find property 'compileJava' ...

Hi!

I have been away from the appengine gradle plugin for a while but decided to try it out again.

But I get this error when trying the new 'appengine' plugin.

The planned support for modules where great news btw!

/Gunnar


€ gradle tasks

FAILURE: Build failed with an exception.

  • Where:
    Build file '/Users/gunnar/git/gradle-gae-plugin-tryout/build.gradle' line: 1

  • What went wrong:
    A problem occurred evaluating root project 'gradle-gae-plugin-tryout'.

    Could not find property 'compileJava' on root project 'gradle-gae-plugin-tryout'.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2.6 secs

slimWar without fatJar

See bmuschko/gradle-gae-plugin#49

Is there any quick option to use slimwar, meaning using a jar of all classes from the fatjar plugin, but not fatJar? I only see optimizeWar,which seems to do both?

Also,are there any Experiences on whether App startup time decreases by using a FatJar? Some comments on the internet seem to indicate that this had been so in the past.

Limit scope of enhancer

Limit scoped of the enhancer to a selection of class files or packages. It appears the enhancer pollutes the log with warnings of unehanced/unenhaceable classes.

daemon mode does not work if project path contains spaces

I have a space in the name of one of the directories containing my project. :appengineRun works with "daemon=false" but not "daemon=true". If I rename the directory to remove the space, then "daemon=true" mode works for :appengineFunctionalTest. It appears that there is an issue quoting paths somewhere in the daemon=true case.

Could not determine the dependencies of task ':appengineExplodeApp'.

Hi,

I just switched from the old bmuschko gradle plugin to this plugin, but instantly got this error. Do you have any ideas on what I do wrong? The complete project can be found here: https://bitbucket.org/nilsmagnus/device-ping-server/

[nilspils ~/workspace/pinger ]$ gradle clean build

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ':appengineExplodeApp'.
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

WebXmlProcessing.getClassNames should check for empty param-value in services init-param

When the param-value for the services init-param for SystemServiceServlet in web.xml is left empty:

<servlet>
  <servlet-name>SystemServiceServlet</servlet-name>
  <servlet-class>com.google.api.server.spi.SystemServiceServlet</servlet-class>
  <init-param>
    <param-name>services</param-name>
    <param-value/>
  </init-param>
</servlet>

and without explicitly setting serviceClasses in the endpoints closure, the exception below is thrown. It would be better if WebXmlProcessing.getClassNames() checked for empty parameters.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':project:appengineEndpointsGetClientLibs'.
> There was an error running endpoints command get-client-lib:

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':project:appengineEndpointsGetClientLibs'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
        at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
        at org.gradle.launcher.Main.doAction(Main.java:46)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at org.gradle.launcher.Main.main(Main.java:37)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
Caused by: org.gradle.api.GradleException: There was an error running endpoints command get-client-lib:
        at com.google.appengine.task.endpoints.EndpointsTask.runEndpointsCommand(EndpointsTask.groovy:47)
        at com.google.appengine.task.endpoints.EndpointsTask$runEndpointsCommand.callCurrent(Unknown Source)
        at com.google.appengine.task.endpoints.GetClientLibsTask.executeTask(GetClientLibsTask.groovy:39)
        at com.google.appengine.task.AbstractTask.start(AbstractTask.groovy:38)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:219)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:212)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:201)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:533)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:516)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
        ... 43 more
Caused by: java.lang.ClassNotFoundException:
        at com.google.api.server.spi.tools.GenApiConfigAction.loadClasses(GenApiConfigAction.java:109)
        at com.google.api.server.spi.tools.GenApiConfigAction.genApiConfig(GenApiConfigAction.java:90)
        at com.google.api.server.spi.tools.GetClientLibAction.getClientLib(GetClientLibAction.java:76)
        at com.google.api.server.spi.tools.GetClientLibAction.execute(GetClientLibAction.java:55)
        at com.google.api.server.spi.tools.EndpointsTool.execute(EndpointsTool.java:68)
        at com.google.appengine.task.endpoints.EndpointsTask.runEndpointsCommand(EndpointsTask.groovy:44)
        ... 54 more


BUILD FAILED

Build fails is "war" plugin not included

Some ear modules don't need the "war" plugin.

Endpoints configurations specficially reference the "war" plugin and build fails if the war plugin isn't included.

This affects v1.8.9 and v.1.9.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.