From 302b6af4df9d3299ac7184ccca8dc3e2c53c8aa1 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Sun, 12 Jul 2026 13:13:07 +0200 Subject: Migrated to Solr 9.10.1 and Lucene 9.12.3 --- .classpath | 26 ++++---- build.xml | 6 +- ivy.xml | 78 ++++++++++++---------- .../responsewriter/GrepHTMLResponseWriter.java | 3 +- .../solr/responsewriter/HTMLResponseWriter.java | 3 +- test/jetty-solr-dependency-guard.sh | 74 +++++++++++++------- test/jetty/RelocateJettyPackages.java | 9 +-- test/solr9-jetty-bridge-spike.sh | 4 +- 8 files changed, 117 insertions(+), 86 deletions(-) diff --git a/.classpath b/.classpath index 3430bee69..ae62baa74 100644 --- a/.classpath +++ b/.classpath @@ -12,17 +12,19 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/build.xml b/build.xml index 3be9c4a17..cabc0e5aa 100644 --- a/build.xml +++ b/build.xml @@ -107,7 +107,7 @@ - + @@ -198,10 +198,10 @@ - + - + + + @@ -53,19 +55,26 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -73,22 +82,25 @@ - + - + + - + + + @@ -96,7 +108,7 @@ - + @@ -116,19 +128,20 @@ - - - - + + + + + - - - + + + @@ -136,24 +149,19 @@ - - - + diff --git a/source/net/yacy/cora/federate/solr/responsewriter/GrepHTMLResponseWriter.java b/source/net/yacy/cora/federate/solr/responsewriter/GrepHTMLResponseWriter.java index d662c119c..73e280542 100644 --- a/source/net/yacy/cora/federate/solr/responsewriter/GrepHTMLResponseWriter.java +++ b/source/net/yacy/cora/federate/solr/responsewriter/GrepHTMLResponseWriter.java @@ -244,8 +244,7 @@ public class GrepHTMLResponseWriter implements QueryResponseWriter, SolrjRespons private void writeApiLink(final Writer writer, final SolrParams solrParams) throws IOException { final NamedList paramsList = solrParams.toNamedList(); paramsList.remove("wt"); - @SuppressWarnings("deprecation") - String xmlquery = dqp.matcher("select?" + SolrParams.toSolrParams(paramsList).toString()).replaceAll("%22"); + String xmlquery = dqp.matcher("select?" + paramsList.toSolrParams().toString()).replaceAll("%22"); writer.write("
\"API\"\n"); writer.write("This search result can also be retrieved as XML. Click the API icon to see an example call to the search rss API.
\n"); diff --git a/source/net/yacy/cora/federate/solr/responsewriter/HTMLResponseWriter.java b/source/net/yacy/cora/federate/solr/responsewriter/HTMLResponseWriter.java index 8e03fb832..ea16a2c1c 100644 --- a/source/net/yacy/cora/federate/solr/responsewriter/HTMLResponseWriter.java +++ b/source/net/yacy/cora/federate/solr/responsewriter/HTMLResponseWriter.java @@ -125,8 +125,7 @@ public class HTMLResponseWriter implements QueryResponseWriter, SolrjResponseWri final NamedList paramsList = solrParams.toNamedList(); paramsList.remove("wt"); - @SuppressWarnings("deprecation") - final String xmlquery = dqp.matcher("select?" + SolrParams.toSolrParams(paramsList).toString() + "&core=" + coreName).replaceAll("%22"); + final String xmlquery = dqp.matcher("select?" + paramsList.toSolrParams().toString() + "&core=" + coreName).replaceAll("%22"); writer.write("
\"API\"\n"); writer.write("This search result can also be retrieved as XML. Click the API icon to see this page as XML.
\n"); diff --git a/test/jetty-solr-dependency-guard.sh b/test/jetty-solr-dependency-guard.sh index 9347c4fd7..daa1cbabe 100755 --- a/test/jetty-solr-dependency-guard.sh +++ b/test/jetty-solr-dependency-guard.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# Guard the production Jetty 12 classpath while Solr 9's Jetty 9 client remains +# Guard the production Jetty 12 classpath while Solr 9's Jetty 10 client remains # relocated into a private package and out of YaCy source code. set -eu @@ -42,6 +42,19 @@ grep -E 'name="jetty-client".*conf="solr9-bridge->master"' ivy.xml >/dev/null 2> fail "jetty-client must only be a direct input of the Solr 9 bridge" server_jetty_version=12.0.37 +bridge_jetty_version=10.0.26 +solr_version=9.10.1 +lucene_version=9.12.3 + +for artifact in core api scripting solrj solrj-streaming solrj-zookeeper; do + grep -E "org=\"org.apache.solr\" name=\"solr-$artifact\" rev=\"$solr_version\" conf=\"solr9-bridge->master\"" ivy.xml >/dev/null 2>&1 || \ + fail "solr-$artifact $solr_version must be an explicit Solr bridge input" +done + +for artifact in analysis-common backward-codecs classification codecs expressions grouping highlighter join memory misc queries queryparser spatial-extras suggest; do + grep -E "org=\"org.apache.lucene\" name=\"lucene-$artifact\" rev=\"$lucene_version\"" ivy.xml >/dev/null 2>&1 || \ + fail "lucene-$artifact must be on version $lucene_version" +done for artifact in jetty-http jetty-io jetty-proxy jetty-security jetty-server jetty-util; do grep -E "org=\"org.eclipse.jetty\" name=\"$artifact\" rev=\"$server_jetty_version\" conf=\"compile->default\"" ivy.xml >/dev/null 2>&1 || \ @@ -57,13 +70,13 @@ if grep -E 'org="org.eclipse.jetty.compression"|name="jetty-compression-' ivy.xm fi if grep -E 'conf="jetty12-migration|rev="9\.4\.58\.v20250814" conf="compile' ivy.xml >/dev/null 2>&1; then - fail "ivy.xml still contains an isolated migration configuration or public Jetty 9 dependency" + fail "ivy.xml still contains an isolated migration configuration or obsolete public Jetty dependency" fi if grep -R -n -E --include='*.java' \ '(Jetty9HttpServerImpl|AbstractRemoteHandler|YaCyLoginService|YaCySecurityHandler|YaCyDigestCredential|YacyDomainHandler|InetPathAccessHandler)' \ source >/dev/null 2>&1; then - fail "obsolete Jetty 9 adapter references remain in production source" + fail "obsolete pre-Jetty-12 adapter references remain in production source" fi for artifact in http2-client http2-common http2-http-client-transport; do @@ -71,10 +84,9 @@ for artifact in http2-client http2-common http2-http-client-transport; do fail "$artifact must only be an input of the Solr 9 bridge" done -for artifact in slf4j-api slf4j-jdk14; do - grep -E "name=\"$artifact\" rev=\"1.7.36\" conf=\"solr9-bridge->master\"" ivy.xml >/dev/null 2>&1 || \ - fail "$artifact 1.7.36 must only be an input of the Solr 9 bridge" -done +if grep -E 'name="slf4j-(api|jdk14)" rev="1\.7\.36"' ivy.xml >/dev/null 2>&1; then + fail "Solr 9.10 must use YaCy's shared SLF4J 2 runtime" +fi grep -E 'org="org.eclipse.jetty.toolchain" name="jetty-servlet-api" rev="4.0.9"' ivy.xml >/dev/null 2>&1 || \ fail "Jetty's EE8 Servlet 4 API must be an explicit dependency" @@ -100,6 +112,18 @@ if [ -d lib ]; then [ "$public_jetty_count" -gt 0 ] || \ fail "no production Jetty $server_jetty_version artifacts found" + public_lucene_count=0 + for artifact in lib/lucene-*.jar; do + [ -e "$artifact" ] || continue + public_lucene_count=$((public_lucene_count + 1)) + case $(basename "$artifact") in + *-"$lucene_version".jar) ;; + *) fail "Lucene artifact is not on version $lucene_version: $artifact" ;; + esac + done + [ "$public_lucene_count" -gt 0 ] || \ + fail "no Lucene $lucene_version artifacts found" + servlet_api_count=0 for artifact in lib/*servlet-api-*.jar; do [ -e "$artifact" ] || continue @@ -121,6 +145,7 @@ if [ -d lib ]; then 'jetty-ee9-*.jar' \ 'jetty-ee10-*.jar' \ 'jetty-ee11-*.jar' \ + 'solr-api-*.jar' \ 'solr-core-*.jar' \ 'solr-solrj-*.jar' \ 'solr-scripting-*.jar' \ @@ -133,20 +158,24 @@ if [ -d lib ]; then done for artifact in \ - solr-core-9.0.0 \ - solr-solrj-9.0.0 \ - solr-scripting-9.0.0 \ - jetty-client-9.4.58.v20250814 \ - jetty-http-9.4.58.v20250814 \ - jetty-io-9.4.58.v20250814 \ - jetty-util-9.4.58.v20250814 \ - http2-client-9.4.58.v20250814 \ - http2-common-9.4.58.v20250814 \ - http2-http-client-transport-9.4.58.v20250814 \ - slf4j-api-1.7.36 \ - slf4j-jdk14-1.7.36; do + solr-api-$solr_version \ + solr-core-$solr_version \ + solr-scripting-$solr_version \ + solr-solrj-$solr_version \ + solr-solrj-streaming-$solr_version \ + solr-solrj-zookeeper-$solr_version \ + jetty-alpn-java-client-$bridge_jetty_version \ + jetty-client-$bridge_jetty_version \ + jetty-http-$bridge_jetty_version \ + jetty-io-$bridge_jetty_version \ + jetty-util-$bridge_jetty_version \ + http2-client-$bridge_jetty_version \ + http2-common-$bridge_jetty_version \ + http2-http-client-transport-$bridge_jetty_version; do jar="lib/solr9-bridge-$artifact.jar" [ -f "$jar" ] || fail "missing generated bridge artifact: $jar" + grep -F "" .classpath >/dev/null 2>&1 || \ + fail "Eclipse classpath is missing generated bridge artifact: $jar" if jar tf "$jar" | grep '^org/eclipse/jetty/' >/dev/null 2>&1; then fail "unrelocated Jetty class in $jar" fi @@ -154,12 +183,9 @@ if [ -d lib ]; then fail "unrelocated Jetty reference in $jar" fi if jar tf "$jar" | grep '^org/slf4j/' >/dev/null 2>&1; then - fail "unrelocated SLF4J class in $jar" - fi - if zipgrep -a -E 'org(/|\.)slf4j' "$jar" >/dev/null 2>&1; then - fail "unrelocated SLF4J reference in $jar" + fail "bridge artifact must not bundle SLF4J classes: $jar" fi done fi -echo "PASS: production Jetty 12 and the relocated Solr 9 Jetty 9 dependencies are separated." +echo "PASS: production Jetty 12 and the relocated Solr 9 Jetty 10 dependencies are separated." diff --git a/test/jetty/RelocateJettyPackages.java b/test/jetty/RelocateJettyPackages.java index 01939f5d2..b85e24273 100644 --- a/test/jetty/RelocateJettyPackages.java +++ b/test/jetty/RelocateJettyPackages.java @@ -2,9 +2,8 @@ * Build-time bytecode relocator for the Jetty 12 migration. * * This is deliberately a small build tool, not YaCy runtime code. It keeps - * Solr's public packages unchanged while moving its private Jetty 9 linkage - * below net.yacy.solr9.jetty and its SLF4J 1.7 linkage below - * net.yacy.solr9.slf4j. + * Solr's public packages unchanged while moving its private Jetty 10 linkage + * below net.yacy.solr9.jetty. */ package net.yacy.test.jetty; @@ -29,9 +28,7 @@ public final class RelocateJettyPackages { private static final Relocation[] RELOCATIONS = { new Relocation("org/eclipse/jetty", "net/yacy/solr9/jetty", - "org.eclipse.jetty", "net.yacy.solr9.jetty"), - new Relocation("org/slf4j", "net/yacy/solr9/slf4j", - "org.slf4j", "net.yacy.solr9.slf4j") + "org.eclipse.jetty", "net.yacy.solr9.jetty") }; private RelocateJettyPackages() { diff --git a/test/solr9-jetty-bridge-spike.sh b/test/solr9-jetty-bridge-spike.sh index 00eb0ff5c..510d9fc84 100755 --- a/test/solr9-jetty-bridge-spike.sh +++ b/test/solr9-jetty-bridge-spike.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# Exercise the generated Solr 9.0 bridge. Run `ant compile` first. An optional +# Exercise the generated Solr 9.10 bridge. Run `ant compile` first. An optional # JETTY12_CLASSPATH verifies coexistence with already resolved Jetty 12 jars. set -eu @@ -36,4 +36,4 @@ javac --release 17 -cp "$classpath" -d "$work" \ java -cp "$work:$classpath" org.junit.runner.JUnitCore \ net.yacy.cora.federate.solr.connector.EmbeddedSolrConnectorTest -echo "PASS: integrated Solr 9.0 bridge starts, updates, queries and closes." +echo "PASS: integrated Solr 9.10 bridge starts, updates, queries and closes." -- cgit v1.2.3