Skip to content

Apache Lucene open-source search software

switch Solr to really run off lucene trunk rather than just copy jars - still needs some love (too many duplicate lucene refs for one) but its a start

Mark Robert Millercd490f915a00
diff --git a/build.xml b/build.xml
index cdd57ffd2d8..3046f04ee87 100644
--- a/build.xml
+++ b/build.xml
@@ -33,24 +33,6 @@
</sequential>
</target>
- <target name="lucene-jars-to-solr">
- <!-- temp hack - copy lucene jars to solr -->
-
- <copy todir="solr/lib" preservelastmodified="true" flatten="true">
- <resources>
- <file file="lucene/build/lucene-core-${lucene.version}.jar" />
- <file file="lucene/build/contrib/analyzers/common/lucene-analyzers-${lucene.version}.jar" />
- <file file="lucene/build/contrib/fast-vector-highlighter/lucene-fast-vector-highlighter-${lucene.version}.jar" />
- <file file="lucene/build/contrib/highlighter/lucene-highlighter-${lucene.version}.jar" />
- <file file="lucene/build/contrib/memory/lucene-memory-${lucene.version}.jar" />
- <file file="lucene/build/contrib/misc/lucene-misc-${lucene.version}.jar" />
- <file file="lucene/build/contrib/queries/lucene-queries-${lucene.version}.jar" />
- <file file="lucene/build/contrib/spatial/lucene-spatial-${lucene.version}.jar" />
- <file file="lucene/build/contrib/spellchecker/lucene-spellchecker-${lucene.version}.jar" />
- </resources>
- </copy>
- </target>
-
<target name="clean">
<sequential>
<subant target="clean" inheritall="false" failonerror="true">
diff --git a/solr/build.xml b/solr/build.xml
index 334061e66d1..1267da8be36 100644
--- a/solr/build.xml
+++ b/solr/build.xml
@@ -87,7 +87,7 @@
<target name="init-forrest-entities">
<!-- no description, don't advertise -->
-
+ <!-- Building off Lucene trunk, we don't need this
<available file="lib/lucene-core-${lucene_version}.jar"
property="lucene-version-ok-m2deploy-wont-fail" />
<fail unless="lucene-version-ok-m2deploy-wont-fail">
@@ -99,7 +99,7 @@
Probably cause: lucene jars were upgraded w/o modifying the
'lucene_version' property in common-build.xml
</fail>
-
+ -->
<mkdir dir="${dest}" />
@@ -116,12 +116,24 @@
<!-- ===================== COMPILATION-RELATED TASKS ========================= -->
<!-- ========================================================================= -->
+ <path id="lucene.classpath">
+ <pathelement location="../lucene/build/classes/java" />
+ <pathelement location="../lucene/build/contrib/analyzers/common/classes/java" />
+ <pathelement location="../lucene/build/contrib/fast-vector-highlighter/classes/java" />
+ <pathelement location="../lucene/build/contrib/highlighter/classes/java" />
+ <pathelement location="../lucene/build/contrib/memory/classes/java" />
+ <pathelement location="../lucene/build/contrib/misc/classes/java" />
+ <pathelement location="../lucene/build/contrib/queries/classes/java" />
+ <pathelement location="../lucene/build/contrib/spatial/classes/java" />
+ <pathelement location="../lucene/build/contrib/spellchecker/classes/java" />
+ </path>
+
<!-- The compilation classpath -->
<path id="compile.classpath">
<fileset dir="${lib}">
<include name="*.jar" />
</fileset>
- <pathelement location="${dest}/common"/>
+ <path refid="lucene.classpath"/>
</path>
<target name="compile-solrj"
@@ -149,7 +161,7 @@
<!-- Compile the project. -->
<target name="compile"
description="Compile the source code."
- depends="compile-solrj,init-forrest-entities">
+ depends="compile-lucene, compile-solrj,init-forrest-entities">
<solr-javac destdir="${dest}/solr"
classpathref="compile.classpath.solrj">
@@ -339,18 +351,15 @@
<path id="test.compile.classpath">
<path refid="compile.classpath" />
<path refid="compile.classpath.solrj" />
-
<pathelement location="${dest}/solr"/>
<pathelement location="${dest}/solrj"/> <!-- include solrj -->
</path>
<path id="test.run.classpath">
<path refid="test.compile.classpath" />
- <pathelement location="${dest}/tests"/>
-
- <!-- include the solrj classpath and jetty files included in example -->
+ <pathelement location="${dest}/tests"/>
+ <!-- include the solrj classpath and jetty files included in example -->
<path refid="compile.classpath.solrj" />
-
<pathelement path="${java.class.path}"/>
</path>
@@ -396,7 +405,7 @@
failureProperty="tests.failed"
dir="src/test/test-files/"
>
- <sysproperty key="java.util.logging.config.file" value="${common.dir}/testlogging.properties"/>
+ <sysproperty key="java.util.logging.config.file" value="${common-solr.dir}/testlogging.properties"/>
<sysproperty key="tests.luceneMatchVersion" value="${tests.luceneMatchVersion}"/>
<jvmarg line="${args}"/>
<formatter type="brief" usefile="false" if="junit.details"/>
@@ -492,7 +501,7 @@
<!-- Creates the Solr WAR file. -->
<target name="dist-war"
description="Creates the Solr WAR Distribution file."
- depends="compile, make-manifest, dist-jar, dist-solrj">
+ depends="compile, make-manifest, dist-jar, dist-solrj, lucene-jars-to-solr">
<mkdir dir="${dist}" />
<war destfile="${dist}/${fullnamever}.war"
webxml="${web.xml}"
@@ -505,6 +514,9 @@
<exclude name="*.txt" />
<exclude name="*.template" />
</lib>
+
+ <lib dir="lucene-libs"/>
+
<lib dir="${dist}">
<include name="${fullname}-solrj-${version}.jar" />
<include name="${fullname}-core-${version}.jar" />
@@ -637,6 +649,53 @@
</java>
</target>
+
+ <target name="prep-lucene-jars">
+ <sequential>
+ <subant target="jar-core" inheritall="false" failonerror="true">
+ <fileset dir="../lucene/" includes="build.xml" />
+ </subant>
+ <subant target="jar" inheritall="false" failonerror="true">
+ <fileset dir="../lucene/contrib/analyzers/common" includes="build.xml" />
+ <fileset dir="../lucene/contrib/fast-vector-highlighter" includes="build.xml" />
+ <fileset dir="../lucene/contrib/highlighter" includes="build.xml" />
+ <fileset dir="../lucene/contrib/memory" includes="build.xml" />
+ <fileset dir="../lucene/contrib/misc" includes="build.xml" />
+ <fileset dir="../lucene/contrib/queries" includes="build.xml" />
+ <fileset dir="../lucene/contrib/spatial" includes="build.xml" />
+ <fileset dir="../lucene/contrib/spellchecker" includes="build.xml" />
+ </subant>
+ </sequential>
+ </target>
+
+ <target name="lucene-jars-to-solr" depends="prep-lucene-jars">
+ <mkdir dir="lucene-libs"/>
+ <copy todir="lucene-libs" preservelastmodified="true" flatten="true" failonerror="true">
+ <resources>
+ <file file="../lucene/build/lucene-core-${lucene_version}.jar" />
+ <file file="../lucene/build/contrib/analyzers/common/lucene-analyzers-${lucene_version}.jar" />
+ <file file="../lucene/build/contrib/fast-vector-highlighter/lucene-fast-vector-highlighter-${lucene_version}.jar" />
+ <file file="../lucene/build/contrib/highlighter/lucene-highlighter-${lucene_version}.jar" />
+ <file file="../lucene/build/contrib/memory/lucene-memory-${lucene_version}.jar" />
+ <file file="../lucene/build/contrib/misc/lucene-misc-${lucene_version}.jar" />
+ <file file="../lucene/build/contrib/queries/lucene-queries-${lucene_version}.jar" />
+ <file file="../lucene/build/contrib/spatial/lucene-spatial-${lucene_version}.jar" />
+ <file file="../lucene/build/contrib/spellchecker/lucene-spellchecker-${lucene_version}.jar" />
+ </resources>
+ </copy>
+ </target>
+
+ <target name="compile-lucene">
+ <ant antfile="build.xml" target="compile" dir="../lucene"/>
+ <ant antfile="build.xml" target="compile" dir="../lucene/contrib/analyzers/common"/>
+ <ant antfile="build.xml" target="compile" dir="../lucene/contrib/fast-vector-highlighter"/>
+ <ant antfile="build.xml" target="compile" dir="../lucene/contrib/highlighter"/>
+ <ant antfile="build.xml" target="compile" dir="../lucene/contrib/memory"/>
+ <ant antfile="build.xml" target="compile" dir="../lucene/contrib/misc"/>
+ <ant antfile="build.xml" target="compile" dir="../lucene/contrib/queries"/>
+ <ant antfile="build.xml" target="compile" dir="../lucene/contrib/spatial"/>
+ <ant antfile="build.xml" target="compile" dir="../lucene/contrib/spellchecker"/>
+ </target>
<!-- make a distribution -->
<target name="package" depends="generate-maven-artifacts"/>
diff --git a/solr/common-build.xml b/solr/common-build.xml
index 0ee504de3a8..5cca8b89dc0 100644
--- a/solr/common-build.xml
+++ b/solr/common-build.xml
@@ -15,13 +15,13 @@
limitations under the License.
-->
-<project name="common" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
+<project name="common-solr" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<description>
This file is designed for importing into a main build file, and not intended
for standalone use.
</description>
- <dirname file="${ant.file.common}" property="common.dir"/>
+ <dirname file="${ant.file.common}" property="common-solr.dir"/>
<!-- Initialize property values: allow easy customization via build.properties -->
<property file="build.properties" />
@@ -42,7 +42,7 @@
<property name="args" value="" />
<!-- Example directory -->
- <property name="example" value="${common.dir}/example" />
+ <property name="example" value="${common-solr.dir}/example" />
<!--
we attempt to exec svnversion to get details build information
for jar manifests. this property can be set at runtime to an
@@ -95,13 +95,13 @@
value="http://lucene.apache.org/java/3_1_0/api/all/"/>
<property name="javadoc.packages" value="org.apache.solr.*"/>
<property name="build.docs" value="${dest}/docs"/>
- <property name="build.javadoc" value="${common.dir}/${build.docs}/api"/>
+ <property name="build.javadoc" value="${common-solr.dir}/${build.docs}/api"/>
<property name="build.javadoc.solrj" value="${build.docs}/api-solrj"/>
<!-- JUnit properties -->
<property name="junit.includes" value="**/Test*.java,**/*Test.java"/>
- <property name="junit.output.dir" location="${common.dir}/${dest}/test-results"/>
- <property name="junit.reports" location="${common.dir}/${dest}/test-results/reports"/>
+ <property name="junit.output.dir" location="${common-solr.dir}/${dest}/test-results"/>
+ <property name="junit.reports" location="${common-solr.dir}/${dest}/test-results/reports"/>
<property name="junit.formatter" value="plain"/>
<!-- Maven properties -->
@@ -131,7 +131,7 @@
<available property="maven.ant.tasks.present" classname="org.apache.maven.artifact.ant.Pom" />
<!-- End Maven Properties -->
-
+
<available property="clover.present"
classname="com.cenqua.clover.tasks.CloverReportTask"
/>
@@ -168,7 +168,7 @@
<attribute name="basedir" default="." />
<attribute name="includes" default="org/apache/**" />
<attribute name="excludes" default="" />
- <attribute name="manifest" default="${common.dir}/${dest}/META-INF/MANIFEST.MF" />
+ <attribute name="manifest" default="${common-solr.dir}/${dest}/META-INF/MANIFEST.MF" />
<element name="nested" optional="true" implicit="true" />
<sequential>
<jar destfile="@{destfile}"
@@ -177,7 +177,7 @@
excludes="@{excludes}"
filesetmanifest="skip"
manifest="@{manifest}">
- <metainf dir="${common.dir}" includes="LICENSE.txt,NOTICE.txt"/>
+ <metainf dir="${common-solr.dir}" includes="LICENSE.txt,NOTICE.txt"/>
<nested />
</jar>
</sequential>
diff --git a/solr/contrib/clustering/build.xml b/solr/contrib/clustering/build.xml
index b9a18f07024..4642103a47b 100644
--- a/solr/contrib/clustering/build.xml
+++ b/solr/contrib/clustering/build.xml
@@ -30,11 +30,24 @@
<property name="download.dir" value="lib/downloads"/>
<property name="example.local" value="example"/>
+ <path id="lucene.classpath">
+ <pathelement location="../../../lucene/build/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/analyzers/common/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/fast-vector-highlighter/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/highlighter/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/memory/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/misc/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/queries/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/spatial/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/spellchecker/classes/java" />
+ </path>
+
<path id="common.classpath">
<fileset dir="lib"/>
<fileset dir="${download.dir}"/>
<pathelement location="${solr-path}/build/solr"/>
<pathelement location="${solr-path}/build/solrj"/>
+ <path refid="lucene.classpath"/>
<fileset dir="${solr-path}/lib" includes="*.jar"/>
</path>
@@ -106,7 +119,7 @@
<target name="build" depends="compile">
<solr-jar destfile="${dest}/${fullnamever}.jar" basedir="${dest}/classes"
- manifest="${common.dir}/${dest}/META-INF/MANIFEST.MF"/>
+ manifest="../../${dest}/META-INF/MANIFEST.MF"/>
</target>
<target name="compileTests" depends="compile">
diff --git a/solr/contrib/dataimporthandler/build.xml b/solr/contrib/dataimporthandler/build.xml
index b2832a79acb..107d1af7d48 100644
--- a/solr/contrib/dataimporthandler/build.xml
+++ b/solr/contrib/dataimporthandler/build.xml
@@ -24,6 +24,18 @@
<import file="../../common-build.xml"/>
+ <path id="lucene.classpath">
+ <pathelement location="../../../lucene/build/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/analyzers/common/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/fast-vector-highlighter/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/highlighter/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/memory/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/misc/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/queries/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/spatial/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/spellchecker/classes/java" />
+ </path>
+
<description>
Data Import Handler
</description>
@@ -37,6 +49,7 @@
<pathelement location="${solr-path}/build/solr" />
<pathelement location="${solr-path}/build/solrj" />
<fileset dir="${solr-path}/lib" includes="*.jar"/>
+ <path refid="lucene.classpath"/>
</path>
<path id="extras.classpath">
@@ -103,9 +116,9 @@
<target name="build" depends="compile,compileExtras">
<solr-jar destfile="target/${fullnamever}.jar" basedir="target/classes"
- manifest="${common.dir}/${dest}/META-INF/MANIFEST.MF" />
+ manifest="../../${dest}/META-INF/MANIFEST.MF" />
<solr-jar destfile="target/apache-${ant.project.name}-extras-${version}.jar" basedir="target/extras/classes"
- manifest="${common.dir}/${dest}/META-INF/MANIFEST.MF" />
+ manifest="../../${dest}/META-INF/MANIFEST.MF" />
</target>
<target name="compileTests" depends="compile">
diff --git a/solr/contrib/extraction/build.xml b/solr/contrib/extraction/build.xml
index 471389a1e86..510970249ee 100644
--- a/solr/contrib/extraction/build.xml
+++ b/solr/contrib/extraction/build.xml
@@ -25,6 +25,18 @@
<import file="../../common-build.xml"/>
+ <path id="lucene.classpath">
+ <pathelement location="../../../lucene/build/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/analyzers/common/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/fast-vector-highlighter/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/highlighter/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/memory/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/misc/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/queries/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/spatial/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/spellchecker/classes/java" />
+ </path>
+
<description>
Solr Integration with Tika for extracting content from binary file formats such as Microsoft Word and Adobe PDF.
</description>
@@ -34,6 +46,7 @@
<pathelement location="${solr-path}/build/solrj" />
<fileset dir="lib" includes="*.jar"/>
<fileset dir="${solr-path}/lib" includes="*.jar"/>
+ <path refid="lucene.classpath"/>
</path>
<path id="test.classpath">
@@ -63,7 +76,7 @@
<target name="build" depends="compile">
<solr-jar destfile="${dest}/${fullnamever}.jar" basedir="${dest}/classes"
- manifest="${common.dir}/${dest}/META-INF/MANIFEST.MF">
+ manifest="../../${dest}/META-INF/MANIFEST.MF">
<!--<zipfileset src="${tika.lib}"/>-->
</solr-jar>
</target>
diff --git a/solr/contrib/velocity/build.xml b/solr/contrib/velocity/build.xml
index 3f2b71209f4..a0faaa8a8d4 100644
--- a/solr/contrib/velocity/build.xml
+++ b/solr/contrib/velocity/build.xml
@@ -23,6 +23,18 @@
<import file="../../common-build.xml"/>
+ <path id="lucene.classpath">
+ <pathelement location="../../../lucene/build/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/analyzers/common/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/fast-vector-highlighter/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/highlighter/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/memory/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/misc/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/queries/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/spatial/classes/java" />
+ <pathelement location="../../../lucene/build/contrib/spellchecker/classes/java" />
+ </path>
+
<description>
Solritas: Velocity Response Writer
</description>
@@ -32,6 +44,7 @@
<pathelement location="${solr-path}/build/solr" />
<fileset dir="src/main/solr/lib" includes="*.jar"/>
<fileset dir="${solr-path}/lib" includes="*.jar"></fileset>
+ <path refid="lucene.classpath"/>
</path>
<path id="test.classpath">
@@ -61,7 +74,7 @@
<target name="build" depends="compile">
<solr-jar destfile="src/main/solr/lib/${fullnamever}.jar" basedir="target/classes"
- manifest="${common.dir}/${dest}/META-INF/MANIFEST.MF">
+ manifest="../../${dest}/META-INF/MANIFEST.MF">
<fileset dir="src/main/java" excludes="**/*.java"/>
</solr-jar>
</target>
diff --git a/solr/lib/lucene-analyzers-3.1-dev.jar b/solr/lib/lucene-analyzers-3.1-dev.jar
deleted file mode 100644
index cef807be50e..00000000000
--- a/solr/lib/lucene-analyzers-3.1-dev.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[b0cbcc9f623660e1a8ccdf2d22e0f9847687b260] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/lucene-core-3.1-dev.jar b/solr/lib/lucene-core-3.1-dev.jar
deleted file mode 100644
index 2be38db7b13..00000000000
--- a/solr/lib/lucene-core-3.1-dev.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[a3e0b5ba94c0be4f1b90678a3edad30f5bda7bda] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/lucene-fast-vector-highlighter-3.1-dev.jar b/solr/lib/lucene-fast-vector-highlighter-3.1-dev.jar
deleted file mode 100644
index 2059a2fdbc5..00000000000
--- a/solr/lib/lucene-fast-vector-highlighter-3.1-dev.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[9a1be03163402a081ca97f77cbc9fb9e0ece9ea8] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/lucene-highlighter-3.1-dev.jar b/solr/lib/lucene-highlighter-3.1-dev.jar
deleted file mode 100644
index be75c98b37d..00000000000
--- a/solr/lib/lucene-highlighter-3.1-dev.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[80a77c9bf82d5e170629e022160ef33f7328a6d1] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/lucene-memory-3.1-dev.jar b/solr/lib/lucene-memory-3.1-dev.jar
deleted file mode 100644
index d491cff09a8..00000000000
--- a/solr/lib/lucene-memory-3.1-dev.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[3b4288125250d3860d6323669c79b9e8a89f642f] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/lucene-misc-3.1-dev.jar b/solr/lib/lucene-misc-3.1-dev.jar
deleted file mode 100644
index 2131ca2451b..00000000000
--- a/solr/lib/lucene-misc-3.1-dev.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[55da71e9537b5d05aee891cdf24abcfeb516ac5b] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/lucene-queries-3.1-dev.jar b/solr/lib/lucene-queries-3.1-dev.jar
deleted file mode 100644
index 610dde528ca..00000000000
--- a/solr/lib/lucene-queries-3.1-dev.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[d02ab15d502b54929e9129c923de9d52ae8e2b20] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/lucene-spatial-3.1-dev.jar b/solr/lib/lucene-spatial-3.1-dev.jar
deleted file mode 100644
index 0b3173e91df..00000000000
--- a/solr/lib/lucene-spatial-3.1-dev.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[b6add459cd59cde7e7cbf95b56cf57cab172d0e9] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/lucene-spellchecker-3.1-dev.jar b/solr/lib/lucene-spellchecker-3.1-dev.jar
deleted file mode 100644
index 40c3bc32b8d..00000000000
--- a/solr/lib/lucene-spellchecker-3.1-dev.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[42b53bd657ba935286f349d24ebb7641bd9e3cc7] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file