Dear Gradle Team and Community,
With reference to https://guides.gradle.org/building-groovy-libraries/
(Gradle 5.2.1)
I was building my Groovy library (this library is intended to be used as dependency for other projects) using build.gradle
recommended in the above documentation web page:
...
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.5.4'
...
}
...
Here is the Build Scan: https://scans.gradle.com/s/mtq6qtse4jiv4
However when I try to load my library using Grapes in Groovy Console with different version (e.g. 2.5.6), I get error.
Problematic script:
@Grab('io.infinite:supplies:1.1.1')
def i
Error:
groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-xml is loaded in version 2.5.6 and you are trying to load version 2.5.4
My project branch where issue is simulated:
The problem does not appear if I use the below build.gradle:
...
dependencies {
compileOnly 'org.codehaus.groovy:groovy-all:2.5.4'
testCompile 'org.codehaus.groovy:groovy-all:2.5.4'
...
}
...
Question: where is there problem?
a) In Gradle documentation/best practice (groovy-all scope needs to be changed to compileOnly)?
b) In Groovy Console?
c) In Grapes?
PS: I tried using groovy
module and certain specific modules explicitly (groovy-xml
, groovy-swing
, etc) - same issue persists.
PPS: No spock
is used.