gradle - How to stop buildSrc from automatically applying groovy-all jar as a dependency? -
i have gradle project set up, has buildsrc module inside of it. inside buildsrc, in build.gradle, have following:
dependencies { compile 'org.codehaus.groovy:groovy-all:2.4.12' ... } when trying build project, receive following error message:
2:07:13 pm: executing external task 'build --stacktrace'... :buildsrc:compilejava no-source :buildsrc:compilegroovy failed failure: build failed exception. * went wrong: execution failed task ':buildsrc:compilegroovy'. > java.lang.exceptionininitializererror (no error message) in stacktrace, see following error:
caused by: groovy.lang.groovyruntimeexception: conflicting module versions. module [groovy-all loaded in version 2.4.11 , trying load version 2.4.12 ... 15 more so, when @ project structure, see groovy-all-2.4.11.jar automatically being loaded buildsrc module.
if remove compile dependency groovy in build.gradle, work, there way force module use version of groovy want?
gradle applies default build script buildsrc project. script contains following line:
compile localgroovy() that how groovy-all-2.4.11 gets in. override behaviour, try setting resolutionstrategy, e.g.:
configurations.compile { resolutionstrategy { force 'org.codehaus.groovy:groovy-all:2.4.12' } } but more importantly think, why want build against groovy version differs 1 available in plugin's runtime...

Comments
Post a Comment