Hi I created a jar from groovy source code using gradle's standard jar target and groovy plugin. Published the jar to a private ivy repo. Tried to use the jar in a script using @Grab, and got the following error:
Caught: BUG! exception in phase 'conversion' in source unit '/home/me/code/MyScript.groovy' # Licensed to the Apache Software Foundation (ASF) under one or more BUG! exception in phase 'conversion' in source unit '/home/me/code/MyScript.groovy' # Licensed to the Apache Software Foundation (ASF) under one or more Caused by: java.lang.ClassNotFoundException: # Licensed to the Apache Software Foundation (ASF) under one or more Changing my gradle build file to use groovy 2.3.11 to build the jar and republishing the jar, fixed the problem. The script itself was run with groovy 2.4.4 at all times. I won't have the time for a couple of days to follow this up any further, but I wanted to report it in case someone can work it out while I am away. Once I have some time again, I will be happy to give more detail and try things if that will help. *Version and config details:* DID NOT WORK Groovy 2.4.4 Spock 1.0-groovy-2.4 (I doubt this is relevant, but it is something that was different between working and non-working setups) DID WORK Groovy 2.3.11 Spock 1.0-groovy-2.3 COMMON CONFIG: Gradle 2.6 Created jar using standard jar task, and gradlew, via Jenkins Sample MyScript.groovy that used the jar via @Grab is below. I have a custom grapeConfig.xml pointing to my private repo. @Grab(group = 'mygroup', module = 'MyModule', version = '0.1.0') import au.com.mypackage println "hello" Jar was built and published via Jenkins. At one point I unpacked the jar, and searched for "Apache" using grep. No match, so I don't know where the text in the error is coming from. While trying to fix the error, I removed all local grapes several times, as well as deleting the jar and related files from the private repo, before finally changing my gradle build file. I haven't done anything to confirm the Jenkins setup is not at fault, but it seems unlikely. Cheers, Anne. -- Coherent Software Australia Pty Ltd PO Box 2773 Cheltenham Vic 3192 Phone: (03) 9585 6788 Fax: (03) 9585 1086 Web: http://www.coherentsoftware.com.au/ Email: [email protected] Bonsai ERP, the all-inclusive ERP system http://www.bonsaierp.com.au/
