0

I need assistance to add a wrapper to an old gradle (v2.12) project, but I'm unable to run the wrapper tasks due to the following error:

Failed to apply plugin [class 'fi.jasoft.plugin.GradleVaadinPlugin']

Your gradle version (4.2.1) is too old. Plugin requires Gradle 2.0+

According to the error, I need to upgrade my gradle version, yet I have version 4.2.1 installed locally. Is there anyway to run the wrapper task with a specific version?

Gradle 4.2.1

Build time: 2017-10-02 15:36:21 UTC

Revision: a88ebd6be7840c2e59ae4782eb0f27fbe3405ddf

Groovy: 2.4.12

Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015

JVM: 1.8.0_40 (Oracle Corporation 25.40-b25)

OS: Mac OS X 10.12.6 x86_64

Edit: Tried using --gradle-version | => gradle wrapper --gradle-version 2.12

Configure project : Root version lmichelson The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead. at build_an2u3e8kk42wdypa8wwdzfqcs$_run_closure6.doCall(/projects/maia/build.gradle:240) (Run with --stacktrace to get the full stack trace of this deprecation warning.)

FAILURE: Build failed with an exception.

  • Where: Script '/projects/maia/webapp/vaadin.plugin.0.10.7' line: 79

  • What went wrong: A problem occurred evaluating script.

    Failed to apply plugin [class 'fi.jasoft.plugin.GradleVaadinPlugin'] Your gradle version (4.2.1) is too old. Plugin requires Gradle 2.0+

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

  • Get more help at https://help.gradle.org

BUILD FAILED in 2s

1 Answers1

0

Thanks to the link and answer from @Opal, I solved the issue by

  1. Installing SDKMAN
  2. Downgrading my local gradle version to 2.12: sdk install gradle 2.12
  3. Run the wrapper command
  4. Restore my local version to 4.2.1: sdk install gradle 4.2.1