Apache Nutch is an extensible and scalable web crawler
NUTCH-2780 : Upgrade index-solr to use Solr 8.5.1
balashashankaca457fcc3e0d
diff --git a/src/plugin/indexer-solr/build-ivy.xml b/src/plugin/indexer-solr/build-ivy.xmlindex 3f7e959ad..fe4d8c467 100644--- a/src/plugin/indexer-solr/build-ivy.xml+++ b/src/plugin/indexer-solr/build-ivy.xml@@ -17,7 +17,7 @@--><project name="indexer-solr" default="deps-jar" xmlns:ivy="antlib:org.apache.ivy.ant">- <property name="ivy.install.version" value="2.1.0" />+ <property name="ivy.install.version" value="2.4.0" /><condition property="ivy.home" value="${env.IVY_HOME}"><isset property="env.IVY_HOME" /></condition>diff --git a/src/plugin/indexer-solr/howto_upgrade_solr.txt b/src/plugin/indexer-solr/howto_upgrade_solr.txtnew file mode 100644index 000000000..b2a7eb5c8--- /dev/null+++ b/src/plugin/indexer-solr/howto_upgrade_solr.txt@@ -0,0 +1,33 @@+1. Upgrade Solr dependency in src/plugin/indexer-solr/ivy.xml++2. Upgrade the Solr specific dependencies in src/plugin/indexer-solr/plugin.xml+ To get the list of dependencies and their versions execute:+ $ cd src/plugin/indexer-solr/+ $ ant -f ./build-ivy.xml+ $ ls lib | sed 's/^/ <library name="/g' | sed 's/$/"\/>/g'++ In the plugin.xml replace all lines between+ <!-- Solr dependencies -->+ and+ <!-- end of Solr dependencies -->+ with the output of the command above.++4. (Optionally) remove overlapping dependencies between indexer-solr and Nutch core dependencies:+ - check for libs present both in+ build/lib+ and+ build/plugins/indexer-solr/+ (eventually with different versions)+ - duplicated libs can be added to the exclusions of transitive dependencies in+ build/plugins/indexer-solr/ivy.xml+ - but it should be made sure that the library versions in ivy/ivy.xml correspend to+ those required by Tika++5. Remove the locally "installed" dependencies in src/plugin/indexer-solr/lib/:++ $ rm -rf lib/++6. Build Nutch and run all unit tests:++ $ cd ../../../+ $ ant clean runtime test\ No newline at end of filediff --git a/src/plugin/indexer-solr/ivy.xml b/src/plugin/indexer-solr/ivy.xmlindex 1322e9190..43dfd20b4 100644--- a/src/plugin/indexer-solr/ivy.xml+++ b/src/plugin/indexer-solr/ivy.xml@@ -1,44 +1,47 @@<?xml version="1.0" ?>-<!--- Licensed to the Apache Software Foundation (ASF) under one or more- contributor license agreements. See the NOTICE file distributed with- this work for additional information regarding copyright ownership.- The ASF licenses this file to You under the Apache License, Version 2.0- (the "License"); you may not use this file except in compliance with- the License. You may obtain a copy of the License at-- http://www.apache.org/licenses/LICENSE-2.0-- Unless required by applicable law or agreed to in writing, software- distributed under the License is distributed on an "AS IS" BASIS,- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- See the License for the specific language governing permissions and- limitations under the License.--->+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor+ license agreements. See the NOTICE file distributed with this work for additional+ information regarding copyright ownership. The ASF licenses this file to+ You under the Apache License, Version 2.0 (the "License"); you may not use+ this file except in compliance with the License. You may obtain a copy of+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required+ by applicable law or agreed to in writing, software distributed under the+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS+ OF ANY KIND, either express or implied. See the License for the specific+ language governing permissions and limitations under the License. --><ivy-module version="1.0">- <info organisation="org.apache.nutch" module="${ant.project.name}">- <license name="Apache 2.0"/>- <ivyauthor name="Apache Nutch Team" url="https://nutch.apache.org/"/>- <description>- Apache Nutch- </description>- </info>+ <info organisation="org.apache.nutch" module="${ant.project.name}">+ <license name="Apache 2.0" />+ <ivyauthor name="Apache Nutch Team"+ url="https://nutch.apache.org/" />+ <description>+ Apache Nutch+ </description>+ </info>++ <configurations>+ <include file="../../..//ivy/ivy-configurations.xml" />+ </configurations>- <configurations>- <include file="../../..//ivy/ivy-configurations.xml"/>- </configurations>+ <publications>+ <!--get the artifact from our module name -->+ <artifact conf="master" />+ </publications>- <publications>- <!--get the artifact from our module name-->- <artifact conf="master"/>- </publications>+ <dependencies>+ <dependency org="org.apache.solr" name="solr-solrj"+ rev="8.5.1">+ <!-- exclusions of dependencies provided by Nutch core -->+ <exclude org="org.apache.commons" name="commons-codec" />+ <exclude org="org.apache.commons" name="commons-logging" />+ <exclude org="org.slf4j" name="slf4j-api" />+ </dependency>+ <dependency org="org.apache.httpcomponents" name="httpmime"+ rev="4.5.10" conf="*->default" />+ <dependency org="org.apache.httpcomponents" name="httpcore"+ rev="4.4.12" conf="*->default" />+ </dependencies>- <dependencies>- <dependency org="org.apache.solr" name="solr-solrj" rev="8.5.1"/>- <dependency org="org.apache.httpcomponents" name="httpcore" rev="4.4.12" conf="*->default"/>- <dependency org="org.apache.httpcomponents" name="httpmime" rev="4.5.10" conf="*->default"/>- </dependencies>-</ivy-module>diff --git a/src/plugin/indexer-solr/plugin.xml b/src/plugin/indexer-solr/plugin.xmlindex 0d9aacd30..3738bd65c 100644--- a/src/plugin/indexer-solr/plugin.xml+++ b/src/plugin/indexer-solr/plugin.xml@@ -1,68 +1,64 @@<?xml version="1.0" encoding="UTF-8"?>-<!--- Licensed to the Apache Software Foundation (ASF) under one or more- contributor license agreements. See the NOTICE file distributed with- this work for additional information regarding copyright ownership.- The ASF licenses this file to You under the Apache License, Version 2.0- (the "License"); you may not use this file except in compliance with- the License. You may obtain a copy of the License at-- http://www.apache.org/licenses/LICENSE-2.0-- Unless required by applicable law or agreed to in writing, software- distributed under the License is distributed on an "AS IS" BASIS,- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- See the License for the specific language governing permissions and- limitations under the License.--->+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor+ license agreements. See the NOTICE file distributed with this work for additional+ information regarding copyright ownership. The ASF licenses this file to+ You under the Apache License, Version 2.0 (the "License"); you may not use+ this file except in compliance with the License. You may obtain a copy of+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required+ by applicable law or agreed to in writing, software distributed under the+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS+ OF ANY KIND, either express or implied. See the License for the specific+ language governing permissions and limitations under the License. --><plugin id="indexer-solr" name="SolrIndexWriter" version="1.0.0"- provider-name="nutch.apache.org">+ provider-name="nutch.apache.org">- <runtime>- <library name="indexer-solr.jar">- <export name="*" />- </library>- <library name="commons-io-2.6.jar"/>- <library name="netty-buffer-4.1.29.Final.jar"/>- <library name="netty-codec-4.1.29.Final.jar"/>- <library name="netty-common-4.1.29.Final.jar"/>- <library name="netty-handler-4.1.29.Final.jar"/>- <library name="netty-resolver-4.1.29.Final.jar"/>- <library name="netty-transport-4.1.29.Final.jar"/>- <library name="netty-transport-native-epoll-4.1.29.Final.jar"/>- <library name="netty-transport-native-unix-common-4.1.29.Final.jar"/>- <library name="commons-math3-3.6.1.jar"/>- <library name="httpclient-4.5.10.jar"/>- <library name="httpcore-4.4.6.jar"/>- <library name="httpmime-4.5.3.jar"/>- <library name="zookeeper-3.5.5.jar"/>- <library name="zookeeper-jute-3.5.5.jar"/>- <library name="stax2-api-3.1.4.jar"/>- <library name="woodstox-core-asl-4.4.1.jar"/>- <library name="jetty-alpn-client-9.4.24.v20191120.jar"/>- <library name="jetty-alpn-java-client-9.4.24.v20191120.jar"/>- <library name="jetty-client-9.4.24.v20191120.jar"/>- <library name="jetty-http-9.4.24.v20191120.jar"/>- <library name="jetty-io-9.4.24.v20191120.jar"/>- <library name="jetty-util-9.4.24.v20191120.jar"/>- <library name="http2-client-9.4.24.v20191120.jar"/>- <library name="http2-common-9.4.24.v20191120.jar"/>- <library name="http2-hpack-9.4.24.v20191120.jar"/>- <library name="http2-http-client-transport-9.4.24.v20191120.jar"/>- <library name="jcl-over-slf4j-1.7.24.jar"/>- <library name="slf4j-api-1.7.24.jar"/>- <library name="solr-solrj-8.5.1.jar"/>- </runtime>+ <runtime>+ <library name="indexer-solr.jar">+ <export name="*" />+ </library>+ <!-- Solr dependencies -->+ <library name="commons-io-2.6.jar" />+ <library name="netty-buffer-4.1.29.Final.jar" />+ <library name="netty-codec-4.1.29.Final.jar" />+ <library name="netty-common-4.1.29.Final.jar" />+ <library name="netty-handler-4.1.29.Final.jar" />+ <library name="netty-resolver-4.1.29.Final.jar" />+ <library name="netty-transport-4.1.29.Final.jar" />+ <library name="netty-transport-native-epoll-4.1.29.Final.jar" />+ <library+ name="netty-transport-native-unix-common-4.1.29.Final.jar" />+ <library name="commons-math3-3.6.1.jar" />+ <library name="httpmime-4.5.10.jar" />+ <library name="httpclient-4.5.10.jar" />+ <library name="httpcore-4.4.12.jar" />+ <library name="zookeeper-3.5.5.jar" />+ <library name="zookeeper-jute-3.5.5.jar" />+ <library name="stax2-api-3.1.4.jar" />+ <library name="woodstox-core-asl-4.4.1.jar" />+ <library name="jetty-alpn-client-9.4.24.v20191120.jar" />+ <library name="jetty-alpn-java-client-9.4.24.v20191120.jar" />+ <library name="jetty-client-9.4.24.v20191120.jar" />+ <library name="jetty-http-9.4.24.v20191120.jar" />+ <library name="jetty-io-9.4.24.v20191120.jar" />+ <library name="jetty-util-9.4.24.v20191120.jar" />+ <library name="http2-client-9.4.24.v20191120.jar" />+ <library name="http2-common-9.4.24.v20191120.jar" />+ <library name="http2-hpack-9.4.24.v20191120.jar" />+ <library+ name="http2-http-client-transport-9.4.24.v20191120.jar" />+ <library name="jcl-over-slf4j-1.7.24.jar" />+ <!-- end of Solr dependencies -->+ <library name="solr-solrj-8.5.1.jar" />+ </runtime>- <requires>- <import plugin="nutch-extensionpoints" />- </requires>+ <requires>+ <import plugin="nutch-extensionpoints" />+ </requires>- <extension id="org.apache.nutch.indexer.solr"- name="Solr Index Writer"- point="org.apache.nutch.indexer.IndexWriter">- <implementation id="SolrIndexWriter"- class="org.apache.nutch.indexwriter.solr.SolrIndexWriter" />- </extension>+ <extension id="org.apache.nutch.indexer.solr"+ name="Solr Index Writer" point="org.apache.nutch.indexer.IndexWriter">+ <implementation id="SolrIndexWriter"+ class="org.apache.nutch.indexwriter.solr.SolrIndexWriter" />+ </extension></plugin>