Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Groovy 4.0 #1114

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
Draft

Upgrade to Groovy 4.0 #1114

wants to merge 8 commits into from

Conversation

olovy
Copy link
Contributor

@olovy olovy commented May 2, 2022

FYI draft.

Spock is not yet compatible with Groovy 4
spockframework/spock#1374

@olovy olovy marked this pull request as draft May 2, 2022 12:08
@klngwll
Copy link
Contributor

klngwll commented May 6, 2022

@olovy olovy force-pushed the feature/groovy-4 branch 2 times, most recently from 5706fe7 to fcf76a9 Compare August 2, 2022 15:02
@olovy olovy changed the title Upgrade to Groovy 4.0.2 Upgrade to Groovy 4.0 Aug 2, 2022
@olovy olovy marked this pull request as ready for review August 2, 2022 15:55
@olovy olovy marked this pull request as draft August 2, 2022 16:00
@olovy
Copy link
Contributor Author

olovy commented Aug 2, 2022

Gretty is still not working...

@olovy
Copy link
Contributor Author

olovy commented Aug 22, 2023

Rebased on develop

@olovy
Copy link
Contributor Author

olovy commented Aug 22, 2023

Gretty is still not working due to grettyStarter pulling in Gradle's internal Groovy version

Caused by: 
groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-datetime is loaded in version 4.0.14 and you are trying to load version 3.0.17
../gradlew -q dependencies
...
grettyStarter
+--- org.gretty:gretty-starter:4.1.0
|    +--- org.gretty:gretty-core:4.1.0
|    |    +--- commons-cli:commons-cli:1.5.0
|    |    +--- commons-configuration:commons-configuration:1.10
|    |    |    \--- commons-lang:commons-lang:2.6
|    |    +--- commons-io:commons-io:2.13.0
|    |    +--- org.apache.commons:commons-lang3:3.12.0
|    |    +--- org.bouncycastle:bcprov-jdk15on:1.70
|    |    \--- org.gretty:gretty-common:4.1.0
|    \--- org.slf4j:slf4j-api:2.0.7
+--- org.codehaus.groovy:groovy-cli-commons:3.0.17
|    +--- org.codehaus.groovy:groovy:3.0.17
|    \--- commons-cli:commons-cli:1.4 -> 1.5.0
\--- org.codehaus.groovy:groovy-json:3.0.17
     \--- org.codehaus.groovy:groovy:3.0.17

Seems like a new groovy compiler bug.
Works in 3.0.9 and 4.0.2 but not in 4.0.4.

Among other things static imports fail for constants in whelk.JsonLd.

```
/home/olov/kod/librisxl/whelk-core/build/tmp/compileGroovy/groovy-java-stubs/se/kb/libris/Normalizers.java:2: error: cannot find symbol
import static whelk.JsonLd.ID_KEY;
```

Looks like it's an issue with joint Java + Groovy compilation
("groovy-java-stubs")
DocumentSpec > Cannot set created FAILED
    org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '{@type=Publication, place={@type=Place, label=Stuttgart}, agent={@type=Agent, label=Thieme}}' with class 'java.util.LinkedHashMap' to class 'java.util.Collection' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: java.util.Collection(LinkedHashMap)
        at whelk.converter.marc.MarcFieldHandler.convert_closure15(MarcFrameConverter.groovy:2145)
        at groovy.lang.Closure.call(Closure.java:418)
        at whelk.converter.marc.MarcFieldHandler.convert(MarcFrameConverter.groovy:2128)
        at whelk.converter.marc.MarcRuleSet.processFields_closure6(MarcFrameConverter.groovy:756)
        at groovy.lang.Closure.call(Closure.java:418)
        at whelk.converter.marc.MarcRuleSet.processFields(MarcFrameConverter.groovy:753)
        at whelk.converter.marc.MarcRuleSet.convert(MarcFrameConverter.groovy:746)
        at whelk.converter.marc.MarcConversion.convert(MarcFrameConverter.groovy:274)
        at whelk.converter.marc.MarcFrameConverter.runConvert(MarcFrameConverter.groovy:81)
        at whelk.converter.marc.MarcFrameConverter.convert(MarcFrameConverter.groovy:107)
        at whelk.DocumentSpec.Cannot set created(DocumentSpec.groovy:374)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants