Failed to apply plugin [id 'flow-gradle-plugin']

buildscript {
repositories {
maven {
url ‘http://dl.bintray.com/ecpluginsdev/maven
}

    jcenter()
}
dependencies {
    classpath group: 'com.electriccloud.plugins', name: 'flow-gradle-plugin', version: '+'
}

}

group = ‘com.electriccloud’
description = "Plugins : "
version = “1.0.0”

apply plugin: ‘flow-gradle-plugin’

When I run the build script I get this error

Steins-MacBook-Pro-2:EC-GroovyProject stein$ gradle build --info

Initialized native services in: /Users/stein/.gradle/native

The client will now receive all logging from the daemon (pid: 31886). The daemon log file: /Users/stein/.gradle/daemon/5.2.1/daemon-31886.out.log

Starting 11th build in daemon [uptime: 1 hrs 1 mins 11.837 secs, performance: 99%, no major garbage collections]

Using 4 worker leases.

Starting Build

Settings evaluated using settings file ‘/Users/stein/Development/Faas/EC-GroovyProject/settings.gradle’.

Projects loaded. Root project using build file ‘/Users/stein/Development/Faas/EC-GroovyProject/build.gradle’.

Included projects: [root project ‘EC-GroovyLib’]

> Configure project :

Evaluating root project ‘EC-GroovyLib’ using build file ‘/Users/stein/Development/Faas/EC-GroovyProject/build.gradle’.

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.


  • Where:

Build file ‘/Users/stein/Development/Faas/EC-GroovyProject/build.gradle’ line: 18

  • What went wrong:

A problem occurred evaluating root project ‘EC-GroovyLib’.

> Failed to apply plugin [id ‘flow-gradle-plugin’]

> Could not find method leftShift() for arguments [com.electriccloud.plugins.BuildPlugin$_apply_closure2@79aff9a5] on task ‘:processProjectXml’ of type org.gradle.api.DefaultTask.

  • Try:

Run with –stacktrace option to get the stack trace. Run with –debug option to get more log output. Run with –scan to get full insights.

==============================================================================

2: Task failed with an exception.


  • What went wrong:

A problem occurred configuring root project ‘EC-GroovyLib’.

> Could not get unknown property ‘deploy’ for task set of type org.gradle.api.internal.tasks.DefaultTaskContainer.

  • Try:

Run with –stacktrace option to get the stack trace. Run with –debug option to get more log output. Run with –scan to get full insights.

==============================================================================

How do I fix this

Hello,

The plugin you apply uses the Task.leftShift method provided by the Gradle runtime. This method has been deprecated since Gradle 3.2 and was removed from Gradle 5.0 API.

You can either:

  1. update the plugin to a more recent version known to work with Gradle 5.0 and later;

This plugin seems to be built with Gradle 2.13 according to the wrapper configuration and you could create a push request with an updated wrapper and corrections in the source code (the gradle test kit can be used to validate that the plugin still works with Gradle 2.13 if that’s a requirement).

  1. downgrade your Gradle runtime to Gradle 4.10.3 which is the latest version known to have that method.

Note that if another plugin or part of your build require recent Gradle runtime this may be difficult to achieve.