-
-
Notifications
You must be signed in to change notification settings - Fork 424
mergeGroovyExtensionModules() not working with multiple extension modules for groovy 2.5+ #490
Description
Shadow Version
5.0.0 (currently latest)
Gradle Version
5.1.1
Groovy version
2.5.7 (same issue with 3.0.0-beta-1) (currently latest)
Expected Behavior
While using Date.parse(String, String) or LocalDateTime(String, String) which are defined in extension classes, the shadow jar should be able to get the extension function.
Actual Behavior
When running without shadow, no problem.
With runShadow :
groovy.lang.MissingMethodException: No signature of method: static java.time.LocalDateTime.parse()
or
groovy.lang.MissingMethodException: No signature of method: static java.util.Date.parse()
Gradle Build Script(s)
dependencies {
implementation 'org.codehaus.groovy:groovy:2.5.7'
implementation 'org.codehaus.groovy:groovy-dateutil:2.5.7'
implementation 'org.codehaus.groovy:groovy-datetime:2.5.7'
}
[...]
shadowJar {
mergeGroovyExtensionModules()
}
Content of Shadow JAR (jar tf <jar file> - post link to GIST if too long)
The META-INF/groovy/org.codehaus.groovy.runtime.ExtensionModule file only contains one extension module reference :
moduleName=groovy-dateutil
moduleVersion=2.5.7
extensionClasses=org.apache.groovy.dateutil.extensions.DateUtilExtensions
staticExtensionClasses=org.apache.groovy.dateutil.extensions.DateUtilStaticExtensions
The file should contain all merged extensions classes (comma separated) : http://docs.groovy-lang.org/latest/html/documentation/#module-descriptor