简体   繁体   中英

How can I change the internal groovy version from gradle 6?

In the screenshot are marked the two groovy versions I need to change Im working on a grails 4 project trying to integrate it with open clover plugin for testing coverage. Im trying to use the groovy version I have installed and set as default in my local, instead of using the internal version that ships with gradle. How can I do that?

You can't replace or remove the shipped/provided Groovy that comes with Gradle because:

  • Gradle's build language is based on Groovy
  • Parts of Gradle are implemented in Groovy

So Gradle is effectively tied to whatever version of Groovy it was shipped with for that release. If your project requires a different version or requires Groovy in general, then you need to explicitly declare a Groovy dependency as you would for any Groovy project:

dependencies {
    implementation "org.codehaus.groovy:groovy-all:3.0.4"
}

Warning: my answer is hard and not adviced.

If really you want to change the version of groovy in gradle, you might clone gradle from source, edit subproject/language-java/build.gradle.kts for java compiler, and same in any subprojects.

I do not recommend you to do that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM