diff --git a/gradle.properties b/gradle.properties index d13e07ce21..2164723ccc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,6 @@ org.gradle.daemon=true -groovyVersion=3.0.9 +groovyVersion=4.0.14 +spockVersion=2.3 jettyVersion = 9.4.44.v20210927 prometheusVersion = 0.15.0 log4jVersion = 2.17.0 @@ -7,6 +8,5 @@ resilience4jVersion = 1.7.1 httpComponentsCoreVersion = 4.4.14 httpComponentsClientVersion = 4.5.13 systemProp.https.protocols=TLSv1.1,TLSv1.2 -spockVersion=2.1-groovy-3.0 guavaVersion=31.1-jre jacocoVersion=0.8.8 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180f2a..249e5832f0 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 41dfb87909..db9a6b825d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1b6c787337..a69d9cb6c2 100755 --- a/gradlew +++ b/gradlew @@ -205,6 +205,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index ac1b06f938..53a6b238d4 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/gretty.plugin b/gretty.plugin index 38eaa9ea51..81915fd3e1 100644 --- a/gretty.plugin +++ b/gretty.plugin @@ -1,4 +1,4 @@ -// SOURCE: https://raw.githubusercontent.com/gretty-gradle-plugin/gretty/master/pluginScripts/gretty-3.0.3.plugin +// SOURCE: https://raw.githubusercontent.com/gretty-gradle-plugin/gretty/master/pluginScripts/gretty-4.1.0.plugin buildscript { repositories { @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'org.gretty:gretty:3.0.6' + classpath 'org.gretty:gretty:4.1.0' } } @@ -14,7 +14,5 @@ repositories { mavenCentral() } -if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) { +if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) - project.gretty.servletContainer = 'jetty9.4' -} diff --git a/importers/build.gradle b/importers/build.gradle index 87185f92df..1258c7a10d 100644 --- a/importers/build.gradle +++ b/importers/build.gradle @@ -67,7 +67,7 @@ dependencies { // Common tools providedCompile 'javax.servlet:servlet-api:2.5' - implementation "org.codehaus.groovy:groovy-all:${groovyVersion}" + implementation "org.apache.groovy:groovy-all:${groovyVersion}" implementation 'org.codehaus.jackson:jackson-mapper-asl:1.9.12' // Integration @@ -83,9 +83,9 @@ dependencies { // profiling and test testImplementation "org.spockframework:spock-core:${spockVersion}" testImplementation 'cglib:cglib-nodep:3.1' - implementation "org.codehaus.groovy:groovy-json:${groovyVersion}" - implementation "org.codehaus.groovy:groovy-sql:${groovyVersion}" - implementation "org.codehaus.groovy:groovy:${groovyVersion}" + implementation "org.apache.groovy:groovy-json:${groovyVersion}" + implementation "org.apache.groovy:groovy-sql:${groovyVersion}" + implementation "org.apache.groovy:groovy:${groovyVersion}" implementation 'org.slf4j:slf4j-api:1.7.32' implementation 'org.slf4j:slf4j-simple:1.7.32' } diff --git a/librisxl-tools/examples/ExerciseOaipmh.groovy b/librisxl-tools/examples/ExerciseOaipmh.groovy index 6f2e05971b..16a4188751 100644 --- a/librisxl-tools/examples/ExerciseOaipmh.groovy +++ b/librisxl-tools/examples/ExerciseOaipmh.groovy @@ -1,5 +1,6 @@ +import groovy.xml.XmlSlurper import groovy.xml.StreamingMarkupBuilder -import groovy.util.slurpersupport.GPathResult +import groovy.xml.slurpersupport.GPathResult class ExerciseOaipmh { diff --git a/marc_export/build.gradle b/marc_export/build.gradle index c64e30a23d..ef459e13a9 100644 --- a/marc_export/build.gradle +++ b/marc_export/build.gradle @@ -36,7 +36,7 @@ dependencies { } implementation group: 'xml-apis', name: 'xml-apis', version: '1.4.01' implementation 'org.apache.commons:commons-lang3:3.3.2' - implementation "org.codehaus.groovy:groovy:${groovyVersion}" + implementation "org.apache.groovy:groovy:${groovyVersion}" } gretty { diff --git a/rest/build.gradle b/rest/build.gradle index 38f019b33f..3f7b151238 100644 --- a/rest/build.gradle +++ b/rest/build.gradle @@ -71,8 +71,8 @@ dependencies { implementation(project(':whelk-core')) // Common tools - implementation "org.codehaus.groovy:groovy-all:${groovyVersion}" - implementation "org.codehaus.groovy:groovy-dateutil:${groovyVersion}" + implementation "org.apache.groovy:groovy-all:${groovyVersion}" + implementation "org.apache.groovy:groovy-dateutil:${groovyVersion}" implementation 'org.codehaus.jackson:jackson-mapper-asl:1.9.13' implementation 'commons-io:commons-io:2.11.0' implementation "com.google.guava:guava:${guavaVersion}" @@ -101,10 +101,10 @@ dependencies { // Standalone executableWarDeps "org.eclipse.jetty:jetty-server:${jettyVersion}" executableWarDeps "org.eclipse.jetty:jetty-webapp:${jettyVersion}" - executableWarDeps "org.codehaus.groovy:groovy-all:${groovyVersion}" + executableWarDeps "org.apache.groovy:groovy-all:${groovyVersion}" executableWarDeps 'commons-cli:commons-cli:1.2' - implementation "org.codehaus.groovy:groovy-xml:${groovyVersion}" - implementation "org.codehaus.groovy:groovy:${groovyVersion}" + implementation "org.apache.groovy:groovy-xml:${groovyVersion}" + implementation "org.apache.groovy:groovy:${groovyVersion}" implementation 'org.codehaus.jackson:jackson-core-asl:1.9.13' implementation 'xml-apis:xml-apis:1.4.01' } diff --git a/rest/src/main/groovy/whelk/rest/api/Crud.groovy b/rest/src/main/groovy/whelk/rest/api/Crud.groovy index 4d0258c49b..6c6405f3ef 100644 --- a/rest/src/main/groovy/whelk/rest/api/Crud.groovy +++ b/rest/src/main/groovy/whelk/rest/api/Crud.groovy @@ -22,6 +22,7 @@ import whelk.exception.UnexpectedHttpStatusException import whelk.exception.WhelkRuntimeException import whelk.history.History import whelk.rest.api.CrudGetRequest.Lens +import whelk.rest.api.HttpTools import whelk.rest.security.AccessControl import whelk.util.WhelkFactory @@ -32,7 +33,6 @@ import java.lang.management.ManagementFactory import static whelk.rest.api.CrudUtils.ETag import static whelk.rest.api.HttpTools.getBaseUri -import static whelk.rest.api.HttpTools.sendError import static whelk.rest.api.HttpTools.sendResponse import static whelk.util.Jackson.mapper @@ -225,12 +225,12 @@ class Crud extends HttpServlet { setVary(response) response.setHeader("ETag", eTag.toString()) response.setHeader("Server-Start-Time", "" + ManagementFactory.getRuntimeMXBean().getStartTime()) - sendError(response, HttpServletResponse.SC_NOT_MODIFIED, "Document has not been modified.") + HttpTools.sendError(response, HttpServletResponse.SC_NOT_MODIFIED, "Document has not been modified.") } private static void sendNotFound(HttpServletRequest request, HttpServletResponse response) { metrics.failedRequests.labels(request.getMethod(), HttpServletResponse.SC_NOT_FOUND.toString()).inc() - sendError(response, HttpServletResponse.SC_NOT_FOUND, "Document not found.") + HttpTools.sendError(response, HttpServletResponse.SC_NOT_FOUND, "Document not found.") } private Object getFormattedResponseBody(CrudGetRequest request, Document doc, String profileId) { @@ -843,7 +843,7 @@ class Crud extends HttpServlet { if (log.isDebugEnabled()) { log.debug("Sending error $code : ${e.getMessage()} for ${request.getRequestURI()}") } - sendError(response, code, e.getMessage(), e) + HttpTools.sendError(response, code, e.getMessage(), e) } static private int mapError(Exception e) { diff --git a/rest/src/main/groovy/whelk/rest/api/RemoteSearchAPI.groovy b/rest/src/main/groovy/whelk/rest/api/RemoteSearchAPI.groovy index 8626e3213f..9daf2a1133 100644 --- a/rest/src/main/groovy/whelk/rest/api/RemoteSearchAPI.groovy +++ b/rest/src/main/groovy/whelk/rest/api/RemoteSearchAPI.groovy @@ -1,7 +1,8 @@ package whelk.rest.api import groovy.util.logging.Log4j2 as Log -import groovy.util.slurpersupport.GPathResult +import groovy.xml.XmlSlurper +import groovy.xml.slurpersupport.GPathResult import groovy.xml.StreamingMarkupBuilder import se.kb.libris.util.marc.Field import se.kb.libris.util.marc.MarcRecord diff --git a/whelk-core/build.gradle b/whelk-core/build.gradle index 9a91be1367..4c86243419 100644 --- a/whelk-core/build.gradle +++ b/whelk-core/build.gradle @@ -87,7 +87,7 @@ dependencies { implementation "io.github.resilience4j:resilience4j-circuitbreaker:${resilience4jVersion}" implementation "io.github.resilience4j:resilience4j-prometheus:${resilience4jVersion}" implementation "io.github.resilience4j:resilience4j-retry:${resilience4jVersion}" - implementation "org.codehaus.groovy:groovy-all:${groovyVersion}" + implementation "org.apache.groovy:groovy-all:${groovyVersion}" implementation 'com.damnhandy:handy-uri-templates:2.0.4' implementation 'com.zaxxer:HikariCP:4.0.3' implementation 'commons-codec:commons-codec:1.7' @@ -96,10 +96,10 @@ dependencies { implementation "org.apache.httpcomponents:httpclient:${httpComponentsClientVersion}" implementation "org.apache.httpcomponents:httpcore:${httpComponentsCoreVersion}" api 'org.apache.jena:apache-jena-libs:3.0.1' - api "org.codehaus.groovy:groovy-json:${groovyVersion}" - api "org.codehaus.groovy:groovy-xml:${groovyVersion}" - api "org.codehaus.groovy:groovy-yaml:${groovyVersion}" - api "org.codehaus.groovy:groovy:${groovyVersion}" + api "org.apache.groovy:groovy-json:${groovyVersion}" + api "org.apache.groovy:groovy-xml:${groovyVersion}" + api "org.apache.groovy:groovy-yaml:${groovyVersion}" + api "org.apache.groovy:groovy:${groovyVersion}" api 'org.codehaus.jackson:jackson-mapper-asl:1.9.13' implementation 'xerces:xercesImpl:2.11.0' //KP diff --git a/whelk-core/src/main/groovy/se/kb/libris/Normalizers.groovy b/whelk-core/src/main/groovy/se/kb/libris/Normalizers.groovy index 540144a09e..3aa84f9e34 100644 --- a/whelk-core/src/main/groovy/se/kb/libris/Normalizers.groovy +++ b/whelk-core/src/main/groovy/se/kb/libris/Normalizers.groovy @@ -8,16 +8,9 @@ import whelk.component.DocumentNormalizer import whelk.exception.InvalidQueryException import whelk.filter.BlankNodeLinker import whelk.filter.LanguageLinker -import whelk.util.DocumentUtil import whelk.util.DocumentUtil.Remove import whelk.util.Romanizer -import static whelk.JsonLd.GRAPH_KEY -import static whelk.JsonLd.ID_KEY -import static whelk.JsonLd.TYPE_KEY -import static whelk.JsonLd.asList -import static whelk.util.DocumentUtil.traverse - /* TODO: add support for linking blank nodes based on owl:hasKey example: @@ -99,12 +92,13 @@ class Normalizers { return new Normalizer({ Document doc -> def (_record, thing) = doc.data[GRAPH_KEY] + thing.identifiedBy?.with { asList(it).forEach { Map id -> id.typeNote?.with { String tn -> OBSOLETE_TYPE_NOTES[tn.toLowerCase()] }?.with { type -> - id[TYPE_KEY] = type + id[JsonLd.TYPE_KEY] = type id.remove('typeNote') } } @@ -124,13 +118,13 @@ class Normalizers { static DocumentNormalizer workPosition(JsonLd jsonLd) { return new Normalizer({ Document doc -> def (_record, thing, legacyWork) = doc.data[GRAPH_KEY] - + boolean shouldMove = (legacyWork && isInstanceOf(jsonLd, legacyWork, 'Work') - && thing && thing['instanceOf'] && thing['instanceOf'][ID_KEY] - && thing['instanceOf'][ID_KEY] == legacyWork[ID_KEY]) + && thing && thing['instanceOf'] && thing['instanceOf'][JsonLd.ID_KEY] + && thing['instanceOf'][JsonLd.ID_KEY] == legacyWork[JsonLd.ID_KEY]) if (shouldMove) { - def work = doc.data[GRAPH_KEY].remove(2) + def work = doc.data[JsonLd.GRAPH_KEY].remove(2) work.remove(ID_KEY) thing['instanceOf'] = work } diff --git a/whelk-core/src/main/groovy/whelk/JsonLd.groovy b/whelk-core/src/main/groovy/whelk/JsonLd.groovy index d04c959e61..09ea178658 100644 --- a/whelk-core/src/main/groovy/whelk/JsonLd.groovy +++ b/whelk-core/src/main/groovy/whelk/JsonLd.groovy @@ -584,7 +584,7 @@ class JsonLd { } static List> findPaths(Map obj, String key, Set values) { - List paths = [] + List> paths = [] new DFS().search(obj, { List path, v -> if (v in values && key == path[-1]) { paths << new ArrayList(path) @@ -728,7 +728,7 @@ class JsonLd { if (type == null) return - List subTerms = (List) (superTermOf[type]) + List subTerms = (List) (superTermOf[type]) if (subTerms == null) return @@ -747,7 +747,7 @@ class JsonLd { return jsonLd } - List graphItems = jsonLd.get(GRAPH_KEY) + List graphItems = (List) jsonLd.get(GRAPH_KEY) additionalObjects.each { object -> if (object instanceof Map) { @@ -868,8 +868,8 @@ class JsonLd { * [, ] pairs. */ private List applyLensAsListByLang(Map thing, Set languagesToKeep, List removableBaseUris, String lensToUse) { - Map lensGroups = displayData.get('lensGroups') - Map lensGroup = lensGroups.get(lensToUse) + Map lensGroups = (Map) displayData.get('lensGroups') + Map lensGroup = (Map) lensGroups.get(lensToUse) Map lens = getLensFor((Map)thing, lensGroup) List parts = [] @@ -956,12 +956,13 @@ class JsonLd { be displayed on the frontend. Mainly for use as search keys. */ Map applyLensAsMapByLang(Map thing, Set languagesToKeep, List removableBaseUris, List lensesToTry) { - Map lensGroups = displayData.get('lensGroups') + Map lensGroups = (Map) displayData.get('lensGroups') Map lens = null - String initialLens + String initialLens = null for (String lensToTry : lensesToTry) { - Map lensGroup = lensGroups?.get(lensToTry) + Map lensGroup = (Map) lensGroups?.get(lensToTry) + lens = getLensFor((Map)thing, lensGroup) if (lens) { initialLens = lensToTry @@ -1020,8 +1021,9 @@ class JsonLd { } List makeSearchKeyParts(Map object) { - Map lensGroups = displayData.get('lensGroups') - Map lensGroup = lensGroups?.get('chips') + Map lensGroups = (Map) displayData.get('lensGroups') + Map lensGroup = (Map) lensGroups?.get('chips') + Map lens = getLensFor(object, lensGroup) List parts = [] def type = object.get(TYPE_KEY) @@ -1065,9 +1067,10 @@ class JsonLd { if (data[GRAPH_KEY]) { return new LinkedHashSet(((List) data[GRAPH_KEY]).collect{ getInverseProperties((Map) it, lensType) }.flatten()) } + + Map lensGroups = (Map) displayData.get('lensGroups') + Map lensGroup = (Map)lensGroups?.get(lensType) - Map lensGroups = displayData.get('lensGroups') - Map lensGroup = lensGroups?.get(lensType) Map lens = getLensFor(data, lensGroup) return new LinkedHashSet((List) lens?.get('inverseProperties') ?: []) } @@ -1090,10 +1093,11 @@ class JsonLd { } private Map getLens(Map thing, List lensTypes) { - Map lensGroups = displayData.get('lensGroups') + Map lensGroups = (Map) displayData.get('lensGroups') if (lensGroups == null) { return } + lensTypes.findResult { lensType -> lensGroups.get(lensType)?.with { getLensFor(thing, (Map) it) } } @@ -1160,7 +1164,7 @@ class JsonLd { private Map findLensForType(String typeKey, Map lensGroup) { def lenses = lensGroup['lenses'] - Map lens = ((Map)lenses).get(typeKey) + Map lens = (Map) ((Map)lenses).get(typeKey) if (lens) return lens def typedfn = vocabIndex.get(typeKey) diff --git a/whelk-core/src/main/groovy/whelk/Whelk.groovy b/whelk-core/src/main/groovy/whelk/Whelk.groovy index 564543329a..632f0e7c2e 100644 --- a/whelk-core/src/main/groovy/whelk/Whelk.groovy +++ b/whelk-core/src/main/groovy/whelk/Whelk.groovy @@ -134,21 +134,21 @@ class Whelk { } static Map> collectNamedApplications(Properties configuration) { - Map apps = [:] + Map> apps = [:] for (int i = 0; true; i++) { - def appId = configuration["namedApplications[${i}].id" as String] + String appId = configuration["namedApplications[${i}].id" as String] if (!appId) { break } - def app = [id: appId] - def alias = configuration["namedApplications[${i}].alias" as String] + Map app = [id: appId] + String alias = configuration["namedApplications[${i}].alias" as String] if (alias) { app['alias'] = alias } apps[appId] = app } - return apps + return (Map>) apps } synchronized MarcFrameConverter getMarcFrameConverter() { diff --git a/whelk-core/src/main/groovy/whelk/converter/marc/MarcFrameConverter.groovy b/whelk-core/src/main/groovy/whelk/converter/marc/MarcFrameConverter.groovy index 4ddbd9ad63..f697d7f3de 100644 --- a/whelk-core/src/main/groovy/whelk/converter/marc/MarcFrameConverter.groovy +++ b/whelk-core/src/main/groovy/whelk/converter/marc/MarcFrameConverter.groovy @@ -1378,7 +1378,7 @@ class MarcFixedFieldHandler { static boolean isColKey(key) { ((String) key)?.startsWith('[') } static List> parseColumnNumbers(key) { - List colNums = [] + List> colNums = [] (key =~ /\[(\d+)(?::(\d+))?\]\s*/).each { List m -> Integer start = m[1].toInteger() Integer end = m[2]?.toInteger() ?: start + 1 @@ -2176,7 +2176,7 @@ class MarcFieldHandler extends BaseMarcFieldHandler { def items = (List) parent[link] if (items instanceof List && items.size() == 1) { parent.remove(link) - parent.putAll(items[0]) + parent.putAll((Map) items[0]) } } } diff --git a/whelk-core/src/main/groovy/whelk/filter/BlankNodeLinker.groovy b/whelk-core/src/main/groovy/whelk/filter/BlankNodeLinker.groovy index 2f7c1c5572..28bf26dbc8 100644 --- a/whelk-core/src/main/groovy/whelk/filter/BlankNodeLinker.groovy +++ b/whelk-core/src/main/groovy/whelk/filter/BlankNodeLinker.groovy @@ -3,19 +3,12 @@ package whelk.filter import com.google.common.collect.Iterables import whelk.JsonLd import whelk.Whelk +import whelk.JsonLd import whelk.search.ESQuery import whelk.search.ElasticFind import whelk.util.DocumentUtil import whelk.util.Statistics -/* -Groovy compiler fails... -.../compileGroovy/groovy-java-stubs/whelk/filter/BlankNodeLinker.java:10: error: cannot find symbol - -import static whelk.JsonLd.GRAPH_KEY -import static whelk.JsonLd.ID_KEY -import static whelk.JsonLd.TYPE_KEY - */ import static whelk.util.DocumentUtil.NOP import static whelk.util.DocumentUtil.Remove import static whelk.util.DocumentUtil.findKey @@ -94,6 +87,7 @@ class BlankNodeLinker implements DocumentUtil.Linker { } } + String id = definition.isReplacedBy ? definition.isReplacedBy[JsonLd.ID_KEY] : definition[JsonLd.ID_KEY] identifiers.each { addMapping(it, id) } } diff --git a/whelk-core/src/main/groovy/whelk/filter/LanguageLinker.groovy b/whelk-core/src/main/groovy/whelk/filter/LanguageLinker.groovy index b783714a3d..2b2e18c539 100644 --- a/whelk-core/src/main/groovy/whelk/filter/LanguageLinker.groovy +++ b/whelk-core/src/main/groovy/whelk/filter/LanguageLinker.groovy @@ -14,8 +14,7 @@ class LanguageLinker extends BlankNodeLinker implements DocumentUtil.Linker { boolean linkLanguages(data, List disambiguationNodes = [], String key = 'language') { return DocumentUtil.findKey(data, key, DocumentUtil.link(this, disambiguationNodes)) } - - //@Override + boolean linkAll(data, String key = 'language') { super.linkAll(data, key) } diff --git a/whelk-core/src/main/groovy/whelk/search/ESQuery.groovy b/whelk-core/src/main/groovy/whelk/search/ESQuery.groovy index a51c7cb193..d6ef6f59e2 100644 --- a/whelk-core/src/main/groovy/whelk/search/ESQuery.groovy +++ b/whelk-core/src/main/groovy/whelk/search/ESQuery.groovy @@ -977,11 +977,11 @@ class ESQuery { } else { currentField = "${parentName}.${fieldName}" } - Map fields = fieldSettings.get('fields') + Map fields = (Map) fieldSettings.get('fields') if (fields && fields.get('keyword')) { result.add(currentField) } - Map properties = fieldSettings.get('properties') + Map properties = (Map) fieldSettings.get('properties') if (properties) { result += getKeywordFieldsFromProperties(properties, currentField) } diff --git a/whelk-core/src/main/groovy/whelk/util/MarcExport.groovy b/whelk-core/src/main/groovy/whelk/util/MarcExport.groovy index 8d399a4180..6ebc1b80a9 100644 --- a/whelk-core/src/main/groovy/whelk/util/MarcExport.groovy +++ b/whelk-core/src/main/groovy/whelk/util/MarcExport.groovy @@ -10,6 +10,7 @@ import whelk.Document import whelk.JsonLd import whelk.Whelk import whelk.converter.marc.JsonLD2MarcXMLConverter +import groovy.xml.XmlSlurper @Log4j2 class MarcExport { diff --git a/whelktool/build.gradle b/whelktool/build.gradle index a69e1dffcd..b44191aa28 100644 --- a/whelktool/build.gradle +++ b/whelktool/build.gradle @@ -61,9 +61,9 @@ dependencies { testImplementation "org.spockframework:spock-core:${spockVersion}" testImplementation 'junit:junit:4.13.2' implementation "com.google.guava:guava:${guavaVersion}" - implementation "org.codehaus.groovy:groovy-cli-commons:${groovyVersion}" - implementation "org.codehaus.groovy:groovy-jsr223:${groovyVersion}" - implementation "org.codehaus.groovy:groovy:${groovyVersion}" + implementation "org.apache.groovy:groovy-cli-commons:${groovyVersion}" + implementation "org.apache.groovy:groovy-jsr223:${groovyVersion}" + implementation "org.apache.groovy:groovy:${groovyVersion}" implementation 'org.codehaus.jackson:jackson-mapper-asl:1.9.12' implementation 'commons-codec:commons-codec:1.7' implementation group: 'xml-apis', name: 'xml-apis', version: '1.4.01' diff --git a/whelktool/src/main/groovy/datatool/WhelkTool.groovy b/whelktool/src/main/groovy/datatool/WhelkTool.groovy index 23061e7e31..98a60ad9e7 100644 --- a/whelktool/src/main/groovy/datatool/WhelkTool.groovy +++ b/whelktool/src/main/groovy/datatool/WhelkTool.groovy @@ -1,6 +1,7 @@ package whelk.datatool import com.google.common.util.concurrent.MoreExecutors +import groovy.cli.commons.CliBuilder import org.codehaus.groovy.jsr223.GroovyScriptEngineImpl import whelk.Document import whelk.IdGenerator