Skip to content

Apache Lucene open-source search software

LUCENE-3930: nuke jars from source tree and use ivy

Robert Muir8f0d7cc13590
diff --git a/build.xml b/build.xml
index 817fc204556..40a98707926 100644
--- a/build.xml
+++ b/build.xml
@@ -46,6 +46,14 @@
</subant></sequential>
</target>
+ <target name="resolve" description="Resolves all dependencies">
+ <sequential><subant target="resolve" inheritall="false" failonerror="true">
+ <fileset dir="lucene" includes="build.xml" />
+ <fileset dir="modules" includes="build.xml" />
+ <fileset dir="solr" includes="build.xml" />
+ </subant></sequential>
+ </target>
+
<target name="compile" description="Compile Lucene and Solr">
<sequential>
@@ -83,7 +91,7 @@
</sequential>
</target>
- <target name="eclipse" description="Setup Eclipse configuration">
+ <target name="eclipse" description="Setup Eclipse configuration" depends="resolve">
<copy file="dev-tools/eclipse/dot.project" tofile=".project" overwrite="false"/>
<copy file="dev-tools/eclipse/dot.classpath" tofile=".classpath" overwrite="true"/>
<mkdir dir=".settings"/>
@@ -96,13 +104,13 @@
</echo>
</target>
- <target name="idea" description="Setup IntelliJ IDEA configuration">
+ <target name="idea" description="Setup IntelliJ IDEA configuration" depends="resolve">
<copy todir=".">
<fileset dir="dev-tools/idea"/>
</copy>
<echo>
To complete IntelliJ IDEA setup, you must manually configure
- Project Structure | Project | Project SDK.
+ File | Project Structure | Project | Project SDK.
</echo>
</target>
<target name="clean-idea"
@@ -128,8 +136,20 @@
</sequential>
</target>
- <!-- temporarily added before LUCENE-3930, to avoid
- any broken builds from timing issues: so hudson
- won't invoke ant target that does not exist -->
- <target name="clean-jars"/>
+ <!-- TODO: in the future, we don't need to actually put
+ jars in the lib/ folders, but can just put in classpath.
+ only packaging tasks really need that (and could do it
+ under build/ directories) -->
+ <target name="clean-jars" description="Clean local jars">
+ <delete>
+ <fileset dir="." includes="**/*.jar"/>
+ </delete>
+ </target>
+
+ <target name="ivy-bootstrap">
+ <subant target="ivy-bootstrap" inheritall="false" failonerror="true">
+ <fileset dir="lucene" includes="build.xml" />
+ </subant>
+ </target>
+
</project>
diff --git a/dev-tools/eclipse/dot.classpath b/dev-tools/eclipse/dot.classpath
index 522d73a8105..2f6f1ec737e 100644
--- a/dev-tools/eclipse/dot.classpath
+++ b/dev-tools/eclipse/dot.classpath
@@ -90,19 +90,17 @@
<classpathentry kind="src" path="solr/contrib/velocity/src/java"/>
<classpathentry kind="src" path="solr/contrib/velocity/src/test"/>
<classpathentry kind="src" path="solr/contrib/velocity/src/test-files"/>
- <classpathentry kind="lib" path="lucene/lib/ant-1.7.1.jar"/>
- <classpathentry kind="lib" path="lucene/lib/ant-junit-1.7.1.jar"/>
- <classpathentry kind="lib" path="lucene/lib/junit-4.10.jar"/>
+ <classpathentry kind="lib" path="lucene/test-framework/lib/ant-1.7.1.jar"/>
+ <classpathentry kind="lib" path="lucene/test-framework/lib/ant-junit-1.7.1.jar"/>
+ <classpathentry kind="lib" path="lucene/test-framework/lib/junit-4.10.jar"/>
<classpathentry kind="lib" path="lucene/contrib/sandbox/lib/jakarta-regexp-1.4.jar"/>
- <classpathentry kind="lib" path="modules/analysis/icu/lib/icu4j-4_8_1_1.jar"/>
+ <classpathentry kind="lib" path="modules/analysis/icu/lib/icu4j-4.8.1.1.jar"/>
<classpathentry kind="lib" path="modules/analysis/phonetic/lib/commons-codec-1.6.jar"/>
<classpathentry kind="lib" path="modules/analysis/morfologik/lib/morfologik-fsa-1.5.2.jar"/>
<classpathentry kind="lib" path="modules/analysis/morfologik/lib/morfologik-polish-1.5.2.jar"/>
<classpathentry kind="lib" path="modules/analysis/morfologik/lib/morfologik-stemming-1.5.2.jar"/>
<classpathentry kind="lib" path="modules/benchmark/lib/commons-compress-1.2.jar"/>
<classpathentry kind="lib" path="modules/benchmark/lib/xercesImpl-2.9.1.jar"/>
- <classpathentry kind="lib" path="solr/lib/apache-solr-noggit-r1211150.jar"/>
- <classpathentry kind="lib" path="solr/lib/apache-solr-commons-csv-1.0-SNAPSHOT-r966014.jar"/>
<classpathentry kind="lib" path="solr/lib/commons-fileupload-1.2.1.jar"/>
<classpathentry kind="lib" path="solr/lib/httpclient-4.1.3.jar"/>
<classpathentry kind="lib" path="solr/lib/httpcore-4.1.4.jar"/>
@@ -159,13 +157,13 @@
<classpathentry kind="lib" path="solr/contrib/extraction/lib/tika-core-1.0.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/tika-parsers-1.0.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/xmlbeans-2.3.0.jar"/>
- <classpathentry kind="lib" path="solr/contrib/langid/lib/langdetect-r111.jar"/>
+ <classpathentry kind="lib" path="solr/contrib/langid/lib/langdetect-c51112119be53a81e59706ce57bacaa90c052284.jar"/>
<classpathentry kind="lib" path="solr/contrib/langid/lib/jsonic-1.2.0.jar"/>
<classpathentry kind="lib" path="solr/contrib/uima/lib/commons-digester-2.0.jar"/>
- <classpathentry kind="lib" path="solr/contrib/uima/lib/uima-an-alchemy-2.3.1.jar"/>
- <classpathentry kind="lib" path="solr/contrib/uima/lib/uima-an-calais-2.3.1.jar"/>
- <classpathentry kind="lib" path="solr/contrib/uima/lib/uima-an-tagger-2.3.1.jar"/>
- <classpathentry kind="lib" path="solr/contrib/uima/lib/uima-an-wst-2.3.1.jar"/>
+ <classpathentry kind="lib" path="solr/contrib/uima/lib/AlchemyAPIAnnotator-2.3.1.jar"/>
+ <classpathentry kind="lib" path="solr/contrib/uima/lib/OpenCalaisAnnotator-2.3.1.jar"/>
+ <classpathentry kind="lib" path="solr/contrib/uima/lib/Tagger-2.3.1.jar"/>
+ <classpathentry kind="lib" path="solr/contrib/uima/lib/WhitespaceTokenizer-2.3.1.jar"/>
<classpathentry kind="lib" path="solr/contrib/uima/lib/uimaj-core-2.3.1.jar"/>
<classpathentry kind="lib" path="solr/contrib/velocity/lib/velocity-1.6.4.jar"/>
<classpathentry kind="lib" path="solr/contrib/velocity/lib/velocity-tools-2.0.jar"/>
diff --git a/dev-tools/idea/.idea/libraries/JUnit.xml b/dev-tools/idea/.idea/libraries/JUnit.xml
index f4f4221ea2a..f3180797e4e 100644
--- a/dev-tools/idea/.idea/libraries/JUnit.xml
+++ b/dev-tools/idea/.idea/libraries/JUnit.xml
@@ -1,7 +1,7 @@
<component name="libraryTable">
<library name="JUnit">
<CLASSES>
- <root url="jar://$PROJECT_DIR$/lucene/lib/junit-4.10.jar!/" />
+ <root url="jar://$PROJECT_DIR$/lucene/test-framework/lib/junit-4.10.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
diff --git a/dev-tools/idea/lucene/lucene.iml b/dev-tools/idea/lucene/lucene.iml
index 3139f1a1753..96b2fa5b33f 100644
--- a/dev-tools/idea/lucene/lucene.iml
+++ b/dev-tools/idea/lucene/lucene.iml
@@ -19,11 +19,11 @@
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="file://$MODULE_DIR$/lib" />
+ <root url="file://$MODULE_DIR$/test-framework/lib" />
</CLASSES>
<JAVADOC />
<SOURCES />
- <jarDirectory url="file://$MODULE_DIR$/lib" recursive="false" />
+ <jarDirectory url="file://$MODULE_DIR$/test-framework/lib" recursive="false" />
</library>
</orderEntry>
</component>
diff --git a/dev-tools/maven/pom.xml.template b/dev-tools/maven/pom.xml.template
index 4461b13251a..c43fe946d1f 100644
--- a/dev-tools/maven/pom.xml.template
+++ b/dev-tools/maven/pom.xml.template
@@ -210,11 +210,6 @@
<artifactId>commons-compress</artifactId>
<version>1.2</version>
</dependency>
- <dependency>
- <groupId>org.apache.solr</groupId>
- <artifactId>solr-commons-csv</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-jsonic</artifactId>
@@ -225,11 +220,6 @@
<artifactId>solr-langdetect</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.solr</groupId>
- <artifactId>solr-noggit</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-core</artifactId>
@@ -636,34 +626,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<executions>
- <execution>
- <id>install-solr-commons-csv</id>
- <phase>install</phase>
- <goals>
- <goal>install-file</goal>
- </goals>
- <configuration>
- <groupId>org.apache.solr</groupId>
- <artifactId>solr-commons-csv</artifactId>
- <version>${project.version}</version>
- <packaging>jar</packaging>
- <file>solr/lib/apache-solr-commons-csv-1.0-SNAPSHOT-r966014.jar</file>
- </configuration>
- </execution>
- <execution>
- <id>install-solr-noggit</id>
- <phase>install</phase>
- <goals>
- <goal>install-file</goal>
- </goals>
- <configuration>
- <groupId>org.apache.solr</groupId>
- <artifactId>solr-noggit</artifactId>
- <version>${project.version}</version>
- <packaging>jar</packaging>
- <file>solr/lib/apache-solr-noggit-r1211150.jar</file>
- </configuration>
- </execution>
<execution>
<id>install-jsonic</id>
<phase>install</phase>
diff --git a/dev-tools/maven/solr/core/pom.xml.template b/dev-tools/maven/solr/core/pom.xml.template
index bcffb16d102..9e80f9e20aa 100644
--- a/dev-tools/maven/solr/core/pom.xml.template
+++ b/dev-tools/maven/solr/core/pom.xml.template
@@ -61,16 +61,6 @@
<artifactId>solr-solrj</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>solr-commons-csv</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>solr-noggit</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
diff --git a/lucene/BUILD.txt b/lucene/BUILD.txt
index 90f6f553cee..7fe7f326094 100644
--- a/lucene/BUILD.txt
+++ b/lucene/BUILD.txt
@@ -1,14 +1,14 @@
Lucene Build Instructions
Basic steps:
- 0) Install JDK 1.6 (or greater), Ant 1.7.1+ (not 1.6.x, not 1.8.x)
+ 0) Install JDK 1.6 (or greater), Ant 1.7.1+ (not 1.6.x, not 1.8.x), Ivy 2.2.0
1) Download Lucene from Apache and unpack it
2) Connect to the top-level of your Lucene installation
3) Install JavaCC (optional)
4) Run ant
Step 0) Set up your development environment (JDK 1.6 or greater,
-Ant 1.7.1+)
+Ant 1.7.1+, Ivy 2.2.0)
We'll assume that you know how to get and set up the JDK - if you
don't, then we suggest starting at http://java.sun.com and learning
@@ -29,6 +29,9 @@ according to the instructions at:
http://ant.apache.org/manual
+Finally, you'll need to install ivy into your ant lib folder
+(~/.ant/lib). You can get it from http://ant.apache.org/ivy/.
+
Step 1) Download Lucene from Apache
We'll assume you already did this, or you wouldn't be reading this
diff --git a/lucene/build.xml b/lucene/build.xml
index a389395ef7e..7e1cf408651 100644
--- a/lucene/build.xml
+++ b/lucene/build.xml
@@ -174,7 +174,7 @@
</target>
<!-- Validate once from top-level. -->
- <target name="validate" depends="compile-tools" description="Validate legal stuff.">
+ <target name="validate" depends="compile-tools,resolve" description="Validate legal stuff.">
<license-check-macro dir="${basedir}" />
</target>
@@ -190,6 +190,15 @@
</copy>
</target>
+ <target name="resolve">
+ <sequential>
+ <ant dir="test-framework" target="resolve" inheritall="false">
+ <propertyset refid="uptodate.and.compiled.properties"/>
+ </ant>
+ <contrib-crawl target="resolve" failonerror="true"/>
+ </sequential>
+ </target>
+
<target name="javadoc" depends="javadocs"/>
<target name="javadocs" description="Generate javadoc"
depends="javadocs-all, javadocs-core, javadocs-contrib, javadocs-test-framework">
@@ -226,8 +235,9 @@
<contrib-crawl target="javadocs"
failonerror="false"/>
</target>
-
- <target name="javadocs-all" depends="jar-analyzers-common,jar-queryparser,jar-queries"
+
+ <!-- call resolve to force dependencies to be in lib/ for javadocs -->
+ <target name="javadocs-all" depends="resolve,jar-analyzers-common,jar-queryparser,jar-queries"
description="Generate javadoc for core and contrib classes">
<sequential>
<mkdir dir="${javadoc.dir}/all"/>
@@ -235,10 +245,7 @@
<path id="javadoc.classpath">
<path refid="classpath"/>
<pathelement location="${ant.home}/lib/ant.jar"/>
- <fileset dir=".">
- <exclude name="build/**/*.jar"/>
- <include name="**/lib/*.jar"/>
- </fileset>
+ <fileset dir="." includes="test-framework/lib/,contrib/demo/lib/,contrib/sandbox/lib/" excludes="**/lib/*.txt"/>
<pathelement location="${analyzers-common.jar}"/>
<pathelement location="${queryparser.jar}"/>
<pathelement location="${queries.jar}"/>
@@ -382,7 +389,7 @@
<!-- ================================================================== -->
<!-- Packages the sources from "svn export" with tar-gzip -->
<!-- ================================================================== -->
- <target name="package-tgz-src" depends="init, init-dist"
+ <target name="package-tgz-src" depends="init-dist"
description="--> Generates the Lucene source distribution from 'svn export' as .tgz">
<property name="source.package.file"
value="${dist.dir}/lucene-${version}-src.tgz"/>
@@ -403,7 +410,7 @@
<!-- ================================================================== -->
<!-- Packages the sources from local working copy with tar-gzip -->
<!-- ================================================================== -->
- <target name="package-local-src-tgz" depends="init, init-dist"
+ <target name="package-local-src-tgz" depends="init-dist"
description="--> Packages the Lucene source from the local working copy">
<mkdir dir="${common.dir}/build"/>
<property name="source.package.file"
@@ -433,10 +440,7 @@
</target>
- <target name="generate-maven-artifacts" depends="package, javadocs">
- <taskdef resource="org/apache/maven/artifact/ant/antlib.xml"
- uri="antlib:org.apache.maven.artifact.ant"
- classpathref="maven-ant-tasks.classpath"/>
+ <target name="generate-maven-artifacts" depends="install-maven-tasks, package, javadocs">
<sequential>
<ant target="get-maven-poms" dir=".."/>
@@ -464,9 +468,9 @@
<!-- Build the JavaCC files into the source tree -->
<!-- ================================================================== -->
- <target name="javacc" depends="init,javacc-check,javacc-contrib-demo"/>
+ <target name="javacc" depends="javacc-check,javacc-contrib-demo"/>
- <target name="javacc-contrib-demo" depends="init,javacc-check" if="javacc.present">
+ <target name="javacc-contrib-demo" depends="javacc-check" if="javacc.present">
<ant target="javacc"
dir="contrib/demo"
antfile="build.xml"
@@ -541,8 +545,13 @@
<property name="lucene-core.uptodate" value="true"/>
</target>
- <!-- temporarily added before LUCENE-3930, to avoid
- any broken builds from timing issues: so hudson
- won't invoke ant target that does not exist -->
- <target name="clean-jars"/>
+ <!-- TODO: in the future, we don't need to actually put
+ jars in the lib/ folders, but can just put in classpath.
+ only packaging tasks really need that (and could do it
+ under build/ directories) -->
+ <target name="clean-jars" description="Clean local jars">
+ <delete>
+ <fileset dir="." includes="**/*.jar"/>
+ </delete>
+ </target>
</project>
diff --git a/lucene/common-build.xml b/lucene/common-build.xml
index 5d779ab762e..54dde3a8d0d 100644
--- a/lucene/common-build.xml
+++ b/lucene/common-build.xml
@@ -17,7 +17,8 @@
limitations under the License.
-->
-<project name="common" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
+<project name="common" xmlns:artifact="antlib:org.apache.maven.artifact.ant"
+ xmlns:ivy="antlib:org.apache.ivy.ant">
<description>
This file is designed for importing into a main build file, and not intended
for standalone use.
@@ -52,20 +53,18 @@
<property name="year" value="2000-${current.year}"/>
<property name="final.name" value="lucene-${name}-${version}"/>
+ <property name="ivy.bootstrap.version" value="2.2.0" />
+ <property name="ivy.resource" value="org/apache/ivy/ant/antlib.xml" />
+ <available resource="${ivy.resource}" property="ivy.available" />
+
<property name="junit.jar" value="junit-4.10.jar"/>
- <property name="junit-location.jar" value="${common.dir}/lib/${junit.jar}"/>
+ <property name="junit-location.jar" value="${common.dir}/test-framework/lib/${junit.jar}"/>
<path id="junit-path">
<pathelement location="${junit-location.jar}"/>
</path>
<path id="ant-path">
- <fileset dir="${common.dir}/lib" includes="ant-*.jar"/>
- </path>
-
- <path id="maven-ant-tasks.classpath">
- <fileset dir="${common.dir}/lib">
- <include name="maven-ant-tasks-*.jar"/>
- </fileset>
+ <fileset dir="${common.dir}/test-framework/lib" includes="ant-*.jar"/>
</path>
<!-- default arguments to pass to JVM executing tests -->
@@ -222,6 +221,13 @@
excludes="**/pom.xml,**/*.iml,site/build/"
/>
+ <!-- Default exclude sources and javadoc jars from Ivy fetch to save time and bandwidth -->
+ <condition property="ivy.exclude.types"
+ value=""
+ else="source|javadoc">
+ <isset property="fetch.sources.javadocs"/>
+ </condition>
+
<!-- Import custom ANT tasks. -->
<import file="${common.dir}/tools/custom-tasks.xml" />
@@ -249,10 +255,56 @@
</echo>
</target>
- <target name="init">
+ <target name="init" depends="resolve">
<!-- currently empty -->
</target>
+ <target name="resolve" depends="ivy-availability-check,ivy-fail">
+ <!-- todo, make this a property or something.
+ only special cases need bundles -->
+ <ivy:retrieve type="jar,bundle" log="download-only"/>
+ </target>
+ <target name="ivy-availability-check" unless="ivy.available">
+ <echo>
+ This build requires Ivy and Ivy could not be found in your ant classpath
+
+ (Due to classpath issues and the recursive nature of the Lucene/Solr
+ build system, a local copy of Ivy can not be used an loaded dynamically
+ by the build.xml)
+
+ You can either manually install a copy of Ivy ${ivy.bootstrap.version} in your ant classpath:
+ http://ant.apache.org/manual/install.html#optionalTasks
+
+ Or this build file can do it for you by running the Ivy Bootstrap target:
+ ant ivy-bootstrap
+
+ Either way you will only have to install Ivy one time.
+
+ 'ant ivy-bootstrap' will install a copy of Ivy into your Ant User Library:
+ ${user.home}/.ant/lib
+
+ If you would prefer, you can have it installed into an alternative
+ directory using the "-Divy_install_path=/some/path/you/choose" option,
+ but you will have to specify this path every time you build Lucene/Solr
+ in the future...
+ ant ivy-bootstrap -Divy_install_path=/some/path/you/choose
+ ...
+ ant -lib /some/path/you/choose clean compile
+ ...
+ ant -lib /some/path/you/choose clean compile
+ </echo>
+ </target>
+ <target name="ivy-fail" unless="ivy.available">
+ <fail>Ivy is not available</fail>
+ </target>
+ <target name="ivy-bootstrap">
+ <property name="ivy_install_path" location="${user.home}/.ant/lib" />
+ <mkdir dir="${ivy_install_path}"/>
+ <echo message="installing ivy ${ivy.bootstrap.version} to ${ivy_install_path}"/>
+ <get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.bootstrap.version}/ivy-${ivy.bootstrap.version}.jar"
+ dest="${ivy_install_path}/ivy-${ivy.bootstrap.version}.jar" usetimestamp="true"/>
+ </target>
+
<target name="jflex-uptodate-check">
<uptodate property="jflex.files.uptodate">
<srcfiles dir="${src.dir}" includes="**/*.jflex" />
@@ -783,11 +835,17 @@
<target name="javadocs">
<fail message="You must redefine the javadocs task to do something!!!!!"/>
</target>
-
- <target name="dist-maven" if="pom.xml.present" depends="jar-core, jar-src, javadocs">
+
+ <target name="install-maven-tasks" unless="maven-tasks.uptodate">
+ <property name="maven-tasks.uptodate" value="true"/>
+ <ivy:cachepath organisation="org.apache.maven" module="maven-ant-tasks" revision="2.1.3"
+ inline="true" conf="master" type="jar" pathid="maven-ant-tasks.classpath"/>
<taskdef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="antlib:org.apache.maven.artifact.ant"
classpathref="maven-ant-tasks.classpath"/>
+ </target>
+
+ <target name="dist-maven" if="pom.xml.present" depends="jar-core, jar-src, javadocs, install-maven-tasks">
<sequential>
<m2-deploy>
<artifact-attachments>
diff --git a/lucene/contrib/contrib-build.xml b/lucene/contrib/contrib-build.xml
index 1e973f12979..3ec494b2710 100644
--- a/lucene/contrib/contrib-build.xml
+++ b/lucene/contrib/contrib-build.xml
@@ -176,7 +176,9 @@
<property name="analyzers-morfologik.jar" value="${common.dir}/../modules/analysis/build/morfologik/lucene-analyzers-morfologik-${version}.jar"/>
<fileset id="analyzers-morfologik.fileset" dir="${common.dir}/../modules/analysis">
<include name="build/morfologik/lucene-analyzers-morfologik-${version}.jar" />
- <include name="morfologik/lib/*.jar" />
+ <include name="morfologik/lib/morfologik-fsa-1.5.2.jar" />
+ <include name="morfologik/lib/morfologik-polish-1.5.2.jar" />
+ <include name="morfologik/lib/morfologik-stemming-1.5.2.jar" />
</fileset>
<target name="check-analyzers-morfologik-uptodate" unless="analyzers-morfologik.uptodate">
<module-uptodate name="analysis/morfologik" jarfile="${analyzers-morfologik.jar}" property="analyzers-morfologik.uptodate"/>
diff --git a/lucene/contrib/demo/ivy.xml b/lucene/contrib/demo/ivy.xml
new file mode 100644
index 00000000000..a8bb411bd13
--- /dev/null
+++ b/lucene/contrib/demo/ivy.xml
@@ -0,0 +1,25 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="core-demo"/>
+ <dependencies>
+ <dependency org="javax.servlet" name="servlet-api" rev="2.4"/>
+ <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+ </dependencies>
+</ivy-module>
diff --git a/lucene/contrib/demo/lib/servlet-api-2.4.jar b/lucene/contrib/demo/lib/servlet-api-2.4.jar
deleted file mode 100755
index 9e7f1e85a59..00000000000
--- a/lucene/contrib/demo/lib/servlet-api-2.4.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[018d6effad3823d0ea59f1b58ab154fc2652f418] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/lucene/contrib/highlighter/ivy.xml b/lucene/contrib/highlighter/ivy.xml
new file mode 100644
index 00000000000..e59825440bb
--- /dev/null
+++ b/lucene/contrib/highlighter/ivy.xml
@@ -0,0 +1,21 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="highlighter"/>
+</ivy-module>
diff --git a/lucene/contrib/memory/ivy.xml b/lucene/contrib/memory/ivy.xml
new file mode 100644
index 00000000000..71c811532ec
--- /dev/null
+++ b/lucene/contrib/memory/ivy.xml
@@ -0,0 +1,21 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="memory"/>
+</ivy-module>
diff --git a/lucene/contrib/misc/ant_lib/cpptasks-1.0b5.jar b/lucene/contrib/misc/ant_lib/cpptasks-1.0b5.jar
deleted file mode 100644
index 86d47ff8ef9..00000000000
--- a/lucene/contrib/misc/ant_lib/cpptasks-1.0b5.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[b9c8c8a170881dfe9c33adc87c26348904510954] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/lucene/contrib/misc/ant_lib/cpptasks-NOTICE.txt b/lucene/contrib/misc/ant_lib/cpptasks-NOTICE.txt
deleted file mode 100644
index f2e411f2b4c..00000000000
--- a/lucene/contrib/misc/ant_lib/cpptasks-NOTICE.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-cpptasks for Apache Ant
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
diff --git a/lucene/contrib/misc/build.xml b/lucene/contrib/misc/build.xml
index 7e7e39d3c70..6e38aa9a297 100644
--- a/lucene/contrib/misc/build.xml
+++ b/lucene/contrib/misc/build.xml
@@ -17,7 +17,7 @@
limitations under the License.
-->
-<project name="misc" default="default">
+<project name="misc" default="default" xmlns:ivy="antlib:org.apache.ivy.ant">
<!-- TODO: add javacc capability for PrecedenceQueryParser -->
@@ -27,14 +27,15 @@
<import file="../contrib-build.xml"/>
- <target name="build-native-unix" >
- <mkdir dir="${common.build.dir}/native"/>
+ <target name="install-cpptasks" unless="cpptasks.uptodate">
+ <property name="cpptasks.uptodate" value="true"/>
+ <ivy:cachepath organisation="ant-contrib" module="cpptasks" revision="1.0b5"
+ inline="true" conf="master" type="jar" pathid="cpptasks.classpath"/>
+ <taskdef resource="cpptasks.tasks" classpathref="cpptasks.classpath"/>
+ </target>
- <taskdef resource="cpptasks.tasks">
- <classpath>
- <pathelement location="ant_lib/cpptasks-1.0b5.jar"/>
- </classpath>
- </taskdef>
+ <target name="build-native-unix" depends="install-cpptasks">
+ <mkdir dir="${common.build.dir}/native"/>
<cc outtype="shared" subsystem="console" outfile="${common.build.dir}/native/NativePosixUtil" >
<fileset file="${src.dir}/org/apache/lucene/store/NativePosixUtil.cpp" />
diff --git a/lucene/contrib/misc/ivy.xml b/lucene/contrib/misc/ivy.xml
new file mode 100644
index 00000000000..c4ab8b7e29b
--- /dev/null
+++ b/lucene/contrib/misc/ivy.xml
@@ -0,0 +1,21 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="misc"/>
+</ivy-module>
diff --git a/lucene/contrib/sandbox/build.xml b/lucene/contrib/sandbox/build.xml
index a934ff06635..e9225c2ad71 100644
--- a/lucene/contrib/sandbox/build.xml
+++ b/lucene/contrib/sandbox/build.xml
@@ -21,15 +21,11 @@
Sandbox for odd contrib code
</description>
- <path id="additional.dependencies">
- <fileset dir="lib" includes="*-regexp-*.jar"/>
- </path>
-
- <pathconvert property="project.classpath"
- targetos="unix"
- refid="additional.dependencies"
- />
-
<import file="../contrib-build.xml"/>
+ <path id="classpath">
+ <pathelement path="lib/jakarta-regexp-1.4.jar"/>
+ <path refid="base.classpath"/>
+ </path>
+
</project>
diff --git a/lucene/contrib/sandbox/ivy.xml b/lucene/contrib/sandbox/ivy.xml
new file mode 100644
index 00000000000..94b89529d34
--- /dev/null
+++ b/lucene/contrib/sandbox/ivy.xml
@@ -0,0 +1,25 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="sandbox"/>
+ <dependencies>
+ <dependency org="jakarta-regexp" name="jakarta-regexp" rev="1.4" transitive="false"/>
+ <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+ </dependencies>
+</ivy-module>
diff --git a/lucene/contrib/sandbox/lib/jakarta-regexp-1.4.jar b/lucene/contrib/sandbox/lib/jakarta-regexp-1.4.jar
deleted file mode 100644
index 0366f231ea9..00000000000
--- a/lucene/contrib/sandbox/lib/jakarta-regexp-1.4.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[5d70c357a1e6c4c702af313c94aaf3168d300dcf] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/lucene/core/ivy.xml b/lucene/core/ivy.xml
new file mode 100644
index 00000000000..fce1aef69e7
--- /dev/null
+++ b/lucene/core/ivy.xml
@@ -0,0 +1,21 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="core"/>
+</ivy-module>
diff --git a/lucene/lib/ant-1.7.1.jar b/lucene/lib/ant-1.7.1.jar
deleted file mode 100644
index dd5604f2f70..00000000000
--- a/lucene/lib/ant-1.7.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[704717779f6d0d7eb026dc7af78a35e51adeec8b] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/lucene/lib/ant-junit-1.7.1.jar b/lucene/lib/ant-junit-1.7.1.jar
deleted file mode 100644
index 26454d610e4..00000000000
--- a/lucene/lib/ant-junit-1.7.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[063cce4f940033fa6e33d3e590cf6f5051129295] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/lucene/lib/junit-4.10.jar b/lucene/lib/junit-4.10.jar
deleted file mode 100644
index 3abf16af60e..00000000000
--- a/lucene/lib/junit-4.10.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[954851e67d7424440592e8176c4aa034cc46aa85] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/lucene/lib/maven-ant-tasks-2.1.3.jar b/lucene/lib/maven-ant-tasks-2.1.3.jar
deleted file mode 100644
index e8397e8ceb2..00000000000
--- a/lucene/lib/maven-ant-tasks-2.1.3.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[bec446fff5f05d21bee64a25d037c46604d510e0] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/lucene/lib/maven-ant-tasks-NOTICE.txt b/lucene/lib/maven-ant-tasks-NOTICE.txt
deleted file mode 100755
index 42fef0c2f2c..00000000000
--- a/lucene/lib/maven-ant-tasks-NOTICE.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-
-Maven Ant Tasks
-Copyright 2002-2010 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-
diff --git a/lucene/test-framework/build.xml b/lucene/test-framework/build.xml
index 510ec14f263..f5159d94601 100644
--- a/lucene/test-framework/build.xml
+++ b/lucene/test-framework/build.xml
@@ -46,7 +46,7 @@
</target>
<target name="javadocs-core" depends="javadocs"/>
- <target name="javadocs">
+ <target name="javadocs" depends="init">
<sequential>
<mkdir dir="${javadoc.dir}/test-framework"/>
<invoke-javadoc overview="${src.dir}/overview.html"
diff --git a/lucene/test-framework/ivy.xml b/lucene/test-framework/ivy.xml
new file mode 100644
index 00000000000..517564886bf
--- /dev/null
+++ b/lucene/test-framework/ivy.xml
@@ -0,0 +1,27 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="core-test-framework"/>
+ <dependencies>
+ <dependency org="org.apache.ant" name="ant" rev="1.7.1" transitive="false"/>
+ <dependency org="org.apache.ant" name="ant-junit" rev="1.7.1" transitive="false"/>
+ <dependency org="junit" name="junit" rev="4.10" transitive="false"/>
+ <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+ </dependencies>
+</ivy-module>
diff --git a/lucene/lib/ant-LICENSE-ASL.txt b/lucene/test-framework/lib/ant-LICENSE-ASL.txt
similarity index 100%
rename from lucene/lib/ant-LICENSE-ASL.txt
rename to lucene/test-framework/lib/ant-LICENSE-ASL.txt
diff --git a/lucene/lib/ant-NOTICE.txt b/lucene/test-framework/lib/ant-NOTICE.txt
similarity index 100%
rename from lucene/lib/ant-NOTICE.txt
rename to lucene/test-framework/lib/ant-NOTICE.txt
diff --git a/lucene/lib/ant-junit-LICENSE-ASL.txt b/lucene/test-framework/lib/ant-junit-LICENSE-ASL.txt
similarity index 100%
rename from lucene/lib/ant-junit-LICENSE-ASL.txt
rename to lucene/test-framework/lib/ant-junit-LICENSE-ASL.txt
diff --git a/lucene/lib/ant-junit-NOTICE.txt b/lucene/test-framework/lib/ant-junit-NOTICE.txt
similarity index 100%
rename from lucene/lib/ant-junit-NOTICE.txt
rename to lucene/test-framework/lib/ant-junit-NOTICE.txt
diff --git a/lucene/lib/junit-LICENSE-CPL.txt b/lucene/test-framework/lib/junit-LICENSE-CPL.txt
similarity index 100%
rename from lucene/lib/junit-LICENSE-CPL.txt
rename to lucene/test-framework/lib/junit-LICENSE-CPL.txt
diff --git a/lucene/lib/junit-NOTICE.txt b/lucene/test-framework/lib/junit-NOTICE.txt
similarity index 100%
rename from lucene/lib/junit-NOTICE.txt
rename to lucene/test-framework/lib/junit-NOTICE.txt
diff --git a/lucene/tools/custom-tasks.xml b/lucene/tools/custom-tasks.xml
index fea9709ef14..3391ab5ac7f 100644
--- a/lucene/tools/custom-tasks.xml
+++ b/lucene/tools/custom-tasks.xml
@@ -47,9 +47,12 @@
<!-- Typical version patterns. -->
<replaceregex pattern="\-(r)?([0-9\-\_\.])+(b(eta)?([0-9\-\.])*)?$" replace="" flags="gi" />
+
+ <!-- git hashcode pattern: its always 40 chars right? -->
+ <replaceregex pattern="\-[a-z0-9]{40,40}$" replace="" flags="gi" />
</filtermapper>
</licenseMapper>
</licenses>
</sequential>
</macrodef>
-</project>
\ No newline at end of file
+</project>
diff --git a/lucene/tools/ivy.xml b/lucene/tools/ivy.xml
new file mode 100644
index 00000000000..6525f67f041
--- /dev/null
+++ b/lucene/tools/ivy.xml
@@ -0,0 +1,21 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="core-tools"/>
+</ivy-module>
diff --git a/modules/analysis/build.xml b/modules/analysis/build.xml
index ea761b18af4..bdcc4beee8b 100644
--- a/modules/analysis/build.xml
+++ b/modules/analysis/build.xml
@@ -30,6 +30,23 @@
- uima: UIMA Analysis module
</description>
+ <dirname file="${ant.file.analyzers}" property="analyzers.dir"/>
+
+ <macrodef name="forall-analyzers">
+ <attribute name="target" />
+ <sequential>
+ <subant target="@{target}" inheritall="false" failonerror="true">
+ <propertyset refid="uptodate.and.compiled.properties"/>
+ <fileset dir="${analyzers.dir}" includes="*/build.xml" />
+ </subant>
+ </sequential>
+ </macrodef>
+
+ <propertyset id="uptodate.and.compiled.properties" dynamic="true">
+ <propertyref regex=".*\.uptodate$$"/>
+ <propertyref regex=".*\.compiled$$"/>
+ </propertyset>
+
<target name="common">
<ant dir="common" />
</target>
@@ -65,90 +82,39 @@
<target name="default" depends="compile"/>
<target name="compile" depends="common,icu,kuromoji,morfologik,phonetic,smartcn,stempel,uima" />
+ <!-- FIXME: these should crawl like contrib-crawl/modules-crawl, passing the
+ propset so we dont install maven-ant-tasks over and over -->
<target name="clean">
- <ant dir="common" target="clean" />
- <ant dir="icu" target="clean" />
- <ant dir="kuromoji" target="clean"/>
- <ant dir="morfologik" target="clean" />
- <ant dir="phonetic" target="clean" />
- <ant dir="smartcn" target="clean" />
- <ant dir="stempel" target="clean" />
- <ant dir="uima" target="clean" />
+ <forall-analyzers target="clean"/>
+ </target>
+ <target name="resolve">
+ <forall-analyzers target="resolve"/>
</target>
<target name="validate">
- <ant dir="common" target="validate" />
- <ant dir="icu" target="validate" />
- <ant dir="kuromoji" target="validate" />
- <ant dir="morfologik" target="validate" />
- <ant dir="phonetic" target="validate" />
- <ant dir="smartcn" target="validate" />
- <ant dir="stempel" target="validate" />
- <ant dir="uima" target="validate" />
+ <forall-analyzers target="validate"/>
</target>
<target name="compile-core">
- <ant dir="common" target="compile-core" />
- <ant dir="icu" target="compile-core" />
- <ant dir="kuromoji" target="compile-core" />
- <ant dir="morfologik" target="compile-core" />
- <ant dir="phonetic" target="compile-core" />
- <ant dir="smartcn" target="compile-core" />
- <ant dir="stempel" target="compile-core" />
- <ant dir="uima" target="compile-core" />
+ <forall-analyzers target="compile-core"/>
</target>
<target name="compile-test">
- <ant dir="common" target="compile-test" />
- <ant dir="icu" target="compile-test" />
- <ant dir="kuromoji" target="compile-test" />
- <ant dir="morfologik" target="compile-test" />
- <ant dir="phonetic" target="compile-test" />
- <ant dir="smartcn" target="compile-test" />
- <ant dir="stempel" target="compile-test" />
- <ant dir="uima" target="compile-test" />
+ <forall-analyzers target="compile-test"/>
</target>
<target name="test">
- <ant dir="common" target="test" />
- <ant dir="icu" target="test" />
- <ant dir="kuromoji" target="test" />
- <ant dir="morfologik" target="test" />
- <ant dir="phonetic" target="test" />
- <ant dir="smartcn" target="test" />
- <ant dir="stempel" target="test" />
- <ant dir="uima" target="test" />
+ <forall-analyzers target="test"/>
</target>
<target name="build-artifacts-and-tests" depends="default,compile-test" />
<target name="dist-maven" depends="default,javadocs">
- <ant dir="common" target="dist-maven" />
- <ant dir="icu" target="dist-maven" />
- <ant dir="kuromoji" target="dist-maven" />
- <ant dir="morfologik" target="dist-maven" />
- <ant dir="phonetic" target="dist-maven" />
- <ant dir="smartcn" target="dist-maven" />
- <ant dir="stempel" target="dist-maven" />
- <ant dir="uima" target="dist-maven" />
+ <forall-analyzers target="dist-maven"/>
</target>
<target name="javadocs">
- <ant dir="common" target="javadocs" />
- <ant dir="icu" target="javadocs" />
- <ant dir="kuromoji" target="javadocs" />
- <ant dir="morfologik" target="javadocs" />
- <ant dir="phonetic" target="javadocs" />
- <ant dir="smartcn" target="javadocs" />
- <ant dir="stempel" target="javadocs" />
- <ant dir="uima" target="javadocs" />
+ <forall-analyzers target="javadocs"/>
</target>
<target name="javadocs-index.html">
- <ant dir="common" target="javadocs-index.html" />
- <ant dir="icu" target="javadocs-index.html" />
- <ant dir="kuromoji" target="javadocs-index.html" />
- <ant dir="morfologik" target="javadocs-index.html" />
- <ant dir="phonetic" target="javadocs-index.html" />
- <ant dir="smartcn" target="javadocs-index.html" />
- <ant dir="stempel" target="javadocs-index.html" />
- <ant dir="uima" target="javadocs-index.html" />
+ <forall-analyzers target="javadocs-index.html"/>
</target>
</project>
diff --git a/modules/analysis/common/ivy.xml b/modules/analysis/common/ivy.xml
new file mode 100644
index 00000000000..2fe4940f954
--- /dev/null
+++ b/modules/analysis/common/ivy.xml
@@ -0,0 +1,21 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="analyzers-common"/>
+</ivy-module>
diff --git a/modules/analysis/icu/build.xml b/modules/analysis/icu/build.xml
index a59262d4a27..e8a1c6048b3 100644
--- a/modules/analysis/icu/build.xml
+++ b/modules/analysis/icu/build.xml
@@ -27,19 +27,15 @@
<property name="build.dir" location="../build/icu" />
<property name="dist.dir" location="../dist/icu" />
- <path id="additional.dependencies">
- <fileset dir="lib" includes="icu4j-*.jar"/>
- </path>
-
- <pathconvert property="project.classpath"
- targetos="unix"
- refid="additional.dependencies"
- />
-
<import file="../../../lucene/contrib/contrib-build.xml"/>
+ <path id="icujar">
+ <pathelement location="lib/icu4j-4.8.1.1.jar"/>
+ </path>
+
<path id="classpath">
<pathelement path="${analyzers-common.jar}"/>
+ <path refid="icujar"/>
<path refid="base.classpath"/>
</path>
@@ -82,7 +78,7 @@ are part of the ICU4C package. See http://site.icu-project.org/ </echo>
fork="true"
failonerror="true">
<classpath>
- <path refid="additional.dependencies"/>
+ <path refid="icujar"/>
<pathelement location="${build.dir}/classes/tools"/>
</classpath>
<assertions>
@@ -104,7 +100,7 @@ are part of the ICU4C package. See http://site.icu-project.org/ </echo>
failonerror="true"
output="${uax29.supp.macros.output.file}">
<classpath>
- <path refid="additional.dependencies"/>
+ <path refid="icujar"/>
<pathelement location="${build.dir}/classes/tools"/>
</classpath>
<assertions>
@@ -124,13 +120,13 @@ are part of the ICU4C package. See http://site.icu-project.org/ </echo>
failonerror="true"
output="${html.strip.charfilter.supp.macros.output.file}">
<classpath>
- <path refid="additional.dependencies"/>
+ <path refid="icujar"/>
<pathelement location="${build.dir}/classes/tools"/>
</classpath>
</java>
</target>
- <target name="compile-tools" depends="common.compile-tools">
+ <target name="compile-tools" depends="init,common.compile-tools">
<compile
srcdir="src/tools/java"
destdir="${build.dir}/classes/tools">
diff --git a/modules/analysis/icu/ivy.xml b/modules/analysis/icu/ivy.xml
new file mode 100644
index 00000000000..351e644f7d7
--- /dev/null
+++ b/modules/analysis/icu/ivy.xml
@@ -0,0 +1,25 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="analyzers-icu"/>
+ <dependencies>
+ <dependency org="com.ibm.icu" name="icu4j" rev="4.8.1.1" transitive="false"/>
+ <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+ </dependencies>
+</ivy-module>
diff --git a/modules/analysis/icu/lib/icu4j-4_8_1_1.jar b/modules/analysis/icu/lib/icu4j-4_8_1_1.jar
deleted file mode 100644
index 098d38b6fbf..00000000000
--- a/modules/analysis/icu/lib/icu4j-4_8_1_1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[a97d575b7d923c1c4f5deb5a735cd45fbc084230] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/modules/analysis/kuromoji/ivy.xml b/modules/analysis/kuromoji/ivy.xml
new file mode 100644
index 00000000000..0de1478c539
--- /dev/null
+++ b/modules/analysis/kuromoji/ivy.xml
@@ -0,0 +1,21 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="analyzers-kuromoji"/>
+</ivy-module>
diff --git a/modules/analysis/morfologik/build.xml b/modules/analysis/morfologik/build.xml
index 74eae32d267..effe0834687 100644
--- a/modules/analysis/morfologik/build.xml
+++ b/modules/analysis/morfologik/build.xml
@@ -26,18 +26,13 @@
<property name="build.dir" location="../build/morfologik" />
<property name="dist.dir" location="../dist/morfologik" />
- <path id="additional.dependencies">
- <fileset dir="lib" includes="morfologik-fsa-*.jar"/>
- <fileset dir="lib" includes="morfologik-polish-*.jar"/>
- <fileset dir="lib" includes="morfologik-stemming-*.jar"/>
- </path>
-
- <pathconvert property="project.classpath" targetos="unix" refid="additional.dependencies" />
-
<import file="../../../lucene/contrib/contrib-build.xml"/>
<path id="classpath">
<pathelement path="${analyzers-common.jar}"/>
+ <pathelement path="lib/morfologik-fsa-1.5.2.jar"/>
+ <pathelement path="lib/morfologik-polish-1.5.2.jar"/>
+ <pathelement path="lib/morfologik-stemming-1.5.2.jar"/>
<path refid="base.classpath"/>
</path>
diff --git a/modules/analysis/morfologik/ivy.xml b/modules/analysis/morfologik/ivy.xml
new file mode 100644
index 00000000000..f35e1ae2679
--- /dev/null
+++ b/modules/analysis/morfologik/ivy.xml
@@ -0,0 +1,27 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="analyzers-morfologik"/>
+ <dependencies>
+ <dependency org="org.carrot2" name="morfologik-polish" rev="1.5.2" transitive="false"/>
+ <dependency org="org.carrot2" name="morfologik-fsa" rev="1.5.2" transitive="false"/>
+ <dependency org="org.carrot2" name="morfologik-stemming" rev="1.5.2" transitive="false"/>
+ <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+ </dependencies>
+</ivy-module>
diff --git a/modules/analysis/morfologik/lib/morfologik-fsa-1.5.2.jar b/modules/analysis/morfologik/lib/morfologik-fsa-1.5.2.jar
deleted file mode 100644
index 1f6840dad48..00000000000
--- a/modules/analysis/morfologik/lib/morfologik-fsa-1.5.2.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[34c0f34e37062f29497e87325b5124a033747cd5] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/modules/analysis/morfologik/lib/morfologik-polish-1.5.2.jar b/modules/analysis/morfologik/lib/morfologik-polish-1.5.2.jar
deleted file mode 100644
index ca88e24004b..00000000000
--- a/modules/analysis/morfologik/lib/morfologik-polish-1.5.2.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[ca2fa4d318ab91d6878614b3479628bf4325bf2e] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/modules/analysis/morfologik/lib/morfologik-stemming-1.5.2.jar b/modules/analysis/morfologik/lib/morfologik-stemming-1.5.2.jar
deleted file mode 100644
index 5f99ef5d26d..00000000000
--- a/modules/analysis/morfologik/lib/morfologik-stemming-1.5.2.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[dec8226eaaa3b4a3683e7cbdbe0e526dcfffebff] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/modules/analysis/phonetic/build.xml b/modules/analysis/phonetic/build.xml
index 8309329992a..9de4ac030df 100644
--- a/modules/analysis/phonetic/build.xml
+++ b/modules/analysis/phonetic/build.xml
@@ -26,19 +26,11 @@
<property name="build.dir" location="../build/phonetic" />
<property name="dist.dir" location="../dist/phonetic" />
- <path id="additional.dependencies">
- <fileset dir="lib" includes="commons-codec-*.jar"/>
- </path>
-
- <pathconvert property="project.classpath"
- targetos="unix"
- refid="additional.dependencies"
- />
-
<import file="../../../lucene/contrib/contrib-build.xml"/>
<path id="classpath">
<pathelement path="${analyzers-common.jar}"/>
+ <pathelement path="lib/commons-codec-1.6.jar"/>
<path refid="base.classpath"/>
</path>
diff --git a/modules/analysis/phonetic/ivy.xml b/modules/analysis/phonetic/ivy.xml
new file mode 100644
index 00000000000..1da4efb2166
--- /dev/null
+++ b/modules/analysis/phonetic/ivy.xml
@@ -0,0 +1,25 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="analyzers-phonetic"/>
+ <dependencies>
+ <dependency org="commons-codec" name="commons-codec" rev="1.6" transitive="false"/>
+ <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+ </dependencies>
+</ivy-module>
diff --git a/modules/analysis/phonetic/lib/commons-codec-1.6.jar b/modules/analysis/phonetic/lib/commons-codec-1.6.jar
deleted file mode 100644
index 86b1896229b..00000000000
--- a/modules/analysis/phonetic/lib/commons-codec-1.6.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[ee1bc49acae11cc79eceec51f7be785590e99fd8] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/modules/analysis/smartcn/ivy.xml b/modules/analysis/smartcn/ivy.xml
new file mode 100644
index 00000000000..8062eec7b6a
--- /dev/null
+++ b/modules/analysis/smartcn/ivy.xml
@@ -0,0 +1,21 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="analyzers-smartcn"/>
+</ivy-module>
diff --git a/modules/analysis/stempel/ivy.xml b/modules/analysis/stempel/ivy.xml
new file mode 100644
index 00000000000..cd564c69dec
--- /dev/null
+++ b/modules/analysis/stempel/ivy.xml
@@ -0,0 +1,21 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="analyzers-stempel"/>
+</ivy-module>
diff --git a/modules/analysis/uima/build.xml b/modules/analysis/uima/build.xml
index 8998c090434..424c0a1b09b 100644
--- a/modules/analysis/uima/build.xml
+++ b/modules/analysis/uima/build.xml
@@ -28,17 +28,18 @@
<property name="tests.userdir" value="src/test-files"/>
<property name="tests.threadspercpu" value="0" />
- <path id="additional.dependencies">
- <fileset dir="lib" includes="*.jar"/>
+ <path id="uimajars">
+ <pathelement path="lib/uimaj-core-2.3.1.jar"/>
+ <pathelement path="lib/Tagger-2.3.1.jar"/>
+ <pathelement path="lib/WhitespaceTokenizer-2.3.1.jar"/>
</path>
- <pathconvert property="project.classpath" targetos="unix" refid="additional.dependencies" />
-
<import file="../../../lucene/contrib/contrib-build.xml"/>
<path id="classpath">
<pathelement path="${analyzers-common.jar}"/>
<pathelement path="${tests.userdir}"/>
+ <path refid="uimajars"/>
<path refid="base.classpath"/>
</path>
diff --git a/modules/analysis/uima/ivy.xml b/modules/analysis/uima/ivy.xml
new file mode 100644
index 00000000000..0eca94c97ee
--- /dev/null
+++ b/modules/analysis/uima/ivy.xml
@@ -0,0 +1,27 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="analyzers-uima"/>
+ <dependencies>
+ <dependency org="org.apache.uima" name="Tagger" rev="2.3.1" transitive="false"/>
+ <dependency org="org.apache.uima" name="WhitespaceTokenizer" rev="2.3.1" transitive="false"/>
+ <dependency org="org.apache.uima" name="uimaj-core" rev="2.3.1" transitive="false"/>
+ <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+ </dependencies>
+</ivy-module>
diff --git a/lucene/contrib/misc/ant_lib/cpptasks-LICENSE-ASL.txt b/modules/analysis/uima/lib/Tagger-LICENSE-ASL.txt
similarity index 100%
rename from lucene/contrib/misc/ant_lib/cpptasks-LICENSE-ASL.txt
rename to modules/analysis/uima/lib/Tagger-LICENSE-ASL.txt
diff --git a/modules/analysis/uima/lib/uima-an-tagger-NOTICE.txt b/modules/analysis/uima/lib/Tagger-NOTICE.txt
similarity index 100%
rename from modules/analysis/uima/lib/uima-an-tagger-NOTICE.txt
rename to modules/analysis/uima/lib/Tagger-NOTICE.txt
diff --git a/lucene/lib/maven-ant-tasks-LICENSE-ASL.txt b/modules/analysis/uima/lib/WhitespaceTokenizer-LICENSE-ASL.txt
similarity index 100%
rename from lucene/lib/maven-ant-tasks-LICENSE-ASL.txt
rename to modules/analysis/uima/lib/WhitespaceTokenizer-LICENSE-ASL.txt
diff --git a/modules/analysis/uima/lib/uima-an-wst-NOTICE.txt b/modules/analysis/uima/lib/WhitespaceTokenizer-NOTICE.txt
similarity index 100%
rename from modules/analysis/uima/lib/uima-an-wst-NOTICE.txt
rename to modules/analysis/uima/lib/WhitespaceTokenizer-NOTICE.txt
diff --git a/modules/analysis/uima/lib/uima-an-tagger-2.3.1.jar b/modules/analysis/uima/lib/uima-an-tagger-2.3.1.jar
deleted file mode 100644
index e30333f76a9..00000000000
--- a/modules/analysis/uima/lib/uima-an-tagger-2.3.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[dffd510b7429dcbe37a283da92cbf06c1cfbe383] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/modules/analysis/uima/lib/uima-an-wst-2.3.1.jar b/modules/analysis/uima/lib/uima-an-wst-2.3.1.jar
deleted file mode 100644
index 289f397f6ba..00000000000
--- a/modules/analysis/uima/lib/uima-an-wst-2.3.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[10866014d8887bfdd8bfec43d3fdd780428d4ed4] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/modules/analysis/uima/lib/uimaj-core-2.3.1.jar b/modules/analysis/uima/lib/uimaj-core-2.3.1.jar
deleted file mode 100644
index 4c7359f79ae..00000000000
--- a/modules/analysis/uima/lib/uimaj-core-2.3.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[e876a9749eed73ec2c95b83cf534d7a373130569] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/modules/benchmark/build.xml b/modules/benchmark/build.xml
index c04d8be22f4..972014e1dae 100644
--- a/modules/benchmark/build.xml
+++ b/modules/benchmark/build.xml
@@ -154,10 +154,11 @@
<pathelement path="${analyzers-common.jar}"/>
<pathelement path="${queryparser.jar}"/>
<pathelement path="${facet.jar}"/>
- <fileset dir="${common.dir}/../modules/analysis/icu/lib" includes="icu4j*.jar"/>
+ <fileset dir="${common.dir}/../modules/analysis/icu/lib" includes="icu4j-4.8.1.1.jar"/>
<path refid="base.classpath"/>
<fileset dir="lib">
- <include name="**/*.jar"/>
+ <include name="commons-compress-1.2.jar"/>
+ <include name="xercesImpl-2.9.1.jar"/>
</fileset>
</path>
<path id="run.classpath">
@@ -198,7 +199,7 @@
<path id="collation.runtime.classpath">
<path refid="run.classpath"/>
<pathelement path="${analyzers-icu.jar}"/>
- <fileset dir="${common.dir}/../modules/analysis/icu/lib" includes="icu4j*.jar"/>
+ <fileset dir="${common.dir}/../modules/analysis/icu/lib" includes="icu4j-4.8.1.1.jar"/>
</path>
<target name="collation" depends="compile,jar-analyzers-icu,top-100k-wiki-word-files">
@@ -243,7 +244,14 @@
<echo>Benchmark output in JIRA table format is in file: ${shingle.jira.output.file}</echo>
</target>
- <target name="init" depends="contrib-build.init,jar-memory,jar-highlighter,jar-analyzers-common,jar-queryparser,jar-facet"/>
+ <!-- we don't actually need to compile this thing, we just want its lib -->
+ <target name="resolve-icu">
+ <ant dir="${common.dir}/../modules/analysis/icu/" target="resolve" inheritAll="false">
+ <propertyset refid="uptodate.and.compiled.properties"/>
+ </ant>
+ </target>
+
+ <target name="init" depends="contrib-build.init,resolve-icu,jar-memory,jar-highlighter,jar-analyzers-common,jar-queryparser,jar-facet"/>
<target name="clean-javacc">
<fileset dir="src/java/org/apache/lucene/benchmark/byTask/feeds/demohtml" includes="*.java">
diff --git a/modules/benchmark/ivy.xml b/modules/benchmark/ivy.xml
new file mode 100644
index 00000000000..f4d515ababe
--- /dev/null
+++ b/modules/benchmark/ivy.xml
@@ -0,0 +1,26 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="benchmark"/>
+ <dependencies>
+ <dependency org="org.apache.commons" name="commons-compress" rev="1.2" transitive="false"/>
+ <dependency org="xerces" name="xercesImpl" rev="2.9.1" transitive="false"/>
+ <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+ </dependencies>
+</ivy-module>
diff --git a/modules/benchmark/lib/commons-compress-1.2.jar b/modules/benchmark/lib/commons-compress-1.2.jar
deleted file mode 100644
index 7a6af362823..00000000000
--- a/modules/benchmark/lib/commons-compress-1.2.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[61753909c3f32306bf60d09e5345d47058ba2122] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/modules/benchmark/lib/xercesImpl-2.9.1.jar b/modules/benchmark/lib/xercesImpl-2.9.1.jar
deleted file mode 100644
index 4e3c02df36e..00000000000
--- a/modules/benchmark/lib/xercesImpl-2.9.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[547f56300d93fe36587910739e095f03e287d47e] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/modules/build.xml b/modules/build.xml
index 12e7a69b357..bb4257ed79b 100644
--- a/modules/build.xml
+++ b/modules/build.xml
@@ -25,11 +25,18 @@
<attribute name="target" />
<sequential>
<subant target="@{target}" inheritall="false" failonerror="true">
+ <propertyset refid="uptodate.and.compiled.properties"/>
<fileset dir="${modules.dir}" includes="*/build.xml" />
</subant>
</sequential>
</macrodef>
+ <propertyset id="uptodate.and.compiled.properties" dynamic="true">
+ <propertyref regex=".*\.uptodate$$"/>
+ <propertyref regex=".*\.compiled$$"/>
+ </propertyset>
+
+
<target name="test" description="Test all modules">
<forall-modules target="test" />
</target>
@@ -38,6 +45,10 @@
<forall-modules target="compile" />
</target>
+ <target name="resolve">
+ <forall-modules target="resolve"/>
+ </target>
+
<target name="compile-test" description="Compile all tests">
<forall-modules target="compile-test" />
</target>
@@ -51,7 +62,7 @@
<forall-modules target="dist-maven" />
</target>
- <target name="validate" description="Validate legal stuff.">
+ <target name="validate" depends="resolve" description="Validate legal stuff.">
<!-- The order here is important because forall compiles tools. -->
<forall-modules target="validate" />
<license-check-macro dir="${basedir}" />
@@ -61,4 +72,14 @@
<delete dir="dist"/>
<forall-modules target="clean" />
</target>
+
+ <!-- TODO: in the future, we don't need to actually put
+ jars in the lib/ folders, but can just put in classpath.
+ only packaging tasks really need that (and could do it
+ under build/ directories) -->
+ <target name="clean-jars" description="Clean local jars">
+ <delete>
+ <fileset dir="." includes="**/*.jar"/>
+ </delete>
+ </target>
</project>
diff --git a/modules/facet/ivy.xml b/modules/facet/ivy.xml
new file mode 100644
index 00000000000..f8be1153a71
--- /dev/null
+++ b/modules/facet/ivy.xml
@@ -0,0 +1,21 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="facet"/>
+</ivy-module>
diff --git a/modules/grouping/ivy.xml b/modules/grouping/ivy.xml
new file mode 100644
index 00000000000..a734b9f0455
--- /dev/null
+++ b/modules/grouping/ivy.xml
@@ -0,0 +1,21 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="grouping"/>
+</ivy-module>
diff --git a/modules/join/ivy.xml b/modules/join/ivy.xml
new file mode 100644
index 00000000000..c4501b3291c
--- /dev/null
+++ b/modules/join/ivy.xml
@@ -0,0 +1,21 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="join"/>
+</ivy-module>
diff --git a/modules/queries/ivy.xml b/modules/queries/ivy.xml
new file mode 100644
index 00000000000..84abb9aec50
--- /dev/null
+++ b/modules/queries/ivy.xml
@@ -0,0 +1,21 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="queries"/>
+</ivy-module>
diff --git a/modules/queryparser/ivy.xml b/modules/queryparser/ivy.xml
new file mode 100644
index 00000000000..8cc92035a6e
--- /dev/null
+++ b/modules/queryparser/ivy.xml
@@ -0,0 +1,21 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="queryparser"/>
+</ivy-module>
diff --git a/modules/spatial/build.xml b/modules/spatial/build.xml
index dbd06e8b985..4220e3a6d03 100644
--- a/modules/spatial/build.xml
+++ b/modules/spatial/build.xml
@@ -8,24 +8,21 @@
<property name="dist.dir" location="dist/" />
<property name="maven.dist.dir" location="../dist/maven" />
- <path id="additional.dependencies">
- <fileset dir="lib" includes="*.jar"/>
- </path>
-
- <pathconvert property="project.classpath"
- targetos="unix"
- refid="additional.dependencies"
- />
-
<import file="../../lucene/contrib/contrib-build.xml"/>
+ <path id="spatialjar">
+ <pathelement path="lib/spatial4j-0.2.jar"/>
+ </path>
+
<path id="classpath">
<path refid="base.classpath"/>
+ <path refid="spatialjar"/>
<pathelement path="${queries.jar}" />
</path>
<path id="test.classpath">
<path refid="test.base.classpath" />
+ <path refid="spatialjar"/>
<pathelement path="src/test-files" />
</path>
diff --git a/modules/spatial/ivy.xml b/modules/spatial/ivy.xml
new file mode 100644
index 00000000000..56a64327e68
--- /dev/null
+++ b/modules/spatial/ivy.xml
@@ -0,0 +1,25 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="spatial"/>
+ <dependencies>
+ <dependency org="com.spatial4j" name="spatial4j" rev="0.2" transitive="false"/>
+ <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+ </dependencies>
+</ivy-module>
diff --git a/modules/spatial/lib/spatial4j-0.2.jar b/modules/spatial/lib/spatial4j-0.2.jar
deleted file mode 100644
index 69f87ce33f4..00000000000
--- a/modules/spatial/lib/spatial4j-0.2.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[82d4eadc1a5301bb86440e1eac81834fea8cba49] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/modules/suggest/ivy.xml b/modules/suggest/ivy.xml
new file mode 100644
index 00000000000..35cb3b8aef7
--- /dev/null
+++ b/modules/suggest/ivy.xml
@@ -0,0 +1,21 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.lucene" module="suggest"/>
+</ivy-module>
diff --git a/solr/README.txt b/solr/README.txt
index 4ae6405e2f9..72008d69378 100644
--- a/solr/README.txt
+++ b/solr/README.txt
@@ -71,6 +71,9 @@ Instructions for Building Apache Solr from Source
included on your command path. To test this, issue a "ant -version" command from your
shell (command prompt) and verify that Ant is available.
+ Install Apache Ivy binary distribution (2.2.0) from http://ant.apache.org/ivy/
+ You will need to place ivy-2.2.0.jar file in ~/.ant/lib.
+
3. Download the Apache Solr distribution, linked from the above web site.
Unzip the distribution to a folder of your choice, e.g. C:\solr or ~/solr
Alternately, you can obtain a copy of the latest Apache Solr source code
diff --git a/solr/build.xml b/solr/build.xml
index 84b2093c9bb..3588a485e70 100644
--- a/solr/build.xml
+++ b/solr/build.xml
@@ -40,7 +40,7 @@
<!-- ========================================================================= -->
<target name="example" description="Creates a runnable example configuration."
- depends="dist-contrib,dist-war">
+ depends="resolve-example,dist-contrib,dist-war">
<copy file="${dist}/${fullnamever}.war"
tofile="${example}/webapps/${ant.project.name}.war"/>
<jar destfile="${example}/exampledocs/post.jar"
@@ -55,6 +55,14 @@
</delete>
<echo>See ${example}/README.txt for how to run the Solr example configuration.</echo>
</target>
+
+ <!-- example-DIH needs hsqldb. don't put anything here needed by *tests* -->
+ <target name="resolve-example" unless="example.libs.uptodate">
+ <ant dir="${common-solr.dir}/example/example-DIH" target="resolve" inheritAll="false">
+ <propertyset refid="uptodate.and.compiled.properties"/>
+ </ant>
+ <property name="example.libs.uptodate" value="true"/>
+ </target>
<target name="run-example" depends="example"
description="Run Solr interactively, via Jetty. -Dexample.debug=true to enable JVM debugger">
@@ -171,7 +179,7 @@
</target>
<!-- Validation (license/ notice checks). -->
- <target name="validate" depends="compile-tools" description="Validate legal stuff.">
+ <target name="validate" depends="compile-tools,resolve" description="Validate legal stuff.">
<license-check-macro dir="${basedir}">
<additional-excludes>
<!-- Exclude start.jar only (it'd be weird to have a license file there?) -->
@@ -454,8 +462,25 @@
<!-- NOOP -->
</target>
+ <target name="resolve" depends="resolve-example,resolve-jetty">
+ <sequential>
+ <ant dir="core" target="resolve" inheritall="false">
+ <propertyset refid="uptodate.and.compiled.properties"/>
+ </ant>
+ <ant dir="solrj" target="resolve" inheritall="false">
+ <propertyset refid="uptodate.and.compiled.properties"/>
+ </ant>
+ <ant dir="test-framework" target="resolve" inheritall="false">
+ <propertyset refid="uptodate.and.compiled.properties"/>
+ </ant>
+ <contrib-crawl target="resolve"/>
+ </sequential>
+ </target>
+
+ <!-- since we build across all contribs, we must ensure all deps
+ are resolved -->
<target name="javadocs-all"
- depends="prep-lucene-jars,javadocs-dep,lucene-javadocs-all,define-lucene-javadoc-url"
+ depends="resolve,prep-lucene-jars,javadocs-dep,define-lucene-javadoc-url"
description="Generate javadoc for core, java client and contrib">
<sequential>
<mkdir dir="${dest}/docs/api"/>
@@ -508,10 +533,7 @@
</sequential>
</target>
- <target name="generate-maven-artifacts">
- <taskdef uri="antlib:org.apache.maven.artifact.ant"
- resource="org/apache/maven/artifact/ant/antlib.xml"
- classpathref="maven-ant-tasks.classpath" />
+ <target name="generate-maven-artifacts" depends="install-maven-tasks">
<sequential>
<ant target="get-maven-poms" dir=".." inheritall="false"/>
<m2-deploy pom.xml="pom.xml"/> <!-- Solr parent POM -->
@@ -725,8 +747,14 @@
tofile="${analysis.conf.dest}/stopwords_tr.txt"/>
</target>
- <!-- temporarily added before LUCENE-3930, to avoid
- any broken builds from timing issues: so hudson
- won't invoke ant target that does not exist -->
- <target name="clean-jars"/>
+ <!-- TODO: in the future, we don't need to actually put
+ jars in the lib/ folders, but can just put in classpath.
+ only packaging tasks really need that (and could do it
+ under build/ directories) -->
+ <target name="clean-jars" description="Clean local jars">
+ <delete>
+ <fileset dir="." includes="**/*.jar"/>
+ </delete>
+ </target>
+
</project>
diff --git a/solr/common-build.xml b/solr/common-build.xml
index d7078ce3e3a..b57f2d3ac04 100644
--- a/solr/common-build.xml
+++ b/solr/common-build.xml
@@ -60,13 +60,11 @@
</condition>
<path id="additional.dependencies">
- <fileset dir="${common-solr.dir}/lib" includes="**/*.jar"/>
- <fileset dir="${common-solr.dir}/example/lib" includes="**/*.jar"/>
- <fileset dir="lib" includes="**/*.jar" erroronmissingdir="false"/>
+ <fileset dir="${common-solr.dir}/lib" excludes="*.txt,*.template"/>
+ <fileset dir="${common-solr.dir}/example/lib" excludes="*.txt,*.template"/>
+ <fileset dir="lib" excludes="*.txt,*.template" erroronmissingdir="false"/>
</path>
- <pathconvert property="project.classpath" targetos="unix" refid="additional.dependencies"/>
-
<import file="${common-solr.dir}/../lucene/contrib/contrib-build.xml"/>
<!-- Solr Specification Version
@@ -94,6 +92,7 @@
<pathelement path="${queryparser.jar}"/>
<pathelement location="${common-solr.dir}/build/solr-solrj/classes/java"/>
<pathelement location="${common-solr.dir}/build/solr-core/classes/java"/>
+ <path refid="additional.dependencies"/>
<path refid="base.classpath"/>
</path>
@@ -190,18 +189,14 @@
<solr-jarify/>
</target>
- <target name="compile-core" depends="prep-lucene-jars,common.compile-core"/>
+ <target name="compile-core" depends="prep-lucene-jars,resolve-jetty,common.compile-core"/>
<target name="compile-test" depends="sync-resources,compile-solr-test-framework,common.compile-test"/>
<target name="dist" depends="jar-core">
<copy file="${build.dir}/${fullnamever}.jar" todir="${dist}"/>
</target>
- <target name="lucene-javadocs-all">
- <ant dir="${common.dir}" target="javadocs-all" inheritall="false"/>
- </target>
-
- <target name="javadocs" depends="compile-core,lucene-javadocs-all,define-lucene-javadoc-url">
+ <target name="javadocs" depends="compile-core,define-lucene-javadoc-url">
<sequential>
<mkdir dir="${javadoc.dir}"/>
<mkdir dir="${dest}/META-INF/"/>
@@ -300,6 +295,14 @@
<property name="solr.test.framework.compiled" value="true"/>
</target>
+ <!-- resolve jetty dependencies in the example (relied upon by compile!) -->
+ <target name="resolve-jetty" unless="jetty.libs.uptodate">
+ <ant dir="${common-solr.dir}/example" target="resolve" inheritAll="false">
+ <propertyset refid="uptodate.and.compiled.properties"/>
+ </ant>
+ <property name="jetty.libs.uptodate" value="true"/>
+ </target>
+
<!-- Solr contrib targets -->
<target name="compile-contrib" description="Compile contrib modules">
<contrib-crawl target="compile-core"/>
diff --git a/solr/contrib/analysis-extras/build.xml b/solr/contrib/analysis-extras/build.xml
index 2a814c75efd..04c81ebb3e8 100644
--- a/solr/contrib/analysis-extras/build.xml
+++ b/solr/contrib/analysis-extras/build.xml
@@ -26,6 +26,7 @@
<import file="../contrib-build.xml"/>
<path id="classpath">
+ <fileset dir="lib" excludes="*.txt"/>
<pathelement path="${analyzers-icu.jar}"/>
<pathelement path="${analyzers-smartcn.jar}"/>
<pathelement path="${analyzers-stempel.jar}"/>
diff --git a/solr/contrib/analysis-extras/ivy.xml b/solr/contrib/analysis-extras/ivy.xml
new file mode 100644
index 00000000000..62fcffbab96
--- /dev/null
+++ b/solr/contrib/analysis-extras/ivy.xml
@@ -0,0 +1,25 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.solr" module="analysis-extras"/>
+ <dependencies>
+ <dependency org="com.ibm.icu" name="icu4j" rev="4.8.1.1" transitive="false"/>
+ <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+ </dependencies>
+</ivy-module>
diff --git a/solr/contrib/analysis-extras/lib/icu4j-4_8_1_1.jar b/solr/contrib/analysis-extras/lib/icu4j-4_8_1_1.jar
deleted file mode 100644
index 098d38b6fbf..00000000000
--- a/solr/contrib/analysis-extras/lib/icu4j-4_8_1_1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[a97d575b7d923c1c4f5deb5a735cd45fbc084230] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/clustering/ivy.xml b/solr/contrib/clustering/ivy.xml
new file mode 100644
index 00000000000..d2244f9a0bf
--- /dev/null
+++ b/solr/contrib/clustering/ivy.xml
@@ -0,0 +1,31 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.solr" module="clustering"/>
+ <dependencies>
+ <dependency org="org.carrot2" name="carrot2-core" rev="3.5.0" transitive="false"/>
+ <dependency org="com.carrotsearch" name="hppc" rev="0.3.3" transitive="false"/>
+ <dependency org="org.codehaus.jackson" name="jackson-core-asl" rev="1.5.2" transitive="false"/>
+ <dependency org="org.codehaus.jackson" name="jackson-mapper-asl" rev="1.5.2" transitive="false"/>
+ <dependency org="org.apache.mahout" name="mahout-collections" rev="0.3" transitive="false"/>
+ <dependency org="org.apache.mahout" name="mahout-math" rev="0.3" transitive="false"/>
+ <dependency org="org.simpleframework" name="simple-xml" rev="2.4.1" transitive="false"/>
+ <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+ </dependencies>
+</ivy-module>
diff --git a/solr/contrib/clustering/lib/carrot2-core-3.5.0.jar b/solr/contrib/clustering/lib/carrot2-core-3.5.0.jar
deleted file mode 100644
index d4385537a49..00000000000
--- a/solr/contrib/clustering/lib/carrot2-core-3.5.0.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[adc127c48137d03e252f526de84a07c8d6bda521] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/clustering/lib/hppc-0.3.3.jar b/solr/contrib/clustering/lib/hppc-0.3.3.jar
deleted file mode 100644
index 8a6a30d74e9..00000000000
--- a/solr/contrib/clustering/lib/hppc-0.3.3.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[0da24b80aab135dc5811731b4e8aa69a77256d8a] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/clustering/lib/jackson-core-asl-1.5.2.jar b/solr/contrib/clustering/lib/jackson-core-asl-1.5.2.jar
deleted file mode 100644
index 15b207865ed..00000000000
--- a/solr/contrib/clustering/lib/jackson-core-asl-1.5.2.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[24107e68fedb0ea04291fa769cf992fc53608c60] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/clustering/lib/jackson-mapper-asl-1.5.2.jar b/solr/contrib/clustering/lib/jackson-mapper-asl-1.5.2.jar
deleted file mode 100644
index e054dc10a72..00000000000
--- a/solr/contrib/clustering/lib/jackson-mapper-asl-1.5.2.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[ebf9b5ef21631c4c76e21ae6fc35b0a9f7336d2c] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/clustering/lib/mahout-collections-0.3.jar b/solr/contrib/clustering/lib/mahout-collections-0.3.jar
deleted file mode 100644
index e8a35281f70..00000000000
--- a/solr/contrib/clustering/lib/mahout-collections-0.3.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[06481add9c7ebce50b75f14d469566906bc0d5a3] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/clustering/lib/mahout-math-0.3.jar b/solr/contrib/clustering/lib/mahout-math-0.3.jar
deleted file mode 100644
index cf74a18768c..00000000000
--- a/solr/contrib/clustering/lib/mahout-math-0.3.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[374e19d07c7f073dc9c84f4dfada8c944389efc0] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/clustering/lib/simple-xml-2.4.1.jar b/solr/contrib/clustering/lib/simple-xml-2.4.1.jar
deleted file mode 100644
index b1d2b1778e8..00000000000
--- a/solr/contrib/clustering/lib/simple-xml-2.4.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[d6fe35161bb0bf31fe8f90a20fb58181f102bae1] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/dataimporthandler-extras/build.xml b/solr/contrib/dataimporthandler-extras/build.xml
index 3dffc3f66f6..20f6e47bee2 100644
--- a/solr/contrib/dataimporthandler-extras/build.xml
+++ b/solr/contrib/dataimporthandler-extras/build.xml
@@ -45,14 +45,21 @@
</ant>
</target>
+ <!-- we don't actually need to compile this thing, we just want its libs -->
+ <target name="resolve-extraction-libs">
+ <ant dir="${common-solr.dir}/contrib/extraction" target="resolve" inheritAll="false">
+ <propertyset refid="uptodate.and.compiled.properties"/>
+ </ant>
+ </target>
+
<path id="classpath">
<pathelement location="${common-solr.dir}/build/contrib/solr-dataimporthandler/classes/java"/>
<pathelement location="${common-solr.dir}/build/contrib/solr-dataimporthandler/classes/test"/>
- <fileset dir="${common-solr.dir}/contrib/dataimporthandler/lib" includes="**/*.jar"/>
- <fileset dir="${common-solr.dir}/contrib/extraction/lib" includes="**/*.jar"/>
+ <fileset dir="${common-solr.dir}/contrib/dataimporthandler/lib" excludes="*.txt"/>
+ <fileset dir="${common-solr.dir}/contrib/extraction/lib" excludes="*.txt"/>
<path refid="solr.base.classpath"/>
</path>
- <target name="compile-core" depends="compile-solr-dataimporthandler, solr-contrib-build.compile-core"/>
+ <target name="compile-core" depends="compile-solr-dataimporthandler,resolve-extraction-libs,solr-contrib-build.compile-core"/>
<target name="compile-test" depends="compile-solr-dataimporthandler-tests, common-solr.compile-test"/>
</project>
diff --git a/solr/contrib/dataimporthandler-extras/ivy.xml b/solr/contrib/dataimporthandler-extras/ivy.xml
new file mode 100644
index 00000000000..ffccafd8895
--- /dev/null
+++ b/solr/contrib/dataimporthandler-extras/ivy.xml
@@ -0,0 +1,21 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.solr" module="dataimporthandler-extras"/>
+</ivy-module>
diff --git a/solr/contrib/dataimporthandler/ivy.xml b/solr/contrib/dataimporthandler/ivy.xml
new file mode 100644
index 00000000000..7331edde3be
--- /dev/null
+++ b/solr/contrib/dataimporthandler/ivy.xml
@@ -0,0 +1,26 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.solr" module="dataimporthandler"/>
+ <dependencies>
+ <dependency org="javax.activation" name="activation" rev="1.1" transitive="false"/>
+ <dependency org="javax.mail" name="mail" rev="1.4.1" transitive="false"/>
+ <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+ </dependencies>
+</ivy-module>
diff --git a/solr/contrib/dataimporthandler/lib/activation-1.1.jar b/solr/contrib/dataimporthandler/lib/activation-1.1.jar
deleted file mode 100644
index 737214c22d4..00000000000
--- a/solr/contrib/dataimporthandler/lib/activation-1.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[53f82a1c4c492dc810c27317857bbb02afd6fa58] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/dataimporthandler/lib/mail-1.4.1.jar b/solr/contrib/dataimporthandler/lib/mail-1.4.1.jar
deleted file mode 100644
index c73aed1bc87..00000000000
--- a/solr/contrib/dataimporthandler/lib/mail-1.4.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[1d15e793ecd1c709de0739a7d3d818266c2e141b] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/ivy.xml b/solr/contrib/extraction/ivy.xml
new file mode 100644
index 00000000000..92ce986e5d7
--- /dev/null
+++ b/solr/contrib/extraction/ivy.xml
@@ -0,0 +1,50 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.solr" module="extraction"/>
+ <dependencies>
+ <dependency org="org.apache.james" name="apache-mime4j-core" rev="0.7" transitive="false"/>
+ <dependency org="org.apache.james" name="apache-mime4j-dom" rev="0.7" transitive="false"/>
+ <dependency org="asm" name="asm" rev="3.1" transitive="false"/>
+ <dependency org="org.bouncycastle" name="bcmail-jdk15" rev="1.45" transitive="false"/>
+ <dependency org="org.bouncycastle" name="bcprov-jdk15" rev="1.45" transitive="false"/>
+ <dependency org="de.l3s.boilerpipe" name="boilerpipe" rev="1.1.0" transitive="false"/>
+ <dependency org="org.apache.commons" name="commons-compress" rev="1.3" transitive="false"/>
+ <dependency org="dom4j" name="dom4j" rev="1.6.1" transitive="false"/>
+ <dependency org="org.apache.pdfbox" name="fontbox" rev="1.6.0" transitive="false"/>
+ <dependency org="com.ibm.icu" name="icu4j" rev="4.8.1.1" transitive="false"/>
+ <dependency org="jdom" name="jdom" rev="1.0" transitive="false"/>
+ <dependency org="org.apache.pdfbox" name="jempbox" rev="1.6.0" transitive="false"/>
+ <dependency org="com.drewnoakes" name="metadata-extractor" rev="2.4.0-beta-1" transitive="false"/>
+ <dependency org="edu.ucar" name="netcdf" rev="4.2-min" transitive="false"/>
+ <dependency org="org.apache.pdfbox" name="pdfbox" rev="1.6.0" transitive="false"/>
+ <dependency org="org.apache.poi" name="poi" rev="3.8-beta4" transitive="false"/>
+ <dependency org="org.apache.poi" name="poi-ooxml" rev="3.8-beta4" transitive="false"/>
+ <dependency org="org.apache.poi" name="poi-scratchpad" rev="3.8-beta4" transitive="false"/>
+ <dependency org="org.apache.poi" name="poi-ooxml-schemas" rev="3.8-beta4" transitive="false"/>
+ <dependency org="rome" name="rome" rev="0.9" transitive="false"/>
+ <dependency org="org.ccil.cowan.tagsoup" name="tagsoup" rev="1.2.1" transitive="false"/>
+ <dependency org="org.apache.tika" name="tika-core" rev="1.0" transitive="false"/>
+ <dependency org="org.apache.tika" name="tika-parsers" rev="1.0" transitive="false"/>
+ <dependency org="xerces" name="xercesImpl" rev="2.8.1" transitive="false"/>
+ <dependency org="xml-apis" name="xml-apis" rev="1.0.b2" transitive="false"/>
+ <dependency org="org.apache.xmlbeans" name="xmlbeans" rev="2.3.0" transitive="false"/>
+ <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+ </dependencies>
+</ivy-module>
diff --git a/solr/contrib/extraction/lib/apache-mime4j-core-0.7.jar b/solr/contrib/extraction/lib/apache-mime4j-core-0.7.jar
deleted file mode 100644
index 0e512958d4e..00000000000
--- a/solr/contrib/extraction/lib/apache-mime4j-core-0.7.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[e3c62523fb93b5e2f73365e6cee0d0bc68e48556] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/apache-mime4j-dom-0.7.jar b/solr/contrib/extraction/lib/apache-mime4j-dom-0.7.jar
deleted file mode 100644
index 7431cce460f..00000000000
--- a/solr/contrib/extraction/lib/apache-mime4j-dom-0.7.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[1f7bf1ea13697ca0243d399ca6e5d864dd8bec0b] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/asm-3.1.jar b/solr/contrib/extraction/lib/asm-3.1.jar
deleted file mode 100644
index 01536921c0d..00000000000
--- a/solr/contrib/extraction/lib/asm-3.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[8217cae0a1bc977b241e0c8517cc2e3e7cede276] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/bcmail-jdk15-1.45.jar b/solr/contrib/extraction/lib/bcmail-jdk15-1.45.jar
deleted file mode 100644
index 88999ac13ee..00000000000
--- a/solr/contrib/extraction/lib/bcmail-jdk15-1.45.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[f66e9a8b9868226121961c13e6a32a55d0b2f78a] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/bcprov-jdk15-1.45.jar b/solr/contrib/extraction/lib/bcprov-jdk15-1.45.jar
deleted file mode 100644
index 589dc60f524..00000000000
--- a/solr/contrib/extraction/lib/bcprov-jdk15-1.45.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[409070b0370a95c14ed4357261afb96b91d10e86] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/boilerpipe-1.1.0.jar b/solr/contrib/extraction/lib/boilerpipe-1.1.0.jar
deleted file mode 100644
index ee17c0a37f8..00000000000
--- a/solr/contrib/extraction/lib/boilerpipe-1.1.0.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[b64b033af70609338c07e2a88a5f7efcd1a84ddb] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/commons-compress-1.3.jar b/solr/contrib/extraction/lib/commons-compress-1.3.jar
deleted file mode 100644
index 0a27da8e395..00000000000
--- a/solr/contrib/extraction/lib/commons-compress-1.3.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[6c826c528b60bb1b25e9053b7f4c920292f6c343] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/dom4j-1.6.1.jar b/solr/contrib/extraction/lib/dom4j-1.6.1.jar
deleted file mode 100644
index cf7601ea8ff..00000000000
--- a/solr/contrib/extraction/lib/dom4j-1.6.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[c8c4dbb92d6c23a7fbb2813eb721eb4cce91750c] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/fontbox-1.6.0.jar b/solr/contrib/extraction/lib/fontbox-1.6.0.jar
deleted file mode 100644
index e03d0869980..00000000000
--- a/solr/contrib/extraction/lib/fontbox-1.6.0.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[c3492fc29b757af3ac49f8fe7e171676d43c1490] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/icu4j-4_8_1_1.jar b/solr/contrib/extraction/lib/icu4j-4_8_1_1.jar
deleted file mode 100644
index 098d38b6fbf..00000000000
--- a/solr/contrib/extraction/lib/icu4j-4_8_1_1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[a97d575b7d923c1c4f5deb5a735cd45fbc084230] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/jdom-1.0.jar b/solr/contrib/extraction/lib/jdom-1.0.jar
deleted file mode 100644
index 1d80940c2cf..00000000000
--- a/solr/contrib/extraction/lib/jdom-1.0.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[288e64cb5c435f34499a58b234c2106f9d9f0783] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/jempbox-1.6.0.jar b/solr/contrib/extraction/lib/jempbox-1.6.0.jar
deleted file mode 100644
index af777e2f6f0..00000000000
--- a/solr/contrib/extraction/lib/jempbox-1.6.0.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[5ca6d7a58b95881d92e04a66c7936bfc596a242a] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/metadata-extractor-2.4.0-beta-1.jar b/solr/contrib/extraction/lib/metadata-extractor-2.4.0-beta-1.jar
deleted file mode 100644
index a396b86ca0b..00000000000
--- a/solr/contrib/extraction/lib/metadata-extractor-2.4.0-beta-1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[3720d649dd56d96f9351435dea7c2c921a0be050] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/netcdf-4.2-min.jar b/solr/contrib/extraction/lib/netcdf-4.2-min.jar
deleted file mode 100644
index 0788d9bc7c9..00000000000
--- a/solr/contrib/extraction/lib/netcdf-4.2-min.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[deb75868dc3800751e1c3b20428cdefe66838cb1] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/pdfbox-1.6.0.jar b/solr/contrib/extraction/lib/pdfbox-1.6.0.jar
deleted file mode 100644
index b650239c35f..00000000000
--- a/solr/contrib/extraction/lib/pdfbox-1.6.0.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[75efe034f1b106938d8c1c1b250b15d39cc0e85b] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/poi-3.8-beta4.jar b/solr/contrib/extraction/lib/poi-3.8-beta4.jar
deleted file mode 100644
index 26ff170ba1b..00000000000
--- a/solr/contrib/extraction/lib/poi-3.8-beta4.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[599102bc1ab991d4f9c784ccc7c4aa935f1c082d] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/poi-ooxml-3.8-beta4.jar b/solr/contrib/extraction/lib/poi-ooxml-3.8-beta4.jar
deleted file mode 100644
index e64d73c6170..00000000000
--- a/solr/contrib/extraction/lib/poi-ooxml-3.8-beta4.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[1fe163b0ab7ed93d7056545ef6fbf8973739c3c8] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/poi-ooxml-schemas-3.8-beta4.jar b/solr/contrib/extraction/lib/poi-ooxml-schemas-3.8-beta4.jar
deleted file mode 100644
index caa54947a7c..00000000000
--- a/solr/contrib/extraction/lib/poi-ooxml-schemas-3.8-beta4.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[00f78f005a8c127a467bb705809e6f4486b997f7] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/poi-scratchpad-3.8-beta4.jar b/solr/contrib/extraction/lib/poi-scratchpad-3.8-beta4.jar
deleted file mode 100644
index ff715946b0a..00000000000
--- a/solr/contrib/extraction/lib/poi-scratchpad-3.8-beta4.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[c6eb9b6c6768e00b5d0a2ee914840d559aee40b8] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/rome-0.9.jar b/solr/contrib/extraction/lib/rome-0.9.jar
deleted file mode 100644
index 796717c03be..00000000000
--- a/solr/contrib/extraction/lib/rome-0.9.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[ba482aecb0d9b5a1b74d038c37a8cdde821b0258] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/tagsoup-1.2.1.jar b/solr/contrib/extraction/lib/tagsoup-1.2.1.jar
deleted file mode 100644
index 4f5e3fd452d..00000000000
--- a/solr/contrib/extraction/lib/tagsoup-1.2.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[27516019174e55260029068045cdfca584b5e21b] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/tika-core-1.0.jar b/solr/contrib/extraction/lib/tika-core-1.0.jar
deleted file mode 100644
index b884eafe101..00000000000
--- a/solr/contrib/extraction/lib/tika-core-1.0.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[5d6bc873cd8bd72dd426090f1b237f373f5fdc00] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/tika-parsers-1.0.jar b/solr/contrib/extraction/lib/tika-parsers-1.0.jar
deleted file mode 100644
index 6ff300c7b86..00000000000
--- a/solr/contrib/extraction/lib/tika-parsers-1.0.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[d5e5f8fa0ad29f21719ea9bc2a85c6a95cd8a205] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/xercesImpl-2.8.1.jar b/solr/contrib/extraction/lib/xercesImpl-2.8.1.jar
deleted file mode 100644
index d29c6a23588..00000000000
--- a/solr/contrib/extraction/lib/xercesImpl-2.8.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[3b351f6e2b566f73b742510738a52b866b4ffd0d] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/xml-apis-1.0.b2.jar b/solr/contrib/extraction/lib/xml-apis-1.0.b2.jar
deleted file mode 100644
index 65531da804a..00000000000
--- a/solr/contrib/extraction/lib/xml-apis-1.0.b2.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[ad33a5afa6ddae02f3ed0b42b1c7fcbf22a7d2ab] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/extraction/lib/xmlbeans-2.3.0.jar b/solr/contrib/extraction/lib/xmlbeans-2.3.0.jar
deleted file mode 100644
index 36e6d816b99..00000000000
--- a/solr/contrib/extraction/lib/xmlbeans-2.3.0.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[ccd8163421ba8d0361315fb947f2432f1e6d7a83] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/langid/build.xml b/solr/contrib/langid/build.xml
index 82047d9e882..dbb8b5a0e44 100644
--- a/solr/contrib/langid/build.xml
+++ b/solr/contrib/langid/build.xml
@@ -26,8 +26,8 @@
<import file="../contrib-build.xml"/>
<path id="classpath">
- <fileset dir="../extraction/lib" includes="*.jar"/>
- <fileset dir="lib" includes="*.jar"/>
+ <fileset dir="../extraction/lib" excludes="*.txt,*.template"/>
+ <fileset dir="lib" excludes="*.txt,*.template"/>
<path refid="solr.base.classpath"/>
</path>
@@ -37,6 +37,15 @@
jar.file="${solr-langid.dir}/lib/jsonic-1.2.0.jar" />
<m2-deploy-with-pom-template pom.xml="${solr-langid.dir}/lib/langdetect-pom.xml.template"
- jar.file="${solr-langid.dir}/lib/langdetect-r111.jar" />
+ jar.file="${solr-langid.dir}/lib/langdetect-c51112119be53a81e59706ce57bacaa90c052284.jar" />
</target>
+
+ <!-- we don't actually need to compile this thing, we just want its libs -->
+ <target name="resolve-extraction-libs">
+ <ant dir="${common-solr.dir}/contrib/extraction" target="resolve" inheritAll="false">
+ <propertyset refid="uptodate.and.compiled.properties"/>
+ </ant>
+ </target>
+
+ <target name="compile-core" depends="resolve-extraction-libs,solr-contrib-build.compile-core"/>
</project>
diff --git a/solr/contrib/langid/ivy.xml b/solr/contrib/langid/ivy.xml
new file mode 100644
index 00000000000..03a75cb5d66
--- /dev/null
+++ b/solr/contrib/langid/ivy.xml
@@ -0,0 +1,29 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.solr" module="langid"/>
+ <dependencies>
+ <dependency org="langdetect" name="langdetect" rev="c51112119be53a81e59706ce57bacaa90c052284">
+ <artifact name="langdetect" type="jar" url="http://language-detection.googlecode.com/git-history/c51112119be53a81e59706ce57bacaa90c052284/lib/langdetect.jar"/>
+ </dependency>
+ <dependency org="jsonic" name="jsonic" rev="1.2.0">
+ <artifact name="jsonic" type="jar" url="http://language-detection.googlecode.com/git-history/c51112119be53a81e59706ce57bacaa90c052284/lib/jsonic-1.2.0.jar"/>
+ </dependency>
+ </dependencies>
+</ivy-module>
diff --git a/solr/contrib/langid/lib/jsonic-1.2.0.jar b/solr/contrib/langid/lib/jsonic-1.2.0.jar
deleted file mode 100644
index 5e53f2aa6cb..00000000000
--- a/solr/contrib/langid/lib/jsonic-1.2.0.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[09f9bec102d3d8368e10d30e178a429026abeec6] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/langid/lib/langdetect-r111.jar b/solr/contrib/langid/lib/langdetect-r111.jar
deleted file mode 100644
index 7b3c16c3ccd..00000000000
--- a/solr/contrib/langid/lib/langdetect-r111.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[f0ca94dd3715141e7b3c31cda31cce8667769214] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/uima/ivy.xml b/solr/contrib/uima/ivy.xml
new file mode 100644
index 00000000000..601fa33dd9d
--- /dev/null
+++ b/solr/contrib/uima/ivy.xml
@@ -0,0 +1,30 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.solr" module="uima"/>
+ <dependencies>
+ <dependency org="commons-digester" name="commons-digester" rev="2.0" transitive="false"/>
+ <dependency org="org.apache.uima" name="AlchemyAPIAnnotator" rev="2.3.1" transitive="false"/>
+ <dependency org="org.apache.uima" name="OpenCalaisAnnotator" rev="2.3.1" transitive="false"/>
+ <dependency org="org.apache.uima" name="Tagger" rev="2.3.1" transitive="false"/>
+ <dependency org="org.apache.uima" name="WhitespaceTokenizer" rev="2.3.1" transitive="false"/>
+ <dependency org="org.apache.uima" name="uimaj-core" rev="2.3.1" transitive="false"/>
+ <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+ </dependencies>
+</ivy-module>
diff --git a/modules/analysis/uima/lib/uima-an-tagger-LICENSE-ASL.txt b/solr/contrib/uima/lib/AlchemyAPIAnnotator-LICENSE-ASL.txt
similarity index 100%
rename from modules/analysis/uima/lib/uima-an-tagger-LICENSE-ASL.txt
rename to solr/contrib/uima/lib/AlchemyAPIAnnotator-LICENSE-ASL.txt
diff --git a/solr/contrib/uima/lib/uima-an-alchemy-NOTICE.txt b/solr/contrib/uima/lib/AlchemyAPIAnnotator-NOTICE.txt
similarity index 100%
rename from solr/contrib/uima/lib/uima-an-alchemy-NOTICE.txt
rename to solr/contrib/uima/lib/AlchemyAPIAnnotator-NOTICE.txt
diff --git a/modules/analysis/uima/lib/uima-an-wst-LICENSE-ASL.txt b/solr/contrib/uima/lib/OpenCalaisAnnotator-LICENSE-ASL.txt
similarity index 100%
rename from modules/analysis/uima/lib/uima-an-wst-LICENSE-ASL.txt
rename to solr/contrib/uima/lib/OpenCalaisAnnotator-LICENSE-ASL.txt
diff --git a/solr/contrib/uima/lib/uima-an-calais-NOTICE.txt b/solr/contrib/uima/lib/OpenCalaisAnnotator-NOTICE.txt
similarity index 100%
rename from solr/contrib/uima/lib/uima-an-calais-NOTICE.txt
rename to solr/contrib/uima/lib/OpenCalaisAnnotator-NOTICE.txt
diff --git a/solr/contrib/uima/lib/uima-an-alchemy-LICENSE-ASL.txt b/solr/contrib/uima/lib/Tagger-LICENSE-ASL.txt
similarity index 100%
rename from solr/contrib/uima/lib/uima-an-alchemy-LICENSE-ASL.txt
rename to solr/contrib/uima/lib/Tagger-LICENSE-ASL.txt
diff --git a/solr/contrib/uima/lib/uima-an-tagger-NOTICE.txt b/solr/contrib/uima/lib/Tagger-NOTICE.txt
similarity index 100%
rename from solr/contrib/uima/lib/uima-an-tagger-NOTICE.txt
rename to solr/contrib/uima/lib/Tagger-NOTICE.txt
diff --git a/solr/contrib/uima/lib/uima-an-calais-LICENSE-ASL.txt b/solr/contrib/uima/lib/WhitespaceTokenizer-LICENSE-ASL.txt
similarity index 100%
rename from solr/contrib/uima/lib/uima-an-calais-LICENSE-ASL.txt
rename to solr/contrib/uima/lib/WhitespaceTokenizer-LICENSE-ASL.txt
diff --git a/solr/contrib/uima/lib/uima-an-wst-NOTICE.txt b/solr/contrib/uima/lib/WhitespaceTokenizer-NOTICE.txt
similarity index 100%
rename from solr/contrib/uima/lib/uima-an-wst-NOTICE.txt
rename to solr/contrib/uima/lib/WhitespaceTokenizer-NOTICE.txt
diff --git a/solr/contrib/uima/lib/commons-digester-2.0.jar b/solr/contrib/uima/lib/commons-digester-2.0.jar
deleted file mode 100644
index bd9b6332cd4..00000000000
--- a/solr/contrib/uima/lib/commons-digester-2.0.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[9c8bd13a2002a9ff5b35b873b9f111d5281ad201] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/uima/lib/uima-an-alchemy-2.3.1.jar b/solr/contrib/uima/lib/uima-an-alchemy-2.3.1.jar
deleted file mode 100644
index a1a0b5e053a..00000000000
--- a/solr/contrib/uima/lib/uima-an-alchemy-2.3.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[d329eb1c65d63464b09ad710db21c14e74677795] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/uima/lib/uima-an-calais-2.3.1.jar b/solr/contrib/uima/lib/uima-an-calais-2.3.1.jar
deleted file mode 100644
index 0af37af6700..00000000000
--- a/solr/contrib/uima/lib/uima-an-calais-2.3.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[cb2fcfdcf1f3e9bd8bbb7289e6944facc28b833c] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/uima/lib/uima-an-tagger-2.3.1.jar b/solr/contrib/uima/lib/uima-an-tagger-2.3.1.jar
deleted file mode 100644
index e30333f76a9..00000000000
--- a/solr/contrib/uima/lib/uima-an-tagger-2.3.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[dffd510b7429dcbe37a283da92cbf06c1cfbe383] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/uima/lib/uima-an-wst-2.3.1.jar b/solr/contrib/uima/lib/uima-an-wst-2.3.1.jar
deleted file mode 100644
index 289f397f6ba..00000000000
--- a/solr/contrib/uima/lib/uima-an-wst-2.3.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[10866014d8887bfdd8bfec43d3fdd780428d4ed4] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/uima/lib/uima-an-wst-LICENSE-ASL.txt b/solr/contrib/uima/lib/uima-an-wst-LICENSE-ASL.txt
deleted file mode 100644
index d6456956733..00000000000
--- a/solr/contrib/uima/lib/uima-an-wst-LICENSE-ASL.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
diff --git a/solr/contrib/uima/lib/uimaj-core-2.3.1.jar b/solr/contrib/uima/lib/uimaj-core-2.3.1.jar
deleted file mode 100644
index 4c7359f79ae..00000000000
--- a/solr/contrib/uima/lib/uimaj-core-2.3.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[e876a9749eed73ec2c95b83cf534d7a373130569] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/velocity/ivy.xml b/solr/contrib/velocity/ivy.xml
new file mode 100644
index 00000000000..8bb470299dc
--- /dev/null
+++ b/solr/contrib/velocity/ivy.xml
@@ -0,0 +1,28 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.solr" module="velocity"/>
+ <dependencies>
+ <dependency org="commons-beanutils" name="commons-beanutils" rev="1.7.0" transitive="false"/>
+ <dependency org="commons-collections" name="commons-collections" rev="3.2.1" transitive="false"/>
+ <dependency org="org.apache.velocity" name="velocity" rev="1.6.4" transitive="false"/>
+ <dependency org="org.apache.velocity" name="velocity-tools" rev="2.0" transitive="false"/>
+ <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+ </dependencies>
+</ivy-module>
diff --git a/solr/contrib/velocity/lib/commons-beanutils-1.7.0.jar b/solr/contrib/velocity/lib/commons-beanutils-1.7.0.jar
deleted file mode 100644
index e2113569e52..00000000000
--- a/solr/contrib/velocity/lib/commons-beanutils-1.7.0.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[b1b89c9c921f16af22a88db3ff28975a8e40d886] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/velocity/lib/commons-collections-3.2.1.jar b/solr/contrib/velocity/lib/commons-collections-3.2.1.jar
deleted file mode 100644
index 3e2ca02b0ae..00000000000
--- a/solr/contrib/velocity/lib/commons-collections-3.2.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[c35fa1fee145cba638884e41b80a401cbe4924ef] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/velocity/lib/velocity-1.6.4.jar b/solr/contrib/velocity/lib/velocity-1.6.4.jar
deleted file mode 100644
index 7c33fe0d48e..00000000000
--- a/solr/contrib/velocity/lib/velocity-1.6.4.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[e7151c5cd4167ff1d3e17e7a715d7a4fcb5b010c] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/velocity/lib/velocity-tools-2.0.jar b/solr/contrib/velocity/lib/velocity-tools-2.0.jar
deleted file mode 100644
index e5aebf4a579..00000000000
--- a/solr/contrib/velocity/lib/velocity-tools-2.0.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[beb7434d58f5e15b46263c9f24e197c50695b46d] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/core/build.xml b/solr/core/build.xml
index bcee88f3b71..44cb84af87e 100644
--- a/solr/core/build.xml
+++ b/solr/core/build.xml
@@ -18,15 +18,12 @@
<project name="solr-core" default="default">
<description>Solr Core</description>
+ <!-- hackidty-hack-hack -->
+
+ <property name="ivy.retrieve.pattern" value="${common-solr.dir}/lib/[artifact]-[revision].[ext]"/>
+
<import file="../common-build.xml"/>
<target name="compile-core" depends="compile-solrj,common-solr.compile-core"/>
- <target name="dist-maven" depends="jar-core,javadocs,jar-src,common.dist-maven">
- <m2-deploy-with-pom-template pom.xml="${common-solr.dir}/lib/apache-solr-commons-csv-pom.xml.template"
- jar.file="${common-solr.dir}/lib/apache-solr-commons-csv-1.0-SNAPSHOT-r966014.jar" />
-
- <m2-deploy-with-pom-template pom.xml="${common-solr.dir}/lib/apache-solr-noggit-pom.xml.template"
- jar.file="${common-solr.dir}/lib/apache-solr-noggit-r1211150.jar" />
- </target>
</project>
diff --git a/solr/core/ivy.xml b/solr/core/ivy.xml
new file mode 100644
index 00000000000..7bd36aa717a
--- /dev/null
+++ b/solr/core/ivy.xml
@@ -0,0 +1,41 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.solr" module="core"/>
+
+ <dependencies>
+ <dependency org="commons-codec" name="commons-codec" rev="1.6" transitive="false"/>
+ <dependency org="commons-fileupload" name="commons-fileupload" rev="1.2.1" transitive="false"/>
+ <dependency org="org.apache.httpcomponents" name="httpcore" rev="4.1.4" transitive="false"/>
+ <dependency org="org.apache.httpcomponents" name="httpclient" rev="4.1.3" transitive="false"/>
+ <dependency org="org.apache.httpcomponents" name="httpmime" rev="4.1.3" transitive="false"/>
+ <dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.6.1" transitive="false"/>
+ <dependency org="commons-io" name="commons-io" rev="2.1" transitive="false"/>
+ <dependency org="commons-lang" name="commons-lang" rev="2.6" transitive="false"/>
+ <dependency org="com.google.guava" name="guava" rev="r05" transitive="false"/>
+ <dependency org="org.codehaus.woodstox" name="wstx-asl" rev="3.2.7" transitive="false"/>
+ <dependency org="org.easymock" name="easymock" rev="2.2" transitive="false"/>
+ <dependency org="org.slf4j" name="slf4j-api" rev="1.6.1" transitive="false"/>
+ <dependency org="org.slf4j" name="slf4j-jdk14" rev="1.6.1" transitive="false"/>
+ <dependency org="com.spatial4j" name="spatial4j" rev="0.2" transitive="false"/>
+ <dependency org="junit" name="junit" rev="4.10" transitive="false"/>
+ <dependency org="javax.servlet" name="javax.servlet-api" rev="3.0.1" transitive="false"/>
+ <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+ </dependencies>
+</ivy-module>
diff --git a/solr/core/src/java/org/apache/solr/internal/csv/CSVParser.java b/solr/core/src/java/org/apache/solr/internal/csv/CSVParser.java
new file mode 100644
index 00000000000..27b3ab1931e
--- /dev/null
+++ b/solr/core/src/java/org/apache/solr/internal/csv/CSVParser.java
@@ -0,0 +1,605 @@
+/*
+ * 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.
+ */
+package org.apache.solr.internal.csv;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.InputStreamReader;
+import java.io.InputStream;
+import java.util.ArrayList;
+
+
+/**
+ * Parses CSV files according to the specified configuration.
+ *
+ * Because CSV appears in many different dialects, the parser supports many
+ * configuration settings by allowing the specification of a {@link CSVStrategy}.
+ *
+ * <p>Parsing of a csv-string having tabs as separators,
+ * '"' as an optional value encapsulator, and comments starting with '#':</p>
+ * <pre>
+ * String[][] data =
+ * (new CSVParser(new StringReader("a\tb\nc\td"), new CSVStrategy('\t','"','#'))).getAllValues();
+ * </pre>
+ *
+ * <p>Parsing of a csv-string in Excel CSV format</p>
+ * <pre>
+ * String[][] data =
+ * (new CSVParser(new StringReader("a;b\nc;d"), CSVStrategy.EXCEL_STRATEGY)).getAllValues();
+ * </pre>
+ *
+ * <p>
+ * Internal parser state is completely covered by the strategy
+ * and the reader-state.</p>
+ *
+ * <p>see <a href="package-summary.html">package documentation</a>
+ * for more details</p>
+ */
+public class CSVParser {
+
+ /** length of the initial token (content-)buffer */
+ private static final int INITIAL_TOKEN_LENGTH = 50;
+
+ // the token types
+ /** Token has no valid content, i.e. is in its initilized state. */
+ protected static final int TT_INVALID = -1;
+ /** Token with content, at beginning or in the middle of a line. */
+ protected static final int TT_TOKEN = 0;
+ /** Token (which can have content) when end of file is reached. */
+ protected static final int TT_EOF = 1;
+ /** Token with content when end of a line is reached. */
+ protected static final int TT_EORECORD = 2;
+
+ /** Immutable empty String array. */
+ private static final String[] EMPTY_STRING_ARRAY = new String[0];
+
+ // the input stream
+ private final ExtendedBufferedReader in;
+
+ private final CSVStrategy strategy;
+
+ // the following objects are shared to reduce garbage
+ /** A record buffer for getLine(). Grows as necessary and is reused. */
+ private final ArrayList record = new ArrayList();
+ private final Token reusableToken = new Token();
+ private final CharBuffer wsBuf = new CharBuffer();
+ private final CharBuffer code = new CharBuffer(4);
+
+
+ /**
+ * Token is an internal token representation.
+ *
+ * It is used as contract between the lexer and the parser.
+ */
+ static class Token {
+ /** Token type, see TT_xxx constants. */
+ int type = TT_INVALID;
+ /** The content buffer. */
+ CharBuffer content = new CharBuffer(INITIAL_TOKEN_LENGTH);
+ /** Token ready flag: indicates a valid token with content (ready for the parser). */
+ boolean isReady;
+
+ Token reset() {
+ content.clear();
+ type = TT_INVALID;
+ isReady = false;
+ return this;
+ }
+ }
+
+ // ======================================================
+ // the constructor
+ // ======================================================
+
+ /**
+ * Default strategy for the parser follows the default {@link CSVStrategy}.
+ *
+ * @param input an InputStream containing "csv-formatted" stream
+ * @deprecated use {@link #CSVParser(Reader)}.
+ */
+ public CSVParser(InputStream input) {
+ this(new InputStreamReader(input));
+ }
+
+ /**
+ * CSV parser using the default {@link CSVStrategy}.
+ *
+ * @param input a Reader containing "csv-formatted" input
+ */
+ public CSVParser(Reader input) {
+ // note: must match default-CSV-strategy !!
+ this(input, ',');
+ }
+
+ /**
+ * Customized value delimiter parser.
+ *
+ * The parser follows the default {@link CSVStrategy}
+ * except for the delimiter setting.
+ *
+ * @param input a Reader based on "csv-formatted" input
+ * @param delimiter a Char used for value separation
+ * @deprecated use {@link #CSVParser(Reader,CSVStrategy)}.
+ */
+ public CSVParser(Reader input, char delimiter) {
+ this(input, delimiter, '"', CSVStrategy.COMMENTS_DISABLED);
+ }
+
+ /**
+ * Customized csv parser.
+ *
+ * The parser parses according to the given CSV dialect settings.
+ * Leading whitespaces are truncated, unicode escapes are
+ * not interpreted and empty lines are ignored.
+ *
+ * @param input a Reader based on "csv-formatted" input
+ * @param delimiter a Char used for value separation
+ * @param encapsulator a Char used as value encapsulation marker
+ * @param commentStart a Char used for comment identification
+ * @deprecated use {@link #CSVParser(Reader,CSVStrategy)}.
+ */
+ public CSVParser(Reader input, char delimiter, char encapsulator, char commentStart) {
+ this(input, new CSVStrategy(delimiter, encapsulator, commentStart));
+ }
+
+ /**
+ * Customized CSV parser using the given {@link CSVStrategy}
+ *
+ * @param input a Reader containing "csv-formatted" input
+ * @param strategy the CSVStrategy used for CSV parsing
+ */
+ public CSVParser(Reader input, CSVStrategy strategy) {
+ this.in = new ExtendedBufferedReader(input);
+ this.strategy = strategy;
+ }
+
+ // ======================================================
+ // the parser
+ // ======================================================
+
+ /**
+ * Parses the CSV according to the given strategy
+ * and returns the content as an array of records
+ * (whereas records are arrays of single values).
+ * <p>
+ * The returned content starts at the current parse-position in
+ * the stream.
+ *
+ * @return matrix of records x values ('null' when end of file)
+ * @throws IOException on parse error or input read-failure
+ */
+ public String[][] getAllValues() throws IOException {
+ ArrayList records = new ArrayList();
+ String[] values;
+ String[][] ret = null;
+ while ((values = getLine()) != null) {
+ records.add(values);
+ }
+ if (records.size() > 0) {
+ ret = new String[records.size()][];
+ records.toArray(ret);
+ }
+ return ret;
+ }
+
+ /**
+ * Parses the CSV according to the given strategy
+ * and returns the next csv-value as string.
+ *
+ * @return next value in the input stream ('null' when end of file)
+ * @throws IOException on parse error or input read-failure
+ */
+ public String nextValue() throws IOException {
+ Token tkn = nextToken();
+ String ret = null;
+ switch (tkn.type) {
+ case TT_TOKEN:
+ case TT_EORECORD:
+ ret = tkn.content.toString();
+ break;
+ case TT_EOF:
+ ret = null;
+ break;
+ case TT_INVALID:
+ default:
+ // error no token available (or error)
+ throw new IOException(
+ "(line " + getLineNumber()
+ + ") invalid parse sequence");
+ // unreachable: break;
+ }
+ return ret;
+ }
+
+ /**
+ * Parses from the current point in the stream til
+ * the end of the current line.
+ *
+ * @return array of values til end of line
+ * ('null' when end of file has been reached)
+ * @throws IOException on parse error or input read-failure
+ */
+ public String[] getLine() throws IOException {
+ String[] ret = EMPTY_STRING_ARRAY;
+ record.clear();
+ while (true) {
+ reusableToken.reset();
+ nextToken(reusableToken);
+ switch (reusableToken.type) {
+ case TT_TOKEN:
+ record.add(reusableToken.content.toString());
+ break;
+ case TT_EORECORD:
+ record.add(reusableToken.content.toString());
+ break;
+ case TT_EOF:
+ if (reusableToken.isReady) {
+ record.add(reusableToken.content.toString());
+ } else {
+ ret = null;
+ }
+ break;
+ case TT_INVALID:
+ default:
+ // error: throw IOException
+ throw new IOException("(line " + getLineNumber() + ") invalid parse sequence");
+ // unreachable: break;
+ }
+ if (reusableToken.type != TT_TOKEN) {
+ break;
+ }
+ }
+ if (!record.isEmpty()) {
+ ret = (String[]) record.toArray(new String[record.size()]);
+ }
+ return ret;
+ }
+
+ /**
+ * Returns the current line number in the input stream.
+ *
+ * ATTENTION: in case your csv has multiline-values the returned
+ * number does not correspond to the record-number
+ *
+ * @return current line number
+ */
+ public int getLineNumber() {
+ return in.getLineNumber();
+ }
+
+ // ======================================================
+ // the lexer(s)
+ // ======================================================
+
+ /**
+ * Convenience method for <code>nextToken(null)</code>.
+ */
+ protected Token nextToken() throws IOException {
+ return nextToken(new Token());
+ }
+
+ /**
+ * Returns the next token.
+ *
+ * A token corresponds to a term, a record change or an
+ * end-of-file indicator.
+ *
+ * @param tkn an existing Token object to reuse. The caller is responsible to initialize the
+ * Token.
+ * @return the next token found
+ * @throws IOException on stream access error
+ */
+ protected Token nextToken(Token tkn) throws IOException {
+ wsBuf.clear(); // resuse
+
+ // get the last read char (required for empty line detection)
+ int lastChar = in.readAgain();
+
+ // read the next char and set eol
+ /* note: unfourtunately isEndOfLine may consumes a character silently.
+ * this has no effect outside of the method. so a simple workaround
+ * is to call 'readAgain' on the stream...
+ * uh: might using objects instead of base-types (jdk1.5 autoboxing!)
+ */
+ int c = in.read();
+ boolean eol = isEndOfLine(c);
+ c = in.readAgain();
+
+ // empty line detection: eol AND (last char was EOL or beginning)
+ while (strategy.getIgnoreEmptyLines() && eol
+ && (lastChar == '\n'
+ || lastChar == ExtendedBufferedReader.UNDEFINED)
+ && !isEndOfFile(lastChar)) {
+ // go on char ahead ...
+ lastChar = c;
+ c = in.read();
+ eol = isEndOfLine(c);
+ c = in.readAgain();
+ // reached end of file without any content (empty line at the end)
+ if (isEndOfFile(c)) {
+ tkn.type = TT_EOF;
+ return tkn;
+ }
+ }
+
+ // did we reached eof during the last iteration already ? TT_EOF
+ if (isEndOfFile(lastChar) || (lastChar != strategy.getDelimiter() && isEndOfFile(c))) {
+ tkn.type = TT_EOF;
+ return tkn;
+ }
+
+ // important: make sure a new char gets consumed in each iteration
+ while (!tkn.isReady && tkn.type != TT_EOF) {
+ // ignore whitespaces at beginning of a token
+ while (strategy.getIgnoreLeadingWhitespaces() && isWhitespace(c) && !eol) {
+ wsBuf.append((char) c);
+ c = in.read();
+ eol = isEndOfLine(c);
+ }
+ // ok, start of token reached: comment, encapsulated, or token
+ if (c == strategy.getCommentStart()) {
+ // ignore everything till end of line and continue (incr linecount)
+ in.readLine();
+ tkn = nextToken(tkn.reset());
+ } else if (c == strategy.getDelimiter()) {
+ // empty token return TT_TOKEN("")
+ tkn.type = TT_TOKEN;
+ tkn.isReady = true;
+ } else if (eol) {
+ // empty token return TT_EORECORD("")
+ //noop: tkn.content.append("");
+ tkn.type = TT_EORECORD;
+ tkn.isReady = true;
+ } else if (c == strategy.getEncapsulator()) {
+ // consume encapsulated token
+ encapsulatedTokenLexer(tkn, c);
+ } else if (isEndOfFile(c)) {
+ // end of file return TT_EOF()
+ //noop: tkn.content.append("");
+ tkn.type = TT_EOF;
+ tkn.isReady = true;
+ } else {
+ // next token must be a simple token
+ // add removed blanks when not ignoring whitespace chars...
+ if (!strategy.getIgnoreLeadingWhitespaces()) {
+ tkn.content.append(wsBuf);
+ }
+ simpleTokenLexer(tkn, c);
+ }
+ }
+ return tkn;
+ }
+
+ /**
+ * A simple token lexer
+ *
+ * Simple token are tokens which are not surrounded by encapsulators.
+ * A simple token might contain escaped delimiters (as \, or \;). The
+ * token is finished when one of the following conditions become true:
+ * <ul>
+ * <li>end of line has been reached (TT_EORECORD)</li>
+ * <li>end of stream has been reached (TT_EOF)</li>
+ * <li>an unescaped delimiter has been reached (TT_TOKEN)</li>
+ * </ul>
+ *
+ * @param tkn the current token
+ * @param c the current character
+ * @return the filled token
+ *
+ * @throws IOException on stream access error
+ */
+ private Token simpleTokenLexer(Token tkn, int c) throws IOException {
+ for (;;) {
+ if (isEndOfLine(c)) {
+ // end of record
+ tkn.type = TT_EORECORD;
+ tkn.isReady = true;
+ break;
+ } else if (isEndOfFile(c)) {
+ // end of file
+ tkn.type = TT_EOF;
+ tkn.isReady = true;
+ break;
+ } else if (c == strategy.getDelimiter()) {
+ // end of token
+ tkn.type = TT_TOKEN;
+ tkn.isReady = true;
+ break;
+ } else if (c == '\\' && strategy.getUnicodeEscapeInterpretation() && in.lookAhead() == 'u') {
+ // interpret unicode escaped chars (like \u0070 -> p)
+ tkn.content.append((char) unicodeEscapeLexer(c));
+ } else if (c == strategy.getEscape()) {
+ tkn.content.append((char)readEscape(c));
+ } else {
+ tkn.content.append((char) c);
+ }
+
+ c = in.read();
+ }
+
+ if (strategy.getIgnoreTrailingWhitespaces()) {
+ tkn.content.trimTrailingWhitespace();
+ }
+
+ return tkn;
+ }
+
+
+ /**
+ * An encapsulated token lexer
+ *
+ * Encapsulated tokens are surrounded by the given encapsulating-string.
+ * The encapsulator itself might be included in the token using a
+ * doubling syntax (as "", '') or using escaping (as in \", \').
+ * Whitespaces before and after an encapsulated token are ignored.
+ *
+ * @param tkn the current token
+ * @param c the current character
+ * @return a valid token object
+ * @throws IOException on invalid state
+ */
+ private Token encapsulatedTokenLexer(Token tkn, int c) throws IOException {
+ // save current line
+ int startLineNumber = getLineNumber();
+ // ignore the given delimiter
+ // assert c == delimiter;
+ for (;;) {
+ c = in.read();
+
+ if (c == '\\' && strategy.getUnicodeEscapeInterpretation() && in.lookAhead()=='u') {
+ tkn.content.append((char) unicodeEscapeLexer(c));
+ } else if (c == strategy.getEscape()) {
+ tkn.content.append((char)readEscape(c));
+ } else if (c == strategy.getEncapsulator()) {
+ if (in.lookAhead() == strategy.getEncapsulator()) {
+ // double or escaped encapsulator -> add single encapsulator to token
+ c = in.read();
+ tkn.content.append((char) c);
+ } else {
+ // token finish mark (encapsulator) reached: ignore whitespace till delimiter
+ for (;;) {
+ c = in.read();
+ if (c == strategy.getDelimiter()) {
+ tkn.type = TT_TOKEN;
+ tkn.isReady = true;
+ return tkn;
+ } else if (isEndOfFile(c)) {
+ tkn.type = TT_EOF;
+ tkn.isReady = true;
+ return tkn;
+ } else if (isEndOfLine(c)) {
+ // ok eo token reached
+ tkn.type = TT_EORECORD;
+ tkn.isReady = true;
+ return tkn;
+ } else if (!isWhitespace(c)) {
+ // error invalid char between token and next delimiter
+ throw new IOException(
+ "(line " + getLineNumber()
+ + ") invalid char between encapsulated token end delimiter"
+ );
+ }
+ }
+ }
+ } else if (isEndOfFile(c)) {
+ // error condition (end of file before end of token)
+ throw new IOException(
+ "(startline " + startLineNumber + ")"
+ + "eof reached before encapsulated token finished"
+ );
+ } else {
+ // consume character
+ tkn.content.append((char) c);
+ }
+ }
+ }
+
+
+ /**
+ * Decodes Unicode escapes.
+ *
+ * Interpretation of "\\uXXXX" escape sequences
+ * where XXXX is a hex-number.
+ * @param c current char which is discarded because it's the "\\" of "\\uXXXX"
+ * @return the decoded character
+ * @throws IOException on wrong unicode escape sequence or read error
+ */
+ protected int unicodeEscapeLexer(int c) throws IOException {
+ int ret = 0;
+ // ignore 'u' (assume c==\ now) and read 4 hex digits
+ c = in.read();
+ code.clear();
+ try {
+ for (int i = 0; i < 4; i++) {
+ c = in.read();
+ if (isEndOfFile(c) || isEndOfLine(c)) {
+ throw new NumberFormatException("number too short");
+ }
+ code.append((char) c);
+ }
+ ret = Integer.parseInt(code.toString(), 16);
+ } catch (NumberFormatException e) {
+ throw new IOException(
+ "(line " + getLineNumber() + ") Wrong unicode escape sequence found '"
+ + code.toString() + "'" + e.toString());
+ }
+ return ret;
+ }
+
+ private int readEscape(int c) throws IOException {
+ // assume c is the escape char (normally a backslash)
+ c = in.read();
+ int out;
+ switch (c) {
+ case 'r': out='\r'; break;
+ case 'n': out='\n'; break;
+ case 't': out='\t'; break;
+ case 'b': out='\b'; break;
+ case 'f': out='\f'; break;
+ default : out=c;
+ }
+ return out;
+ }
+
+ // ======================================================
+ // strategies
+ // ======================================================
+
+ /**
+ * Obtain the specified CSV Strategy. This should not be modified.
+ *
+ * @return strategy currently being used
+ */
+ public CSVStrategy getStrategy() {
+ return this.strategy;
+ }
+
+ // ======================================================
+ // Character class checker
+ // ======================================================
+
+ /**
+ * @return true if the given char is a whitespace character
+ */
+ private boolean isWhitespace(int c) {
+ return Character.isWhitespace((char) c) && (c != strategy.getDelimiter());
+ }
+
+ /**
+ * Greedy - accepts \n and \r\n
+ * This checker consumes silently the second control-character...
+ *
+ * @return true if the given character is a line-terminator
+ */
+ private boolean isEndOfLine(int c) throws IOException {
+ // check if we have \r\n...
+ if (c == '\r') {
+ if (in.lookAhead() == '\n') {
+ // note: does not change c outside of this method !!
+ c = in.read();
+ }
+ }
+ return (c == '\n');
+ }
+
+ /**
+ * @return true if the given character indicates end of file
+ */
+ private boolean isEndOfFile(int c) {
+ return c == ExtendedBufferedReader.END_OF_STREAM;
+ }
+}
diff --git a/solr/core/src/java/org/apache/solr/internal/csv/CSVPrinter.java b/solr/core/src/java/org/apache/solr/internal/csv/CSVPrinter.java
new file mode 100644
index 00000000000..9b343d9e0cb
--- /dev/null
+++ b/solr/core/src/java/org/apache/solr/internal/csv/CSVPrinter.java
@@ -0,0 +1,307 @@
+/*
+ * 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.
+ */
+package org.apache.solr.internal.csv;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.Writer;
+
+/**
+ * Print values as a comma separated list.
+ */
+public class CSVPrinter {
+
+ /** The place that the values get written. */
+ protected final Writer out;
+ protected final CSVStrategy strategy;
+
+ /** True if we just began a new line. */
+ protected boolean newLine = true;
+
+ protected char[] buf = new char[0]; // temporary buffer
+
+ /**
+ * Create a printer that will print values to the given
+ * stream following the CSVStrategy.
+ *
+ * Currently, only a pure encapsulation strategy or a pure escaping strategy
+ * is supported. Hybrid strategies (encapsulation and escaping with a different character) are not supported.
+ *
+ * @param out stream to which to print.
+ * @param strategy describes the CSV variation.
+ */
+ public CSVPrinter(Writer out, CSVStrategy strategy) {
+ this.out = out;
+ this.strategy = strategy==null ? CSVStrategy.DEFAULT_STRATEGY : strategy;
+ }
+
+ // ======================================================
+ // printing implementation
+ // ======================================================
+
+ /**
+ * Output a blank line
+ */
+ public void println() throws IOException {
+ out.write(strategy.getPrinterNewline());
+ newLine = true;
+ }
+
+ public void flush() throws IOException {
+ out.flush();
+ }
+
+
+ /**
+ * Print a single line of comma separated values.
+ * The values will be quoted if needed. Quotes and
+ * newLine characters will be escaped.
+ *
+ * @param values values to be outputted.
+ */
+ public void println(String[] values) throws IOException {
+ for (int i = 0; i < values.length; i++) {
+ print(values[i]);
+ }
+ println();
+ }
+
+
+ /**
+ * Put a comment among the comma separated values.
+ * Comments will always begin on a new line and occupy a
+ * least one full line. The character specified to star
+ * comments and a space will be inserted at the beginning of
+ * each new line in the comment.
+ *
+ * @param comment the comment to output
+ */
+ public void printlnComment(String comment) throws IOException {
+ if(this.strategy.isCommentingDisabled()) {
+ return;
+ }
+ if (!newLine) {
+ println();
+ }
+ out.write(this.strategy.getCommentStart());
+ out.write(' ');
+ for (int i = 0; i < comment.length(); i++) {
+ char c = comment.charAt(i);
+ switch (c) {
+ case '\r' :
+ if (i + 1 < comment.length() && comment.charAt(i + 1) == '\n') {
+ i++;
+ }
+ // break intentionally excluded.
+ case '\n' :
+ println();
+ out.write(this.strategy.getCommentStart());
+ out.write(' ');
+ break;
+ default :
+ out.write(c);
+ break;
+ }
+ }
+ println();
+ }
+
+
+ public void print(char[] value, int offset, int len, boolean checkForEscape) throws IOException {
+ if (!checkForEscape) {
+ printSep();
+ out.write(value, offset, len);
+ return;
+ }
+
+ if (strategy.getEncapsulator() != CSVStrategy.ENCAPSULATOR_DISABLED) {
+ printAndEncapsulate(value, offset, len);
+ } else if (strategy.getEscape() != CSVStrategy.ESCAPE_DISABLED) {
+ printAndEscape(value, offset, len);
+ } else {
+ printSep();
+ out.write(value, offset, len);
+ }
+ }
+
+ void printSep() throws IOException {
+ if (newLine) {
+ newLine = false;
+ } else {
+ out.write(this.strategy.getDelimiter());
+ }
+ }
+
+ void printAndEscape(char[] value, int offset, int len) throws IOException {
+ int start = offset;
+ int pos = offset;
+ int end = offset + len;
+
+ printSep();
+
+ char delim = this.strategy.getDelimiter();
+ char escape = this.strategy.getEscape();
+
+ while (pos < end) {
+ char c = value[pos];
+ if (c == '\r' || c=='\n' || c==delim || c==escape) {
+ // write out segment up until this char
+ int l = pos-start;
+ if (l>0) {
+ out.write(value, start, l);
+ }
+ if (c=='\n') c='n';
+ else if (c=='\r') c='r';
+
+ out.write(escape);
+ out.write(c);
+
+ start = pos+1; // start on the current char after this one
+ }
+
+ pos++;
+ }
+
+ // write last segment
+ int l = pos-start;
+ if (l>0) {
+ out.write(value, start, l);
+ }
+ }
+
+ void printAndEncapsulate(char[] value, int offset, int len) throws IOException {
+ boolean first = newLine; // is this the first value on this line?
+ boolean quote = false;
+ int start = offset;
+ int pos = offset;
+ int end = offset + len;
+
+ printSep();
+
+ char delim = this.strategy.getDelimiter();
+ char encapsulator = this.strategy.getEncapsulator();
+
+ if (len <= 0) {
+ // always quote an empty token that is the first
+ // on the line, as it may be the only thing on the
+ // line. If it were not quoted in that case,
+ // an empty line has no tokens.
+ if (first) {
+ quote = true;
+ }
+ } else {
+ char c = value[pos];
+
+ // Hmmm, where did this rule come from?
+ if (first
+ && (c < '0'
+ || (c > '9' && c < 'A')
+ || (c > 'Z' && c < 'a')
+ || (c > 'z'))) {
+ quote = true;
+ // } else if (c == ' ' || c == '\f' || c == '\t') {
+ } else if (c <= '#') {
+ // Some other chars at the start of a value caused the parser to fail, so for now
+ // encapsulate if we start in anything less than '#'. We are being conservative
+ // by including the default comment char too.
+ quote = true;
+ } else {
+ while (pos < end) {
+ c = value[pos];
+ if (c=='\n' || c=='\r' || c==encapsulator || c==delim) {
+ quote = true;
+ break;
+ }
+ pos++;
+ }
+
+ if (!quote) {
+ pos = end-1;
+ c = value[pos];
+ // if (c == ' ' || c == '\f' || c == '\t') {
+ // Some other chars at the end caused the parser to fail, so for now
+ // encapsulate if we end in anything less than ' '
+ if (c <= ' ') {
+ quote = true;
+ }
+ }
+ }
+ }
+
+ if (!quote) {
+ // no encapsulation needed - write out the original value
+ out.write(value, offset, len);
+ return;
+ }
+
+ // we hit something that needed encapsulation
+ out.write(encapsulator);
+
+ // Pick up where we left off: pos should be positioned on the first character that caused
+ // the need for encapsulation.
+ while (pos<end) {
+ char c = value[pos];
+ if (c==encapsulator) {
+ // write out the chunk up until this point
+
+ // add 1 to the length to write out the encapsulator also
+ out.write(value, start, pos-start+1);
+ // put the next starting position on the encapsulator so we will
+ // write it out again with the next string (effectively doubling it)
+ start = pos;
+ }
+ pos++;
+ }
+
+ // write the last segment
+ out.write(value, start, pos-start);
+ out.write(encapsulator);
+ }
+
+ /**
+ * Print the string as the next value on the line. The value
+ * will be escaped or encapsulated as needed if checkForEscape==true
+ *
+ * @param value value to be outputted.
+ */
+ public void print(String value, boolean checkForEscape) throws IOException {
+ if (!checkForEscape) {
+ // write directly from string
+ printSep();
+ out.write(value);
+ return;
+ }
+
+ if (buf.length < value.length()) {
+ buf = new char[value.length()];
+ }
+
+ value.getChars(0, value.length(), buf, 0);
+ print(buf, 0, value.length(), checkForEscape);
+ }
+
+ /**
+ * Print the string as the next value on the line. The value
+ * will be escaped or encapsulated as needed.
+ *
+ * @param value value to be outputted.
+ */
+ public void print(String value) throws IOException {
+ print(value, true);
+ }
+}
diff --git a/solr/core/src/java/org/apache/solr/internal/csv/CSVStrategy.java b/solr/core/src/java/org/apache/solr/internal/csv/CSVStrategy.java
new file mode 100644
index 00000000000..a30a7bea137
--- /dev/null
+++ b/solr/core/src/java/org/apache/solr/internal/csv/CSVStrategy.java
@@ -0,0 +1,150 @@
+/*
+ * 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.
+ */
+package org.apache.solr.internal.csv;
+
+import java.io.Serializable;
+
+/**
+ * CSVStrategy
+ *
+ * Represents the strategy for a CSV.
+ */
+public class CSVStrategy implements Cloneable, Serializable {
+
+ private char delimiter;
+ private char encapsulator;
+ private char commentStart;
+ private char escape;
+ private boolean ignoreLeadingWhitespaces;
+ private boolean ignoreTrailingWhitespaces;
+ private boolean interpretUnicodeEscapes;
+ private boolean ignoreEmptyLines;
+
+ // controls for output
+ private String printerNewline = "\n";
+
+ // -2 is used to signal disabled, because it won't be confused with
+ // an EOF signal (-1), and because \ufffe in UTF-16 would be
+ // encoded as two chars (using surrogates) and thus there should never
+ // be a collision with a real text char.
+ public static char COMMENTS_DISABLED = (char)-2;
+ public static char ESCAPE_DISABLED = (char)-2;
+ public static char ENCAPSULATOR_DISABLED = (char)-2;
+
+ public static CSVStrategy DEFAULT_STRATEGY = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
+ true, false, true);
+ public static CSVStrategy EXCEL_STRATEGY = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, false,
+ false, false, false);
+ public static CSVStrategy TDF_STRATEGY = new CSVStrategy('\t', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
+ true, false, true);
+
+
+ public CSVStrategy(char delimiter, char encapsulator, char commentStart) {
+ this(delimiter, encapsulator, commentStart, true, false, true);
+ }
+
+ /**
+ * Customized CSV strategy setter.
+ *
+ * @param delimiter a Char used for value separation
+ * @param encapsulator a Char used as value encapsulation marker
+ * @param commentStart a Char used for comment identification
+ * @param ignoreLeadingWhitespace TRUE when leading whitespaces should be
+ * ignored
+ * @param interpretUnicodeEscapes TRUE when unicode escapes should be
+ * interpreted
+ * @param ignoreEmptyLines TRUE when the parser should skip emtpy lines
+ */
+ public CSVStrategy(
+ char delimiter,
+ char encapsulator,
+ char commentStart,
+ char escape,
+ boolean ignoreLeadingWhitespace,
+ boolean ignoreTrailingWhitespace,
+ boolean interpretUnicodeEscapes,
+ boolean ignoreEmptyLines)
+ {
+ setDelimiter(delimiter);
+ setEncapsulator(encapsulator);
+ setCommentStart(commentStart);
+ setEscape(escape);
+ setIgnoreLeadingWhitespaces(ignoreLeadingWhitespace);
+ setIgnoreTrailingWhitespaces(ignoreTrailingWhitespace);
+ setUnicodeEscapeInterpretation(interpretUnicodeEscapes);
+ setIgnoreEmptyLines(ignoreEmptyLines);
+ }
+
+ /** @deprecated */
+ public CSVStrategy(
+ char delimiter,
+ char encapsulator,
+ char commentStart,
+ boolean ignoreLeadingWhitespace,
+ boolean interpretUnicodeEscapes,
+ boolean ignoreEmptyLines)
+ {
+ this(delimiter, encapsulator, commentStart, CSVStrategy.ESCAPE_DISABLED, ignoreLeadingWhitespace,
+ true, interpretUnicodeEscapes, ignoreEmptyLines);
+ }
+
+ public void setDelimiter(char delimiter) { this.delimiter = delimiter; }
+ public char getDelimiter() { return this.delimiter; }
+
+ public void setEncapsulator(char encapsulator) { this.encapsulator = encapsulator; }
+ public char getEncapsulator() { return this.encapsulator; }
+
+ public void setCommentStart(char commentStart) { this.commentStart = commentStart; }
+ public char getCommentStart() { return this.commentStart; }
+ public boolean isCommentingDisabled() { return this.commentStart == COMMENTS_DISABLED; }
+
+ public void setEscape(char escape) { this.escape = escape; }
+ public char getEscape() { return this.escape; }
+
+ public void setIgnoreLeadingWhitespaces(boolean ignoreLeadingWhitespaces) {
+ this.ignoreLeadingWhitespaces = ignoreLeadingWhitespaces;
+ }
+ public boolean getIgnoreLeadingWhitespaces() { return this.ignoreLeadingWhitespaces; }
+
+ public void setIgnoreTrailingWhitespaces(boolean ignoreTrailingWhitespaces) {
+ this.ignoreTrailingWhitespaces = ignoreTrailingWhitespaces;
+ }
+ public boolean getIgnoreTrailingWhitespaces() { return this.ignoreTrailingWhitespaces; }
+
+ public void setUnicodeEscapeInterpretation(boolean interpretUnicodeEscapes) {
+ this.interpretUnicodeEscapes = interpretUnicodeEscapes;
+ }
+ public boolean getUnicodeEscapeInterpretation() { return this.interpretUnicodeEscapes; }
+
+ public void setIgnoreEmptyLines(boolean ignoreEmptyLines) { this.ignoreEmptyLines = ignoreEmptyLines; }
+ public boolean getIgnoreEmptyLines() { return this.ignoreEmptyLines; }
+
+ public void setPrinterNewline(String newline) {
+ this.printerNewline = newline;
+ }
+ public String getPrinterNewline() {
+ return this.printerNewline;
+ }
+
+ public Object clone() {
+ try {
+ return super.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new RuntimeException(e); // impossible
+ }
+ }
+}
diff --git a/solr/core/src/java/org/apache/solr/internal/csv/CSVUtils.java b/solr/core/src/java/org/apache/solr/internal/csv/CSVUtils.java
new file mode 100644
index 00000000000..68fd8c369ea
--- /dev/null
+++ b/solr/core/src/java/org/apache/solr/internal/csv/CSVUtils.java
@@ -0,0 +1,121 @@
+/*
+ * 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.
+ */
+package org.apache.solr.internal.csv;
+
+import java.io.StringWriter;
+import java.io.StringReader;
+import java.io.IOException;
+
+/**
+ * Utility methods for dealing with CSV files
+ */
+public class CSVUtils {
+
+ private static final String[] EMPTY_STRING_ARRAY = new String[0];
+ private static final String[][] EMPTY_DOUBLE_STRING_ARRAY = new String[0][0];
+
+ /**
+ * <p><code>CSVUtils</code> instances should NOT be constructed in
+ * standard programming.
+ *
+ * <p>This constructor is public to permit tools that require a JavaBean
+ * instance to operate.</p>
+ */
+ public CSVUtils() {
+ }
+
+ /**
+ * Converts an array of string values into a single CSV line. All
+ * <code>null</code> values are converted to the string <code>"null"</code>,
+ * all strings equal to <code>"null"</code> will additionally get quotes
+ * around.
+ *
+ * @param values the value array
+ * @return the CSV string, will be an empty string if the length of the
+ * value array is 0
+ */
+ public static String printLine(String[] values, CSVStrategy strategy) {
+ // set up a CSVUtils
+ StringWriter stringWriter = new StringWriter();
+ CSVPrinter csvPrinter = new CSVPrinter(stringWriter, strategy);
+
+ // check for null values an "null" as strings and convert them
+ // into the strings "null" and "\"null\""
+ for (int i = 0; i < values.length; i++) {
+ if (values[i] == null) {
+ values[i] = "null";
+ } else if (values[i].equals("null")) {
+ values[i] = "\"null\"";
+ }
+ }
+
+ // convert to CSV
+ try {
+ csvPrinter.println(values);
+ } catch (IOException e) {
+ // should not happen with StringWriter
+ }
+ // as the resulting string has \r\n at the end, we will trim that away
+ return stringWriter.toString().trim();
+ }
+
+ // ======================================================
+ // static parsers
+ // ======================================================
+
+ /**
+ * Parses the given String according to the default {@link CSVStrategy}.
+ *
+ * @param s CSV String to be parsed.
+ * @return parsed String matrix (which is never null)
+ * @throws IOException in case of error
+ */
+ public static String[][] parse(String s) throws IOException {
+ if (s == null) {
+ throw new IllegalArgumentException("Null argument not allowed.");
+ }
+ String[][] result = (new CSVParser(new StringReader(s))).getAllValues();
+ if (result == null) {
+ // since CSVStrategy ignores empty lines an empty array is returned
+ // (i.e. not "result = new String[][] {{""}};")
+ result = EMPTY_DOUBLE_STRING_ARRAY;
+ }
+ return result;
+ }
+
+ /**
+ * Parses the first line only according to the default {@link CSVStrategy}.
+ *
+ * Parsing empty string will be handled as valid records containing zero
+ * elements, so the following property holds: parseLine("").length == 0.
+ *
+ * @param s CSV String to be parsed.
+ * @return parsed String vector (which is never null)
+ * @throws IOException in case of error
+ */
+ public static String[] parseLine(String s) throws IOException {
+ if (s == null) {
+ throw new IllegalArgumentException("Null argument not allowed.");
+ }
+ // uh,jh: make sure that parseLine("").length == 0
+ if (s.length() == 0) {
+ return EMPTY_STRING_ARRAY;
+ }
+ return (new CSVParser(new StringReader(s))).getLine();
+ }
+
+}
diff --git a/solr/core/src/java/org/apache/solr/internal/csv/CharBuffer.java b/solr/core/src/java/org/apache/solr/internal/csv/CharBuffer.java
new file mode 100644
index 00000000000..8fb1f69e280
--- /dev/null
+++ b/solr/core/src/java/org/apache/solr/internal/csv/CharBuffer.java
@@ -0,0 +1,223 @@
+/*
+ * 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.
+ */
+package org.apache.solr.internal.csv;
+
+/**
+ * A simple StringBuffer replacement that aims to
+ * reduce copying as much as possible. The buffer
+ * grows as necessary.
+ * This class is not thread safe.
+ *
+ * @author Ortwin Gl�ck
+ */
+public class CharBuffer {
+
+ private char[] c;
+
+ /**
+ * Actually used number of characters in the array.
+ * It is also the index at which
+ * a new character will be inserted into <code>c</code>.
+ */
+ private int length;
+
+ /**
+ * Creates a new CharBuffer with an initial capacity of 32 characters.
+ */
+ public CharBuffer() {
+ this(32);
+ }
+
+ /**
+ * Creates a new CharBuffer with an initial capacity
+ * of <code>length</code> characters.
+ */
+ public CharBuffer(final int length) {
+ if (length == 0) {
+ throw new IllegalArgumentException("Can't create an empty CharBuffer");
+ }
+ this.c = new char[length];
+ }
+
+ /**
+ * Empties the buffer. The capacity still remains the same, so no memory is freed.
+ */
+ public void clear() {
+ length = 0;
+ }
+
+ /**
+ * Returns the number of characters in the buffer.
+ * @return the number of characters
+ */
+ public int length() {
+ return length;
+ }
+
+ /**
+ * Returns the current capacity of the buffer.
+ * @return the maximum number of characters that can be stored in this buffer without
+ * resizing it.
+ */
+ public int capacity() {
+ return c.length;
+ }
+
+
+ /**
+ * Appends the contents of <code>cb</code> to the end of this CharBuffer.
+ * @param cb the CharBuffer to append or null
+ */
+ public void append(final CharBuffer cb) {
+ if (cb == null) {
+ return;
+ }
+ provideCapacity(length + cb.length);
+ System.arraycopy(cb.c, 0, c, length, cb.length);
+ length += cb.length;
+ }
+
+ /**
+ * Appends <code>s</code> to the end of this CharBuffer.
+ * This method involves copying the new data once!
+ * @param s the String to append or null
+ */
+ public void append(final String s) {
+ if (s == null) {
+ return;
+ }
+ append(s.toCharArray());
+ }
+
+ /**
+ * Appends <code>sb</code> to the end of this CharBuffer.
+ * This method involves copying the new data once!
+ * @param sb the StringBuffer to append or null
+ */
+ public void append(final StringBuffer sb) {
+ if (sb == null) {
+ return;
+ }
+ provideCapacity(length + sb.length());
+ sb.getChars(0, sb.length(), c, length);
+ length += sb.length();
+ }
+
+ /**
+ * Appends <code>data</code> to the end of this CharBuffer.
+ * This method involves copying the new data once!
+ * @param data the char[] to append or null
+ */
+ public void append(final char[] data) {
+ if (data == null) {
+ return;
+ }
+ provideCapacity(length + data.length);
+ System.arraycopy(data, 0, c, length, data.length);
+ length += data.length;
+ }
+
+ /**
+ * Appends a single character to the end of this CharBuffer.
+ * This method involves copying the new data once!
+ * @param data the char to append
+ */
+ public void append(final char data) {
+ provideCapacity(length + 1);
+ c[length] = data;
+ length++;
+ }
+
+ /**
+ * Shrinks the capacity of the buffer to the current length if necessary.
+ * This method involves copying the data once!
+ */
+ public void shrink() {
+ if (c.length == length) {
+ return;
+ }
+ char[] newc = new char[length];
+ System.arraycopy(c, 0, newc, 0, length);
+ c = newc;
+ }
+
+ /**
+ * Removes trailing whitespace.
+ */
+ public void trimTrailingWhitespace() {
+ while (length>0 && Character.isWhitespace(c[length-1])) {
+ length--;
+ }
+ }
+
+ /**
+ * Returns the contents of the buffer as a char[]. The returned array may
+ * be the internal array of the buffer, so the caller must take care when
+ * modifying it.
+ * This method allows to avoid copying if the caller knows the exact capacity
+ * before.
+ */
+ public char[] getCharacters() {
+ if (c.length == length) {
+ return c;
+ }
+ char[] chars = new char[length];
+ System.arraycopy(c, 0, chars, 0, length);
+ return chars;
+ }
+
+ /**
+ * Returns the character at the specified position.
+ */
+ public char charAt(int pos) {
+ return c[pos];
+ }
+
+ /**
+ * Converts the contents of the buffer into a StringBuffer.
+ * This method involves copying the new data once!
+ */
+ public StringBuffer toStringBuffer() {
+ StringBuffer sb = new StringBuffer(length);
+ sb.append(c, 0, length);
+ return sb;
+ }
+
+ /**
+ * Converts the contents of the buffer into a StringBuffer.
+ * This method involves copying the new data once!
+ */
+ public String toString() {
+ return new String(c, 0, length);
+ }
+
+ /**
+ * Copies the data into a new array of at least <code>capacity</code> size.
+ * @param capacity
+ */
+ public void provideCapacity(final int capacity) {
+ if (c.length >= capacity) {
+ return;
+ }
+ int newcapacity = ((capacity*3)>>1) + 1;
+ char[] newc = new char[newcapacity];
+ System.arraycopy(c, 0, newc, 0, length);
+ c = newc;
+ }
+}
diff --git a/solr/core/src/java/org/apache/solr/internal/csv/ExtendedBufferedReader.java b/solr/core/src/java/org/apache/solr/internal/csv/ExtendedBufferedReader.java
new file mode 100644
index 00000000000..9d348beeb54
--- /dev/null
+++ b/solr/core/src/java/org/apache/solr/internal/csv/ExtendedBufferedReader.java
@@ -0,0 +1,312 @@
+/*
+ * 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.
+ */
+package org.apache.solr.internal.csv;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.Reader;
+
+/**
+ * ExtendedBufferedReader
+ *
+ * A special reader decorater which supports more
+ * sophisticated access to the underlying reader object.
+ *
+ * In particular the reader supports a look-ahead option,
+ * which allows you to see the next char returned by
+ * next().
+ * Furthermore the skip-method supports skipping until
+ * (but excluding) a given char. Similar functionality
+ * is supported by the reader as well.
+ *
+ */
+class ExtendedBufferedReader extends BufferedReader {
+
+
+ /** the end of stream symbol */
+ public static final int END_OF_STREAM = -1;
+ /** undefined state for the lookahead char */
+ public static final int UNDEFINED = -2;
+
+ /** the lookahead chars */
+ private int lookaheadChar = UNDEFINED;
+ /** the last char returned */
+ private int lastChar = UNDEFINED;
+ /** the line counter */
+ private int lineCounter = 0;
+ private CharBuffer line = new CharBuffer();
+
+ /**
+ * Created extended buffered reader using default buffer-size
+ *
+ */
+ public ExtendedBufferedReader(Reader r) {
+ super(r);
+ /* note uh: do not fetch the first char here,
+ * because this might block the method!
+ */
+ }
+
+ /**
+ * Create extended buffered reader using the given buffer-size
+ */
+ public ExtendedBufferedReader(Reader r, int bufSize) {
+ super(r, bufSize);
+ /* note uh: do not fetch the first char here,
+ * because this might block the method!
+ */
+ }
+
+ /**
+ * Reads the next char from the input stream.
+ * @return the next char or END_OF_STREAM if end of stream has been reached.
+ */
+ public int read() throws IOException {
+ // initalize the lookahead
+ if (lookaheadChar == UNDEFINED) {
+ lookaheadChar = super.read();
+ }
+ lastChar = lookaheadChar;
+ if (super.ready()) {
+ lookaheadChar = super.read();
+ } else {
+ lookaheadChar = UNDEFINED;
+ }
+ if (lastChar == '\n') {
+ lineCounter++;
+ }
+ return lastChar;
+ }
+
+ /**
+ * Returns the last read character again.
+ *
+ * @return the last read char or UNDEFINED
+ */
+ public int readAgain() {
+ return lastChar;
+ }
+
+ /**
+ * Non-blocking reading of len chars into buffer buf starting
+ * at bufferposition off.
+ *
+ * performs an iteratative read on the underlying stream
+ * as long as the following conditions hold:
+ * - less than len chars have been read
+ * - end of stream has not been reached
+ * - next read is not blocking
+ *
+ * @return nof chars actually read or END_OF_STREAM
+ */
+ public int read(char[] buf, int off, int len) throws IOException {
+ // do not claim if len == 0
+ if (len == 0) {
+ return 0;
+ }
+
+ // init lookahead, but do not block !!
+ if (lookaheadChar == UNDEFINED) {
+ if (ready()) {
+ lookaheadChar = super.read();
+ } else {
+ return -1;
+ }
+ }
+ // 'first read of underlying stream'
+ if (lookaheadChar == -1) {
+ return -1;
+ }
+ // continue until the lookaheadChar would block
+ int cOff = off;
+ while (len > 0 && ready()) {
+ if (lookaheadChar == -1) {
+ // eof stream reached, do not continue
+ return cOff - off;
+ } else {
+ buf[cOff++] = (char) lookaheadChar;
+ if (lookaheadChar == '\n') {
+ lineCounter++;
+ }
+ lastChar = lookaheadChar;
+ lookaheadChar = super.read();
+ len--;
+ }
+ }
+ return cOff - off;
+ }
+
+ /**
+ * Reads all characters up to (but not including) the given character.
+ *
+ * @param c the character to read up to
+ * @return the string up to the character <code>c</code>
+ * @throws IOException
+ */
+ public String readUntil(char c) throws IOException {
+ if (lookaheadChar == UNDEFINED) {
+ lookaheadChar = super.read();
+ }
+ line.clear(); // reuse
+ while (lookaheadChar != c && lookaheadChar != END_OF_STREAM) {
+ line.append((char) lookaheadChar);
+ if (lookaheadChar == '\n') {
+ lineCounter++;
+ }
+ lastChar = lookaheadChar;
+ lookaheadChar = super.read();
+ }
+ return line.toString();
+ }
+
+ /**
+ * @return A String containing the contents of the line, not
+ * including any line-termination characters, or null
+ * if the end of the stream has been reached
+ */
+ public String readLine() throws IOException {
+
+ if (lookaheadChar == UNDEFINED) {
+ lookaheadChar = super.read();
+ }
+
+ line.clear(); //reuse
+
+ // return null if end of stream has been reached
+ if (lookaheadChar == END_OF_STREAM) {
+ return null;
+ }
+ // do we have a line termination already
+ char laChar = (char) lookaheadChar;
+ if (laChar == '\n' || laChar == '\r') {
+ lastChar = lookaheadChar;
+ lookaheadChar = super.read();
+ // ignore '\r\n' as well
+ if ((char) lookaheadChar == '\n') {
+ lastChar = lookaheadChar;
+ lookaheadChar = super.read();
+ }
+ lineCounter++;
+ return line.toString();
+ }
+
+ // create the rest-of-line return and update the lookahead
+ line.append(laChar);
+ String restOfLine = super.readLine(); // TODO involves copying
+ lastChar = lookaheadChar;
+ lookaheadChar = super.read();
+ if (restOfLine != null) {
+ line.append(restOfLine);
+ }
+ lineCounter++;
+ return line.toString();
+ }
+
+ /**
+ * Skips char in the stream
+ *
+ * ATTENTION: invalidates the line-counter !!!!!
+ *
+ * @return nof skiped chars
+ */
+ public long skip(long n) throws IllegalArgumentException, IOException {
+
+ if (lookaheadChar == UNDEFINED) {
+ lookaheadChar = super.read();
+ }
+
+ // illegal argument
+ if (n < 0) {
+ throw new IllegalArgumentException("negative argument not supported");
+ }
+
+ // no skipping
+ if (n == 0 || lookaheadChar == END_OF_STREAM) {
+ return 0;
+ }
+
+ // skip and reread the lookahead-char
+ long skiped = 0;
+ if (n > 1) {
+ skiped = super.skip(n - 1);
+ }
+ lookaheadChar = super.read();
+ // fixme uh: we should check the skiped sequence for line-terminations...
+ lineCounter = Integer.MIN_VALUE;
+ return skiped + 1;
+ }
+
+ /**
+ * Skips all chars in the input until (but excluding) the given char
+ *
+ * @param c
+ * @return
+ * @throws IllegalArgumentException
+ * @throws IOException
+ */
+ public long skipUntil(char c) throws IllegalArgumentException, IOException {
+ if (lookaheadChar == UNDEFINED) {
+ lookaheadChar = super.read();
+ }
+ long counter = 0;
+ while (lookaheadChar != c && lookaheadChar != END_OF_STREAM) {
+ if (lookaheadChar == '\n') {
+ lineCounter++;
+ }
+ lookaheadChar = super.read();
+ counter++;
+ }
+ return counter;
+ }
+
+ /**
+ * Returns the next char in the stream without consuming it.
+ *
+ * Remember the next char read by read(..) will always be
+ * identical to lookAhead().
+ *
+ * @return the next char (without consuming it) or END_OF_STREAM
+ */
+ public int lookAhead() throws IOException {
+ if (lookaheadChar == UNDEFINED) {
+ lookaheadChar = super.read();
+ }
+ return lookaheadChar;
+ }
+
+
+ /**
+ * Returns the nof line read
+ * ATTENTION: the skip-method does invalidate the line-number counter
+ *
+ * @return the current-line-number (or -1)
+ */
+ public int getLineNumber() {
+ if (lineCounter > -1) {
+ return lineCounter;
+ } else {
+ return -1;
+ }
+ }
+ public boolean markSupported() {
+ /* note uh: marking is not supported, cause we cannot
+ * see into the future...
+ */
+ return false;
+ }
+
+}
diff --git a/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVConfig.java b/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVConfig.java
new file mode 100644
index 00000000000..aee7432e4a1
--- /dev/null
+++ b/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVConfig.java
@@ -0,0 +1,287 @@
+/*
+ * 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.
+ */
+package org.apache.solr.internal.csv.writer;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * The CSVConfig is used to configure the CSV writer
+ *
+ * @author Martin van den Bemt
+ * @version $Id: $
+ */
+public class CSVConfig {
+
+ /** specifies if it is a fixed width csv file **/
+ private boolean fixedWidth;
+ /** list of fields **/
+ private List fields;
+
+ /** Do no do any filling **/
+ public static final int FILLNONE = 0;
+ /** Fill content the the left. Mainly usable together with fixedWidth **/
+ public static final int FILLLEFT = 1;
+ /** Fill content to the right. Mainly usable together with fixedWidth **/
+ public static final int FILLRIGHT = 2;
+
+ /** The fill pattern */
+ private int fill;
+ /** The fill char. Defaults to a space */
+ private char fillChar = ' ';
+ /** The seperator character. Defaults to , */
+ private char delimiter = ',';
+ /** Should we ignore the delimiter. Defaults to false */
+ private boolean ignoreDelimiter = false;
+ /** the value delimiter. Defaults to " */
+ private char valueDelimiter = '"';
+ /** Should we ignore the value delimiter. Defaults to true */
+ private boolean ignoreValueDelimiter = true;
+ /** Specifies if we want to use a field header */
+ private boolean fieldHeader = false;
+ /** Specifies if the end of the line needs to be trimmed */
+ private boolean endTrimmed = false;
+ /**
+ *
+ */
+ public CSVConfig() {
+ super();
+ }
+
+ /**
+ * @return if the CSV file is fixedWidth
+ */
+ public boolean isFixedWidth() {
+ return fixedWidth;
+ }
+
+ /**
+ * Specify if the CSV file is fixed width.
+ * Defaults to false
+ * @param fixedWidth the fixedwidth
+ */
+ public void setFixedWidth(boolean fixedWidth) {
+ this.fixedWidth = fixedWidth;
+ }
+
+ public void addField(CSVField field) {
+ if (fields == null) {
+ fields = new ArrayList();
+ }
+ fields.add(field);
+ }
+
+ /**
+ * Set the fields that should be used by the writer.
+ * This will overwrite currently added fields completely!
+ * @param csvFields the csvfields array. If null it will do nothing
+ */
+ public void setFields(CSVField[] csvFields) {
+ if (csvFields == null) {
+ return;
+ }
+ fields = new ArrayList(Arrays.asList(csvFields));
+ }
+
+ /**
+ * Set the fields that should be used by the writer
+ * @param csvField a collection with fields. If null it will do nothing
+ */
+ public void setFields(Collection csvField) {
+ if (csvField == null) {
+ return;
+ }
+ fields = new ArrayList(csvField);
+ }
+
+ /**
+ * @return an array with the known fields (even if no fields are specified)
+ */
+ public CSVField[] getFields() {
+ CSVField[] csvFields = new CSVField[0];
+ if (fields != null) {
+ return (CSVField[]) fields.toArray(csvFields);
+ }
+ return csvFields;
+ }
+
+ public CSVField getField(String name) {
+ if (fields == null || name == null) {
+ return null;
+ }
+ for(int i = 0; i < fields.size(); i++) {
+ CSVField field = (CSVField) fields.get(i);
+ if (name.equals(field.getName())) {
+ return field;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @return the fill pattern.
+ */
+ public int getFill() {
+ return fill;
+ }
+
+ /**
+ * Set the fill pattern. Defaults to {@link #FILLNONE}
+ * <br/>Other options are : {@link #FILLLEFT} and {@link #FILLRIGHT}
+ * @param fill the fill pattern.
+ */
+ public void setFill(int fill) {
+ this.fill = fill;
+ }
+
+ /**
+ *
+ * @return the fillchar. Defaults to a space.
+ */
+ public char getFillChar() {
+ return fillChar;
+ }
+
+ /**
+ * Set the fill char
+ * @param fillChar the fill char
+ */
+ public void setFillChar(char fillChar) {
+ this.fillChar = fillChar;
+ }
+
+ /**
+ * @return the delimeter used.
+ */
+ public char getDelimiter() {
+ return delimiter;
+ }
+
+ /**
+ * Set the delimiter to use
+ * @param delimiter the delimiter character.
+ */
+ public void setDelimiter(char delimiter) {
+ this.delimiter = delimiter;
+ }
+
+ /**
+ * @return if the writer should ignore the delimiter character.
+ */
+ public boolean isDelimiterIgnored() {
+ return ignoreDelimiter;
+ }
+
+ /**
+ * Specify if the writer should ignore the delimiter.
+ * @param ignoreDelimiter defaults to false.
+ */
+ public void setIgnoreDelimiter(boolean ignoreDelimiter) {
+ this.ignoreDelimiter = ignoreDelimiter;
+ }
+
+ /**
+ * @return the value delimeter used. Defaults to "
+ */
+ public char getValueDelimiter() {
+ return valueDelimiter;
+ }
+
+ /**
+ * Set the value delimiter to use
+ * @param valueDelimiter the value delimiter character.
+ */
+ public void setValueDelimiter(char valueDelimiter) {
+ this.valueDelimiter = valueDelimiter;
+ }
+
+ /**
+ * @return if the writer should ignore the value delimiter character.
+ * Defaults to true.
+ */
+ public boolean isValueDelimiterIgnored() {
+ return ignoreValueDelimiter;
+ }
+
+ /**
+ * Specify if the writer should ignore the value delimiter.
+ * @param ignoreValueDelimiter defaults to false.
+ */
+ public void setIgnoreValueDelimiter(boolean ignoreValueDelimiter) {
+ this.ignoreValueDelimiter = ignoreValueDelimiter;
+ }
+
+ /**
+ * @return if a field header is used. Defaults to false
+ */
+ public boolean isFieldHeader() {
+ return fieldHeader;
+ }
+ /**
+ * Specify if you want to use a field header.
+ * @param fieldHeader true or false.
+ */
+ public void setFieldHeader(boolean fieldHeader) {
+ this.fieldHeader = fieldHeader;
+ }
+
+ /**
+ * TODO..
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ public boolean equals(Object obj) {
+ if (obj == null && !(obj instanceof CSVConfig)) {
+ return false;
+ }
+ return super.equals(obj);
+// CSVConfig config = (CSVConfig) obj;
+// getFill() == config.getFill()
+// getFields().equals(config.getFields())
+ }
+
+ /**
+ * Creates a config based on a stream. It tries to guess<br/>
+ * NOTE : The stream will be closed.
+ * @param inputStream the inputstream.
+ * @return the guessed config.
+ */
+ public static CSVConfig guessConfig(InputStream inputStream) {
+ return null;
+ }
+
+ /**
+ * @return if the end of the line should be trimmed. Default is false.
+ */
+ public boolean isEndTrimmed() {
+ return endTrimmed;
+ }
+
+ /**
+ * Specify if the end of the line needs to be trimmed. Defaults to false.
+ * @param endTrimmed
+ */
+ public void setEndTrimmed(boolean endTrimmed) {
+ this.endTrimmed = endTrimmed;
+ }
+
+
+}
diff --git a/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVConfigGuesser.java b/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVConfigGuesser.java
new file mode 100644
index 00000000000..3fe93a40e9c
--- /dev/null
+++ b/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVConfigGuesser.java
@@ -0,0 +1,189 @@
+/*
+ * 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.
+ */
+package org.apache.solr.internal.csv.writer;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+/**
+ * Tries to guess a config based on an InputStream.
+ *
+ * @author Martin van den Bemt
+ * @version $Id: $
+ */
+public class CSVConfigGuesser {
+
+ /** The stream to read */
+ private InputStream in;
+ /**
+ * if the file has a field header (need this info, to be able to guess better)
+ * Defaults to false
+ */
+ private boolean hasFieldHeader = false;
+ /** The found config */
+ protected CSVConfig config;
+
+ /**
+ *
+ */
+ public CSVConfigGuesser() {
+ this.config = new CSVConfig();
+ }
+
+ /**
+ * @param in the inputstream to guess from
+ */
+ public CSVConfigGuesser(InputStream in) {
+ this();
+ setInputStream(in);
+ }
+
+ public void setInputStream(InputStream in) {
+ this.in = in;
+ }
+
+ /**
+ * Allow override.
+ * @return the inputstream that was set.
+ */
+ protected InputStream getInputStream() {
+ return in;
+ }
+
+ /**
+ * Guess the config based on the first 10 (or less when less available)
+ * records of a CSV file.
+ *
+ * @return the guessed config.
+ */
+ public CSVConfig guess() {
+ try {
+ // tralalal
+ BufferedReader bIn = new BufferedReader(new InputStreamReader((getInputStream())));
+ String[] lines = new String[10];
+ String line = null;
+ int counter = 0;
+ while ( (line = bIn.readLine()) != null && counter <= 10) {
+ lines[counter] = line;
+ counter++;
+ }
+ if (counter < 10) {
+ // remove nulls from the array, so we can skip the null checking.
+ String[] newLines = new String[counter];
+ System.arraycopy(lines, 0, newLines, 0, counter);
+ lines = newLines;
+ }
+ analyseLines(lines);
+ } catch(Exception e) {
+ e.printStackTrace();
+ } finally {
+ if (in != null) {
+ try {
+ in.close();
+ } catch(Exception e) {
+ // ignore exception.
+ }
+ }
+ }
+ CSVConfig conf = config;
+ // cleanup the config.
+ config = null;
+ return conf;
+ }
+
+ protected void analyseLines(String[] lines) {
+ guessFixedWidth(lines);
+ guessFieldSeperator(lines);
+ }
+
+ /**
+ * Guess if this file is fixedwidth.
+ * Just basing the fact on all lines being of the same length
+ * @param lines
+ */
+ protected void guessFixedWidth(String[] lines) {
+ int lastLength = 0;
+ // assume fixedlength.
+ config.setFixedWidth(true);
+ for (int i = 0; i < lines.length; i++) {
+ if (i == 0) {
+ lastLength = lines[i].length();
+ } else {
+ if (lastLength != lines[i].length()) {
+ config.setFixedWidth(false);
+ }
+ }
+ }
+ }
+
+
+ protected void guessFieldSeperator(String[] lines) {
+ if (config.isFixedWidth()) {
+ guessFixedWidthSeperator(lines);
+ return;
+ }
+ for (int i = 0; i < lines.length; i++) {
+ }
+ }
+
+ protected void guessFixedWidthSeperator(String[] lines) {
+ // keep track of the fieldlength
+ int previousMatch = -1;
+ for (int i = 0; i < lines[0].length(); i++) {
+ char last = ' ';
+ boolean charMatches = true;
+ for (int j = 0; j < lines.length; j++) {
+ if (j == 0) {
+ last = lines[j].charAt(i);
+ }
+ if (last != lines[j].charAt(i)) {
+ charMatches = false;
+ break;
+ }
+ }
+ if (charMatches) {
+ if (previousMatch == -1) {
+ previousMatch = 0;
+ }
+ CSVField field = new CSVField();
+ field.setName("field"+config.getFields().length+1);
+ field.setSize((i-previousMatch));
+ config.addField(field);
+ }
+ }
+ }
+ /**
+ *
+ * @return if the field uses a field header. Defaults to false.
+ */
+ public boolean hasFieldHeader() {
+ return hasFieldHeader;
+ }
+
+ /**
+ * Specify if the CSV file has a field header
+ * @param hasFieldHeader true or false
+ */
+ public void setHasFieldHeader(boolean hasFieldHeader) {
+ this.hasFieldHeader = hasFieldHeader;
+ }
+
+
+}
diff --git a/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVField.java b/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVField.java
new file mode 100644
index 00000000000..f8c7e027ac1
--- /dev/null
+++ b/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVField.java
@@ -0,0 +1,112 @@
+/*
+ * 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.
+ */
+package org.apache.solr.internal.csv.writer;
+
+
+/**
+ *
+ * @author Martin van den Bemt
+ * @version $Id: $
+ */
+public class CSVField {
+
+ private String name;
+ private int size;
+ private int fill;
+ private boolean overrideFill;
+
+ /**
+ *
+ */
+ public CSVField() {
+ }
+
+ /**
+ * @param name the name of the field
+ */
+ public CSVField(String name) {
+ setName(name);
+ }
+
+ /**
+ * @param name the name of the field
+ * @param size the size of the field
+ */
+ public CSVField(String name, int size) {
+ setName(name);
+ setSize(size);
+ }
+
+ /**
+ * @return the name of the field
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Set the name of the field
+ * @param name the name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ *
+ * @return the size of the field
+ */
+ public int getSize() {
+ return size;
+ }
+
+ /**
+ * Set the size of the field.
+ * The size will be ignored when fixedwidth is set to false in the CSVConfig
+ * @param size the size of the field.
+ */
+ public void setSize(int size) {
+ this.size = size;
+ }
+
+ /**
+ * @return the fill pattern.
+ */
+ public int getFill() {
+ return fill;
+ }
+
+ /**
+ * Sets overrideFill to true.
+ * @param fill the file pattern
+ */
+ public void setFill(int fill) {
+ overrideFill = true;
+ this.fill = fill;
+ }
+
+ /**
+ * Does this field override fill ?
+ *
+ */
+ public boolean overrideFill() {
+ return overrideFill;
+ }
+
+}
diff --git a/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVWriter.java b/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVWriter.java
new file mode 100644
index 00000000000..d84e59cdfb5
--- /dev/null
+++ b/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVWriter.java
@@ -0,0 +1,136 @@
+/*
+ * 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.
+ */
+package org.apache.solr.internal.csv.writer;
+
+import java.io.Writer;
+import java.util.Arrays;
+import java.util.Map;
+
+
+/**
+ * CSVWriter
+ *
+ * @author Martin van den Bemt
+ * @version $Id: $
+ */
+public class CSVWriter {
+
+ /** The CSV config **/
+ private CSVConfig config;
+ /** The writer **/
+ private Writer writer;
+ /**
+ *
+ */
+ public CSVWriter() {
+ }
+
+ public CSVWriter(CSVConfig config) {
+ setConfig(config);
+ }
+
+ public void writeRecord(Map map) {
+ CSVField[] fields = config.getFields();
+ try {
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < fields.length; i++) {
+ Object o = map.get(fields[i].getName());
+ if (o != null) {
+ String value = o.toString();
+ value = writeValue(fields[i], value);
+ sb.append(value);
+ }
+ if (!config.isDelimiterIgnored() && fields.length != (i+1)) {
+ sb.append(config.getDelimiter());
+ }
+ }
+ if (config.isEndTrimmed()) {
+ for (int i = sb.length()-1; i >= 0; i--) {
+ System.out.println("i : " + i);
+ if (Character.isWhitespace(sb.charAt(i))) {
+ sb.deleteCharAt(i);
+ } else {
+ break;
+ }
+ }
+ }
+ sb.append("\n");
+ String line = sb.toString();
+ writer.write(line);
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ protected String writeValue(CSVField field, String value) throws Exception {
+ if (config.isFixedWidth()) {
+ if (value.length() < field.getSize()) {
+ int fillPattern = config.getFill();
+ if (field.overrideFill()) {
+ fillPattern = field.getFill();
+ }
+ StringBuffer sb = new StringBuffer();
+ int fillSize = (field.getSize() - value.length());
+ char[] fill = new char[fillSize];
+ Arrays.fill(fill, config.getFillChar());
+ if (fillPattern == CSVConfig.FILLLEFT) {
+ sb.append(fill);
+ sb.append(value);
+ value = sb.toString();
+ } else {
+ // defaults to fillpattern FILLRIGHT when fixedwidth is used
+ sb.append(value);
+ sb.append(fill);
+ value = sb.toString();
+ }
+ } else if (value.length() > field.getSize()) {
+ // value to big..
+ value = value.substring(0, field.getSize());
+ }
+ if (!config.isValueDelimiterIgnored()) {
+ // add the value delimiter..
+ value = config.getValueDelimiter()+value+config.getValueDelimiter();
+ }
+ }
+ return value;
+ }
+ /**
+ * @return the CVSConfig or null if not present
+ */
+ public CSVConfig getConfig() {
+ return config;
+ }
+
+ /**
+ * Set the CSVConfig
+ * @param config the CVSConfig
+ */
+ public void setConfig(CSVConfig config) {
+ this.config = config;
+ }
+
+ /**
+ * Set the writer to write the CSV file to.
+ * @param writer the writer.
+ */
+ public void setWriter(Writer writer) {
+ this.writer = writer;
+ }
+
+}
diff --git a/solr/example/build.xml b/solr/example/build.xml
new file mode 100644
index 00000000000..7cbcb94f97d
--- /dev/null
+++ b/solr/example/build.xml
@@ -0,0 +1,52 @@
+<?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.
+ -->
+<project name="solr-example" default="resolve" xmlns:ivy="antlib:org.apache.ivy.ant">
+ <description>Solr Example</description>
+
+ <import file="../common-build.xml"/>
+
+ <!-- example tests are currently elsewhere -->
+ <target name="test"/>
+
+ <!-- this module has no javadocs -->
+ <target name="javadocs"/>
+
+ <!-- this module has no jar either -->
+ <target name="jar-core"/>
+
+ <!-- nothing to compile -->
+ <target name="compile-core"/>
+ <target name="compile-test"/>
+
+ <target name="resolve" depends="ivy-availability-check">
+ <sequential>
+ <!-- jetty libs in lib/ -->
+ <ivy:retrieve conf="default" type="jar" log="download-only"/>
+ <!-- start.jar -->
+ <!-- TODO: put this in ivy.xml -->
+ <ivy:retrieve inline="true" organisation="org.eclipse.jetty"
+ module="jetty-start" revision="8.1.2.v20120308"
+ transitive="false" type="jar" log="download-only"
+ pattern="start.jar"/>
+ <!-- servlet-api.jar -->
+ <ivy:retrieve conf="servlet" log="download-only" type="orbit"
+ pattern="lib/servlet-api-3.0.jar"/>
+ </sequential>
+ </target>
+
+</project>
diff --git a/solr/example/example-DIH/build.xml b/solr/example/example-DIH/build.xml
new file mode 100644
index 00000000000..b48b1496123
--- /dev/null
+++ b/solr/example/example-DIH/build.xml
@@ -0,0 +1,38 @@
+<?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.
+ -->
+<project name="solr-example-DIH" default="resolve">
+ <description>Solr Example-DIH</description>
+
+ <property name="ivy.retrieve.pattern" value="${example}/example-DIH/solr/db/lib/[artifact]-[revision].[ext]"/>
+
+ <import file="../../common-build.xml"/>
+
+ <!-- example tests are currently elsewhere -->
+ <target name="test"/>
+
+ <!-- this module has no javadocs -->
+ <target name="javadocs"/>
+
+ <!-- this module has no jar either -->
+ <target name="jar-core"/>
+
+ <!-- nothing to compile -->
+ <target name="compile-core"/>
+ <target name="compile-test"/>
+
+</project>
diff --git a/solr/example/example-DIH/ivy.xml b/solr/example/example-DIH/ivy.xml
new file mode 100644
index 00000000000..5d3f39c4981
--- /dev/null
+++ b/solr/example/example-DIH/ivy.xml
@@ -0,0 +1,26 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.solr" module="example-DIH"/>
+
+ <dependencies>
+ <dependency org="hsqldb" name="hsqldb" rev="1.8.0.10" transitive="false"/>
+ <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+ </dependencies>
+</ivy-module>
diff --git a/solr/example/example-DIH/solr/db/lib/hsqldb-1.8.0.10.jar b/solr/example/example-DIH/solr/db/lib/hsqldb-1.8.0.10.jar
deleted file mode 100644
index 8976fe931fe..00000000000
--- a/solr/example/example-DIH/solr/db/lib/hsqldb-1.8.0.10.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[e010269ddf6d6b7740cb5e7cd7cb53abf24a0add] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/example/ivy.xml b/solr/example/ivy.xml
new file mode 100644
index 00000000000..665c6878974
--- /dev/null
+++ b/solr/example/ivy.xml
@@ -0,0 +1,43 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.solr" module="example"/>
+ <configurations>
+ <conf name="default" description="jetty jars"/>
+ <conf name="servlet" description="servlet-api jar"/>
+ </configurations>
+
+ <dependencies>
+ <dependency org="org.eclipse.jetty" name="jetty-continuation" rev="8.1.2.v20120308" transitive="false"/>
+ <dependency org="org.eclipse.jetty" name="jetty-deploy" rev="8.1.2.v20120308" transitive="false"/>
+ <dependency org="org.eclipse.jetty" name="jetty-http" rev="8.1.2.v20120308" transitive="false"/>
+ <dependency org="org.eclipse.jetty" name="jetty-io" rev="8.1.2.v20120308" transitive="false"/>
+ <dependency org="org.eclipse.jetty" name="jetty-jmx" rev="8.1.2.v20120308" transitive="false"/>
+ <dependency org="org.eclipse.jetty" name="jetty-security" rev="8.1.2.v20120308" transitive="false"/>
+ <dependency org="org.eclipse.jetty" name="jetty-server" rev="8.1.2.v20120308" transitive="false"/>
+ <dependency org="org.eclipse.jetty" name="jetty-servlet" rev="8.1.2.v20120308" transitive="false"/>
+ <dependency org="org.eclipse.jetty" name="jetty-util" rev="8.1.2.v20120308" transitive="false"/>
+ <dependency org="org.eclipse.jetty" name="jetty-webapp" rev="8.1.2.v20120308" transitive="false"/>
+ <dependency org="org.eclipse.jetty" name="jetty-xml" rev="8.1.2.v20120308" transitive="false"/>
+ <dependency org="org.eclipse.jetty.orbit" name="javax.servlet" rev="3.0.0.v201112011016" transitive="false" conf="servlet->default">
+ <artifact name="javax.servlet" type="orbit" ext="jar"/>
+ </dependency>
+ <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+ </dependencies>
+</ivy-module>
diff --git a/solr/example/lib/jetty-continuation-8.1.2.v20120308.jar b/solr/example/lib/jetty-continuation-8.1.2.v20120308.jar
deleted file mode 100644
index f13a9aca235..00000000000
--- a/solr/example/lib/jetty-continuation-8.1.2.v20120308.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[04ad836024b2ed0ed66d46bbfed1bc184e645a06] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/example/lib/jetty-deploy-8.1.2.v20120308.jar b/solr/example/lib/jetty-deploy-8.1.2.v20120308.jar
deleted file mode 100644
index 04ad14bc14e..00000000000
--- a/solr/example/lib/jetty-deploy-8.1.2.v20120308.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[2989c267911ce65d6ab048f5728c20b560cb2827] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/example/lib/jetty-http-8.1.2.v20120308.jar b/solr/example/lib/jetty-http-8.1.2.v20120308.jar
deleted file mode 100644
index 380495b7899..00000000000
--- a/solr/example/lib/jetty-http-8.1.2.v20120308.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[fbf6531c638988bc2748854234da312af0671d15] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/example/lib/jetty-io-8.1.2.v20120308.jar b/solr/example/lib/jetty-io-8.1.2.v20120308.jar
deleted file mode 100644
index 6d62296c6fd..00000000000
--- a/solr/example/lib/jetty-io-8.1.2.v20120308.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[566b499e0d29c7cfc4ab1bf58f6d80e4471a93dc] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/example/lib/jetty-jmx-8.1.2.v20120308.jar b/solr/example/lib/jetty-jmx-8.1.2.v20120308.jar
deleted file mode 100644
index b7f3263b4ab..00000000000
--- a/solr/example/lib/jetty-jmx-8.1.2.v20120308.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[983b8a404148e036b09ad363f201b76e16d93875] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/example/lib/jetty-security-8.1.2.v20120308.jar b/solr/example/lib/jetty-security-8.1.2.v20120308.jar
deleted file mode 100644
index 7d066b498aa..00000000000
--- a/solr/example/lib/jetty-security-8.1.2.v20120308.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[fd6db76dc3ac8fdffa6ff34e44ce14b7c26bf748] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/example/lib/jetty-server-8.1.2.v20120308.jar b/solr/example/lib/jetty-server-8.1.2.v20120308.jar
deleted file mode 100644
index 581d05f5c8a..00000000000
--- a/solr/example/lib/jetty-server-8.1.2.v20120308.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[72b572682fed36ff5717e380be1a2ff2a985d7fa] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/example/lib/jetty-servlet-8.1.2.v20120308.jar b/solr/example/lib/jetty-servlet-8.1.2.v20120308.jar
deleted file mode 100644
index 68ef41fa973..00000000000
--- a/solr/example/lib/jetty-servlet-8.1.2.v20120308.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[bd559dde856dba9dcf2e83336ad9d0b7d5120735] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/example/lib/jetty-util-8.1.2.v20120308.jar b/solr/example/lib/jetty-util-8.1.2.v20120308.jar
deleted file mode 100644
index 752c6f618b2..00000000000
--- a/solr/example/lib/jetty-util-8.1.2.v20120308.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[c40b60abada935e753a4b98bee2bf1bdb31557ea] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/example/lib/jetty-webapp-8.1.2.v20120308.jar b/solr/example/lib/jetty-webapp-8.1.2.v20120308.jar
deleted file mode 100644
index 7e466256b7e..00000000000
--- a/solr/example/lib/jetty-webapp-8.1.2.v20120308.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[c176e13b3799112d3c8f00fc03112b632de98e41] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/example/lib/jetty-xml-8.1.2.v20120308.jar b/solr/example/lib/jetty-xml-8.1.2.v20120308.jar
deleted file mode 100644
index a7e93edbf27..00000000000
--- a/solr/example/lib/jetty-xml-8.1.2.v20120308.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[b8fba3039f3392469ff9f86c9fbccb8dc2160e58] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/example/lib/servlet-api-3.0.jar b/solr/example/lib/servlet-api-3.0.jar
deleted file mode 100644
index 422a2041cf4..00000000000
--- a/solr/example/lib/servlet-api-3.0.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[b135409682ee2173ee74cc9e9b00469d7fa0a27e] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/example/start.jar b/solr/example/start.jar
deleted file mode 100755
index 3378143b593..00000000000
--- a/solr/example/start.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[97a60dc634efe2bc63abdb60f0c8d67be7421343] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/apache-solr-commons-csv-1.0-SNAPSHOT-r966014.jar b/solr/lib/apache-solr-commons-csv-1.0-SNAPSHOT-r966014.jar
deleted file mode 100644
index f1974bb0529..00000000000
--- a/solr/lib/apache-solr-commons-csv-1.0-SNAPSHOT-r966014.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[bab8b31fb99256e13fc6010701db560243c47fa7] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/apache-solr-commons-csv-LICENSE-ASL.txt b/solr/lib/apache-solr-commons-csv-LICENSE-ASL.txt
deleted file mode 100644
index d6456956733..00000000000
--- a/solr/lib/apache-solr-commons-csv-LICENSE-ASL.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
diff --git a/solr/lib/apache-solr-commons-csv-NOTICE.txt b/solr/lib/apache-solr-commons-csv-NOTICE.txt
deleted file mode 100644
index d81b8ff8db2..00000000000
--- a/solr/lib/apache-solr-commons-csv-NOTICE.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-Apache Commons CSV
-Copyright 2005-2006 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-This JAR artifact contains a pre-release version of
-Apache Commons CSV, that was jarjar'ed to have a Solr
-private package name. Don't use it outside of Solr.
diff --git a/solr/lib/apache-solr-commons-csv-pom.xml.template b/solr/lib/apache-solr-commons-csv-pom.xml.template
deleted file mode 100644
index 2e8cdbd6ee7..00000000000
--- a/solr/lib/apache-solr-commons-csv-pom.xml.template
+++ /dev/null
@@ -1,36 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
- 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.
- -->
-
- <parent>
- <groupId>org.apache.solr</groupId>
- <artifactId>solr-parent</artifactId>
- <version>@version@</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.solr</groupId>
- <artifactId>solr-commons-csv</artifactId>
- <name>Solr Specific Commons CSV</name>
- <version>@version@</version>
- <description>Solr Specific Commons CSV v1.0-SNAPSHOT-r966014</description>
- <packaging>jar</packaging>
-</project>
diff --git a/solr/lib/apache-solr-noggit-LICENSE-ASL.txt b/solr/lib/apache-solr-noggit-LICENSE-ASL.txt
deleted file mode 100644
index 261eeb9e9f8..00000000000
--- a/solr/lib/apache-solr-noggit-LICENSE-ASL.txt
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
diff --git a/solr/lib/apache-solr-noggit-NOTICE.txt b/solr/lib/apache-solr-noggit-NOTICE.txt
deleted file mode 100644
index 3f59805ce43..00000000000
--- a/solr/lib/apache-solr-noggit-NOTICE.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
diff --git a/solr/lib/apache-solr-noggit-pom.xml.template b/solr/lib/apache-solr-noggit-pom.xml.template
deleted file mode 100644
index 9ef04d03bda..00000000000
--- a/solr/lib/apache-solr-noggit-pom.xml.template
+++ /dev/null
@@ -1,36 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
- 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.
- -->
-
- <parent>
- <groupId>org.apache.solr</groupId>
- <artifactId>solr-parent</artifactId>
- <version>@version@</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.solr</groupId>
- <artifactId>solr-noggit</artifactId>
- <name>Solr Specific Noggit</name>
- <version>@version@</version>
- <description>Solr Specific Noggit r1211150</description>
- <packaging>jar</packaging>
-</project>
diff --git a/solr/lib/apache-solr-noggit-r1211150.jar b/solr/lib/apache-solr-noggit-r1211150.jar
deleted file mode 100644
index 3c186904f8b..00000000000
--- a/solr/lib/apache-solr-noggit-r1211150.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[2a07c61d9ecb9683a135b7847682e7c36f19bbfe] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/commons-codec-1.6.jar b/solr/lib/commons-codec-1.6.jar
deleted file mode 100644
index 86b1896229b..00000000000
--- a/solr/lib/commons-codec-1.6.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[ee1bc49acae11cc79eceec51f7be785590e99fd8] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/commons-fileupload-1.2.1.jar b/solr/lib/commons-fileupload-1.2.1.jar
deleted file mode 100644
index 56a732bf658..00000000000
--- a/solr/lib/commons-fileupload-1.2.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[aa209b3887c90933cdc58c8c8572e90435e8e48d] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/commons-io-2.1.jar b/solr/lib/commons-io-2.1.jar
deleted file mode 100644
index 967caacee2d..00000000000
--- a/solr/lib/commons-io-2.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[b5c7d692fe5616af4332c1a1db6efd23e3ff881b] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/commons-lang-2.6.jar b/solr/lib/commons-lang-2.6.jar
deleted file mode 100644
index 8e54cbc4d1f..00000000000
--- a/solr/lib/commons-lang-2.6.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[98467d3a653ebad776ffa3542efeb9732fe0b482] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/easymock-2.2.jar b/solr/lib/easymock-2.2.jar
deleted file mode 100644
index 9936e77e57c..00000000000
--- a/solr/lib/easymock-2.2.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[c4159f5a0a4c19d6afc89cbc271208acb8ba7dff] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/guava-r05.jar b/solr/lib/guava-r05.jar
deleted file mode 100644
index c025ed3a543..00000000000
--- a/solr/lib/guava-r05.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[3aea56f8076551e8a5b631d8cc3d40190089f0a8] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/httpclient-4.1.3.jar b/solr/lib/httpclient-4.1.3.jar
deleted file mode 100644
index 9f5317a4ac0..00000000000
--- a/solr/lib/httpclient-4.1.3.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[dfa8793c26a659666a62472d476956bd21ab9460] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/httpcore-4.1.4.jar b/solr/lib/httpcore-4.1.4.jar
deleted file mode 100644
index 23b15a16147..00000000000
--- a/solr/lib/httpcore-4.1.4.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[1606a2e3f93423450a7c985673e6c7c633959abe] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/httpmime-4.1.3.jar b/solr/lib/httpmime-4.1.3.jar
deleted file mode 100644
index 8dbfcaa3a47..00000000000
--- a/solr/lib/httpmime-4.1.3.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[ff2014f339462497cdb2c4bdb62d2755c19cd033] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/contrib/uima/lib/uima-an-tagger-LICENSE-ASL.txt b/solr/lib/javax.servlet-api-LICENSE-ASL.txt
similarity index 100%
rename from solr/contrib/uima/lib/uima-an-tagger-LICENSE-ASL.txt
rename to solr/lib/javax.servlet-api-LICENSE-ASL.txt
diff --git a/solr/lib/servlet-api-NOTICE.txt b/solr/lib/javax.servlet-api-NOTICE.txt
similarity index 100%
rename from solr/lib/servlet-api-NOTICE.txt
rename to solr/lib/javax.servlet-api-NOTICE.txt
diff --git a/solr/lib/jcl-over-slf4j-1.6.1.jar b/solr/lib/jcl-over-slf4j-1.6.1.jar
deleted file mode 100644
index 052c22acc57..00000000000
--- a/solr/lib/jcl-over-slf4j-1.6.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[79e1ec2ca7179a2be9ef42db978285c6da4d9cb4] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/junit-4.10.jar b/solr/lib/junit-4.10.jar
deleted file mode 100644
index 3abf16af60e..00000000000
--- a/solr/lib/junit-4.10.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[954851e67d7424440592e8176c4aa034cc46aa85] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/log4j-over-slf4j-1.6.1.jar b/solr/lib/log4j-over-slf4j-1.6.1.jar
deleted file mode 100644
index 1b45587b92c..00000000000
--- a/solr/lib/log4j-over-slf4j-1.6.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[504541e9cd627b8ae616e37442958713a192e1a0] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/servlet-api-3.0.jar b/solr/lib/servlet-api-3.0.jar
deleted file mode 100644
index 422a2041cf4..00000000000
--- a/solr/lib/servlet-api-3.0.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[b135409682ee2173ee74cc9e9b00469d7fa0a27e] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/servlet-api-LICENSE-ASL.txt b/solr/lib/servlet-api-LICENSE-ASL.txt
deleted file mode 100644
index d6456956733..00000000000
--- a/solr/lib/servlet-api-LICENSE-ASL.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
diff --git a/solr/lib/slf4j-api-1.6.1.jar b/solr/lib/slf4j-api-1.6.1.jar
deleted file mode 100644
index 46d734aa603..00000000000
--- a/solr/lib/slf4j-api-1.6.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[42e0ad0de7773da9b94b12f503deda7f5a506015] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/slf4j-jdk14-1.6.1.jar b/solr/lib/slf4j-jdk14-1.6.1.jar
deleted file mode 100644
index 6ac0b5c5c15..00000000000
--- a/solr/lib/slf4j-jdk14-1.6.1.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[f4eb2f8afafda6920828ac6bdac5b14c22f0fa11] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/spatial4j-0.2.jar b/solr/lib/spatial4j-0.2.jar
deleted file mode 100644
index 69f87ce33f4..00000000000
--- a/solr/lib/spatial4j-0.2.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[82d4eadc1a5301bb86440e1eac81834fea8cba49] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/wstx-asl-3.2.7.jar b/solr/lib/wstx-asl-3.2.7.jar
deleted file mode 100755
index 8bf9769fe0c..00000000000
--- a/solr/lib/wstx-asl-3.2.7.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[277701703f09f05b322140a6bbb338e3a4833a19] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/lib/zookeeper-3.3.4.jar b/solr/lib/zookeeper-3.3.4.jar
deleted file mode 100644
index 27b98b979cb..00000000000
--- a/solr/lib/zookeeper-3.3.4.jar
+++ /dev/null
@@ -1,2 +0,0 @@
-AnyObjectId[29af880b357b123159d0d544a18dfd4fe30c5cf1] was removed in git history.
-Apache SVN contains full history.
\ No newline at end of file
diff --git a/solr/solrj/build.xml b/solr/solrj/build.xml
index b377be9f2a0..2c1d3923dff 100644
--- a/solr/solrj/build.xml
+++ b/solr/solrj/build.xml
@@ -18,6 +18,8 @@
<project name="solr-solrj" default="default">
<description>Solrj - Solr Java Client</description>
+ <property name="ivy.retrieve.pattern" value="${common-solr.dir}/lib/[artifact]-[revision].[ext]"/>
+
<import file="../common-build.xml"/>
<!-- Specialized common-solr.test.classpath, to remove the Solr core test output -->
diff --git a/solr/solrj/ivy.xml b/solr/solrj/ivy.xml
new file mode 100644
index 00000000000..f6bc551d868
--- /dev/null
+++ b/solr/solrj/ivy.xml
@@ -0,0 +1,36 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.solr" module="solrj"/>
+
+ <dependencies>
+ <dependency org="org.apache.zookeeper" name="zookeeper" rev="3.3.4" transitive="false"/>
+ <dependency org="org.slf4j" name="log4j-over-slf4j" rev="1.6.1" transitive="false"/>
+ <dependency org="org.apache.httpcomponents" name="httpcore" rev="4.1.4" transitive="false"/>
+ <dependency org="org.apache.httpcomponents" name="httpclient" rev="4.1.3" transitive="false"/>
+ <dependency org="org.apache.httpcomponents" name="httpmime" rev="4.1.3" transitive="false"/>
+ <dependency org="commons-io" name="commons-io" rev="2.1" transitive="false"/>
+ <dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.6.1" transitive="false"/>
+ <dependency org="org.codehaus.woodstox" name="wstx-asl" rev="3.2.7" transitive="false"/>
+ <dependency org="org.slf4j" name="slf4j-api" rev="1.6.1" transitive="false"/>
+ <dependency org="org.slf4j" name="slf4j-jdk14" rev="1.6.1" transitive="false"/>
+ <dependency org="junit" name="junit" rev="4.10" transitive="false"/>
+ <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+ </dependencies>
+</ivy-module>
diff --git a/solr/solrj/src/java/org/apache/noggit/CharArr.java b/solr/solrj/src/java/org/apache/noggit/CharArr.java
new file mode 100755
index 00000000000..b8115f4b568
--- /dev/null
+++ b/solr/solrj/src/java/org/apache/noggit/CharArr.java
@@ -0,0 +1,355 @@
+/**
+ * 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.
+ */
+
+package org.apache.noggit;
+
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.Writer;
+import java.nio.CharBuffer;
+
+// CharArr origins
+// V1.0 7/06/97
+// V1.1 9/21/99
+// V1.2 2/02/04 // Java5 features
+// V1.3 11/26/06 // Make safe for Java 1.4, work into Noggit
+// @author yonik
+
+
+// Java5 version could look like the following:
+// public class CharArr implements CharSequence, Appendable, Readable, Closeable {
+
+
+/**
+ * @author yonik
+ * @version $Id: CharArr.java 583538 2007-10-10 16:53:02Z yonik $
+ */
+public class CharArr implements CharSequence, Appendable {
+ protected char[] buf;
+ protected int start;
+ protected int end;
+
+ public CharArr() {
+ this(32);
+ }
+
+ public CharArr(int size) {
+ buf = new char[size];
+ }
+
+ public CharArr(char[] arr, int start, int end) {
+ set(arr,start,end);
+ }
+
+ public void setStart(int start) { this.start = start; }
+ public void setEnd(int end) { this.end = end; }
+ public void set(char[] arr, int start, int end) {
+ this.buf = arr;
+ this.start = start;
+ this.end = end;
+ }
+
+ public char[] getArray() { return buf; }
+ public int getStart() { return start; }
+ public int getEnd() { return end; }
+ public int size() { return end-start; }
+ public int length() { return size(); }
+ public int capacity() { return buf.length; }
+
+
+ public char charAt(int index) {
+ return buf[start+index];
+ }
+
+ public CharArr subSequence(int start, int end) {
+ return new CharArr(buf, this.start+start, this.start+end);
+ }
+
+ public int read() throws IOException {
+ if (start>=end) return -1;
+ return buf[start++];
+ }
+
+ public int read(char cbuf[], int off, int len) {
+ //TODO
+ return 0;
+ }
+
+ public void unsafeWrite(char b) {
+ buf[end++] = b;
+ }
+
+ public void unsafeWrite(int b) { unsafeWrite((char)b); }
+
+ public void unsafeWrite(char b[], int off, int len) {
+ System.arraycopy(b, off, buf, end, len);
+ end += len;
+ }
+
+ protected void resize(int len) {
+ char newbuf[] = new char[Math.max(buf.length << 1, len)];
+ System.arraycopy(buf, start, newbuf, 0, size());
+ buf = newbuf;
+ }
+
+ public void reserve(int num) {
+ if (end + num > buf.length) resize(end + num);
+ }
+
+ public void write(char b) {
+ if (end >= buf.length) {
+ resize(end+1);
+ }
+ unsafeWrite(b);
+ }
+
+ public final void write(int b) { write((char)b); }
+
+ public final void write(char[] b) {
+ write(b,0,b.length);
+ }
+
+ public void write(char b[], int off, int len) {
+ reserve(len);
+ unsafeWrite(b, off, len);
+ }
+
+ public final void write(CharArr arr) {
+ write(arr.buf, start, end-start);
+ }
+
+ public final void write(String s) {
+ write(s, 0, s.length());
+ }
+
+ public void write(String s, int stringOffset, int len) {
+ reserve(len);
+ s.getChars(stringOffset, len, buf, end);
+ end += len;
+ }
+
+ public void flush() {
+ }
+
+ public final void reset() {
+ start = end = 0;
+ }
+
+ public void close() {
+ }
+
+ public char[] toCharArray() {
+ char newbuf[] = new char[size()];
+ System.arraycopy(buf, start, newbuf, 0, size());
+ return newbuf;
+ }
+
+
+ public String toString() {
+ return new String(buf, start, size());
+ }
+
+
+ public int read(CharBuffer cb) throws IOException {
+
+ /***
+ int sz = size();
+ if (sz<=0) return -1;
+ if (sz>0) cb.put(buf, start, sz);
+ return -1;
+ ***/
+
+ int sz = size();
+ if (sz>0) cb.put(buf, start, sz);
+ start=end;
+ while (true) {
+ fill();
+ int s = size();
+ if (s==0) return sz==0 ? -1 : sz;
+ sz += s;
+ cb.put(buf, start, s);
+ }
+ }
+
+
+ public int fill() throws IOException {
+ return 0; // or -1?
+ }
+
+ //////////////// Appendable methods /////////////
+ public final Appendable append(CharSequence csq) throws IOException {
+ return append(csq, 0, csq.length());
+ }
+
+ public Appendable append(CharSequence csq, int start, int end) throws IOException {
+ write(csq.subSequence(start, end).toString());
+ return null;
+ }
+
+ public final Appendable append(char c) throws IOException {
+ write(c);
+ return this;
+ }
+}
+
+
+class NullCharArr extends CharArr {
+ public NullCharArr() {
+ super(new char[1],0,0);
+ }
+ public void unsafeWrite(char b) {}
+
+ public void unsafeWrite(char b[], int off, int len) {}
+
+ public void unsafeWrite(int b) {}
+
+ public void write(char b) {}
+
+ public void write(char b[], int off, int len) {}
+
+ public void reserve(int num) {}
+
+ protected void resize(int len) {}
+
+ public Appendable append(CharSequence csq, int start, int end) throws IOException {
+ return this;
+ }
+
+ public char charAt(int index) {
+ return 0;
+ }
+
+ public void write(String s, int stringOffset, int len) {
+ }
+}
+
+
+
+// IDEA: a subclass that refills the array from a reader?
+class CharArrReader extends CharArr {
+ protected final Reader in;
+
+ public CharArrReader(Reader in, int size) {
+ super(size);
+ this.in = in;
+ }
+
+ public int read() throws IOException {
+ if (start>=end) fill();
+ return start>=end ? -1 : buf[start++];
+ }
+
+ public int read(CharBuffer cb) throws IOException {
+ // empty the buffer and then read direct
+ int sz = size();
+ if (sz>0) cb.put(buf,start,end);
+ int sz2 = in.read(cb);
+ if (sz2>=0) return sz+sz2;
+ return sz>0 ? sz : -1;
+ }
+
+ public int fill() throws IOException {
+ if (start>=end) {
+ reset();
+ } else if (start>0) {
+ System.arraycopy(buf, start, buf, 0, size());
+ end=size(); start=0;
+ }
+ /***
+ // fill fully or not???
+ do {
+ int sz = in.read(buf,end,buf.length-end);
+ if (sz==-1) return;
+ end+=sz;
+ } while (end < buf.length);
+ ***/
+
+ int sz = in.read(buf,end,buf.length-end);
+ if (sz>0) end+=sz;
+ return sz;
+ }
+
+}
+
+
+
+class CharArrWriter extends CharArr {
+ protected Writer sink;
+
+ @Override
+ public void flush() {
+ try {
+ sink.write(buf, start, end-start);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ start = end = 0;
+ }
+
+ @Override
+ public void write(char b) {
+ if (end >= buf.length) {
+ flush();
+ }
+ unsafeWrite(b);
+ }
+
+ @Override
+ public void write(char b[], int off, int len) {
+ int space = buf.length - end;
+ if (len < space) {
+ unsafeWrite(b, off, len);
+ } else if (len < buf.length) {
+ unsafeWrite(b, off, space);
+ flush();
+ unsafeWrite(b, off+space, len-space);
+ } else {
+ flush();
+ try {
+ sink.write(b, off, len);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ @Override
+ public void write(String s, int stringOffset, int len) {
+ int space = buf.length - end;
+ if (len < space) {
+ s.getChars(stringOffset, stringOffset+len, buf, end);
+ end += len;
+ } else if (len < buf.length) {
+ // if the data to write is small enough, buffer it.
+ s.getChars(stringOffset, stringOffset+space, buf, end);
+ flush();
+ s.getChars(stringOffset+space, stringOffset+len, buf, 0);
+ end = len-space;
+ } else {
+ flush();
+ // don't buffer, just write to sink
+ try {
+ sink.write(s, stringOffset, len);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+
+ }
+ }
+}
+
diff --git a/solr/solrj/src/java/org/apache/noggit/CharUtil.java b/solr/solrj/src/java/org/apache/noggit/CharUtil.java
new file mode 100755
index 00000000000..df122a30cc2
--- /dev/null
+++ b/solr/solrj/src/java/org/apache/noggit/CharUtil.java
@@ -0,0 +1,55 @@
+/**
+ * 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.
+ */
+
+package org.apache.noggit;
+
+
+/**
+ * @author yonik
+ * @version $Id: CharUtil.java 479919 2006-11-28 05:53:55Z yonik $
+ */
+public class CharUtil {
+
+ // belongs in number utils or charutil?
+ public long parseLong(char[] arr, int start, int end) {
+ long x = 0;
+ boolean negative = arr[start] == '-';
+ for (int i=negative ? start+1 : start; i<end; i++) {
+ // If constructing the largest negative number, this will overflow
+ // to the largest negative number. This is OK since the negation of
+ // the largest negative number is itself in two's complement.
+ x = x * 10 + (arr[i] - '0');
+ }
+ // could replace conditional-move with multiplication of sign... not sure
+ // which is faster.
+ return negative ? -x : x;
+ }
+
+
+ public int compare(char[] a, int a_start, int a_end, char[] b, int b_start, int b_end) {
+ int a_len = a_end - a_start;
+ int b_len = b_end - b_start;
+ int len = Math.min(a_len,b_len);
+ while (--len>=0) {
+ int c = a[a_start] - b[b_start];
+ if (c!=0) return c;
+ a_start++; b_start++;
+ }
+ return a_len-b_len;
+ }
+
+}
diff --git a/solr/solrj/src/java/org/apache/noggit/JSONParser.java b/solr/solrj/src/java/org/apache/noggit/JSONParser.java
new file mode 100755
index 00000000000..f8a4684ea4a
--- /dev/null
+++ b/solr/solrj/src/java/org/apache/noggit/JSONParser.java
@@ -0,0 +1,838 @@
+/**
+ * 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.
+ */
+
+package org.apache.noggit;
+
+import java.io.IOException;
+import java.io.Reader;
+
+/**
+ * @author yonik
+ * @version $Id: JSONParser.java 1099557 2011-05-04 18:54:26Z yonik $
+ */
+
+public class JSONParser {
+
+ /** Event indicating a JSON string value, including member names of objects */
+ public static final int STRING=1;
+ /** Event indicating a JSON number value which fits into a signed 64 bit integer */
+ public static final int LONG=2;
+ /** Event indicating a JSON number value which has a fractional part or an exponent
+ * and with string length <= 23 chars not including sign. This covers
+ * all representations of normal values for Double.toString().
+ */
+ public static final int NUMBER=3;
+ /** Event indicating a JSON number value that was not produced by toString of any
+ * Java primitive numerics such as Double or Long. It is either
+ * an integer outside the range of a 64 bit signed integer, or a floating
+ * point value with a string representation of more than 23 chars.
+ */
+ public static final int BIGNUMBER=4;
+ /** Event indicating a JSON boolean */
+ public static final int BOOLEAN=5;
+ /** Event indicating a JSON null */
+ public static final int NULL=6;
+ /** Event indicating the start of a JSON object */
+ public static final int OBJECT_START=7;
+ /** Event indicating the end of a JSON object */
+ public static final int OBJECT_END=8;
+ /** Event indicating the start of a JSON array */
+ public static final int ARRAY_START=9;
+ /** Event indicating the end of a JSON array */
+ public static final int ARRAY_END=10;
+ /** Event indicating the end of input has been reached */
+ public static final int EOF=11;
+
+ public static class ParseException extends RuntimeException {
+ public ParseException(String msg) {
+ super(msg);
+ }
+ }
+
+ public static String getEventString( int e )
+ {
+ switch( e )
+ {
+ case STRING: return "STRING";
+ case LONG: return "LONG";
+ case NUMBER: return "NUMBER";
+ case BIGNUMBER: return "BIGNUMBER";
+ case BOOLEAN: return "BOOLEAN";
+ case NULL: return "NULL";
+ case OBJECT_START: return "OBJECT_START";
+ case OBJECT_END: return "OBJECT_END";
+ case ARRAY_START: return "ARRAY_START";
+ case ARRAY_END: return "ARRAY_END";
+ case EOF: return "EOF";
+ }
+ return "Unknown: "+e;
+ }
+
+ private static final CharArr devNull = new NullCharArr();
+
+
+ final char[] buf; // input buffer with JSON text in it
+ int start; // current position in the buffer
+ int end; // end position in the buffer (one past last valid index)
+ final Reader in; // optional reader to obtain data from
+ boolean eof=false; // true if the end of the stream was reached.
+ long gpos; // global position = gpos + start
+
+ int event; // last event read
+
+ public JSONParser(Reader in) {
+ this(in, new char[8192]);
+ // 8192 matches the default buffer size of a BufferedReader so double
+ // buffering of the data is avoided.
+ }
+
+ public JSONParser(Reader in, char[] buffer) {
+ this.in = in;
+ this.buf = buffer;
+ }
+
+ // idea - if someone passes us a CharArrayReader, we could
+ // directly use that buffer as it's protected.
+
+ public JSONParser(char[] data, int start, int end) {
+ this.in = null;
+ this.buf = data;
+ this.start = start;
+ this.end = end;
+ }
+
+ public JSONParser(String data) {
+ this(data, 0, data.length());
+ }
+
+ public JSONParser(String data, int start, int end) {
+ this.in = null;
+ this.start = start;
+ this.end = end;
+ this.buf = new char[end-start];
+ data.getChars(start,end,buf,0);
+ }
+
+ // temporary output buffer
+ private final CharArr out = new CharArr(64);
+
+ // We need to keep some state in order to (at a minimum) know if
+ // we should skip ',' or ':'.
+ private byte[] stack = new byte[16];
+ private int ptr=0; // pointer into the stack of parser states
+ private byte state=0; // current parser state
+
+ // parser states stored in the stack
+ private static final byte DID_OBJSTART =1; // '{' just read
+ private static final byte DID_ARRSTART =2; // '[' just read
+ private static final byte DID_ARRELEM =3; // array element just read
+ private static final byte DID_MEMNAME =4; // object member name (map key) just read
+ private static final byte DID_MEMVAL =5; // object member value (map val) just read
+
+ // info about value that was just read (or is in the middle of being read)
+ private int valstate;
+
+ // push current parser state (use at start of new container)
+ private final void push() {
+ if (ptr >= stack.length) {
+ // doubling here is probably overkill, but anything that needs to double more than
+ // once (32 levels deep) is very atypical anyway.
+ byte[] newstack = new byte[stack.length<<1];
+ System.arraycopy(stack,0,newstack,0,stack.length);
+ stack = newstack;
+ }
+ stack[ptr++] = state;
+ }
+
+ // pop parser state (use at end of container)
+ private final void pop() {
+ if (--ptr<0) {
+ throw err("Unbalanced container");
+ } else {
+ state = stack[ptr];
+ }
+ }
+
+ protected void fill() throws IOException {
+ if (in!=null) {
+ gpos += end;
+ start=0;
+ int num = in.read(buf,0,buf.length);
+ end = num>=0 ? num : 0;
+ }
+ if (start>=end) eof=true;
+ }
+
+ private void getMore() throws IOException {
+ fill();
+ if (start>=end) {
+ throw err(null);
+ }
+ }
+
+ protected int getChar() throws IOException {
+ if (start>=end) {
+ fill();
+ if (start>=end) return -1;
+ }
+ return buf[start++];
+ }
+
+ private int getCharNWS() throws IOException {
+ for (;;) {
+ int ch = getChar();
+ if (!(ch==' ' || ch=='\t' || ch=='\n' || ch=='\r')) return ch;
+ }
+ }
+
+ private void expect(char[] arr) throws IOException {
+ for (int i=1; i<arr.length; i++) {
+ int ch = getChar();
+ if (ch != arr[i]) {
+ throw err("Expected " + new String(arr));
+ }
+ }
+ }
+
+ private ParseException err(String msg) {
+ // We can't tell if EOF was hit by comparing start<=end
+ // because the illegal char could have been the last in the buffer
+ // or in the stream. To deal with this, the "eof" var was introduced
+ if (!eof && start>0) start--; // backup one char
+ String chs = "char=" + ((start>=end) ? "(EOF)" : "" + (char)buf[start]);
+ String pos = "position=" + (gpos+start);
+ String tot = chs + ',' + pos + getContext();
+ if (msg==null) {
+ if (start>=end) msg = "Unexpected EOF";
+ else msg="JSON Parse Error";
+ }
+ return new ParseException(msg + ": " + tot);
+ }
+
+ private String getContext() {
+ String context = "";
+ if (start>=0) {
+ context += " BEFORE='" + errEscape(Math.max(start-60,0), start+1) + "'";
+ }
+ if (start<end) {
+ context += " AFTER='" + errEscape(start+1, start+40) + "'";
+ }
+ return context;
+ }
+
+ private String errEscape(int a, int b) {
+ b = Math.min(b, end);
+ if (a>=b) return "";
+ return new String(buf, a, b-a).replaceAll("\\s+"," ");
+ }
+
+
+ private boolean bool; // boolean value read
+ private long lval; // long value read
+ private int nstate; // current state while reading a number
+ private static final int HAS_FRACTION = 0x01; // nstate flag, '.' already read
+ private static final int HAS_EXPONENT = 0x02; // nstate flag, '[eE][+-]?[0-9]' already read
+
+ /** Returns the long read... only significant if valstate==LONG after
+ * this call. firstChar should be the first numeric digit read.
+ */
+ private long readNumber(int firstChar, boolean isNeg) throws IOException {
+ out.unsafeWrite(firstChar); // unsafe OK since we know output is big enough
+ // We build up the number in the negative plane since it's larger (by one) than
+ // the positive plane.
+ long v = '0' - firstChar;
+ // can't overflow a long in 18 decimal digits (i.e. 17 additional after the first).
+ // we also need 22 additional to handle double so we'll handle in 2 separate loops.
+ int i;
+ for (i=0; i<17; i++) {
+ int ch = getChar();
+ // TODO: is this switch faster as an if-then-else?
+ switch(ch) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ v = v*10 - (ch-'0');
+ out.unsafeWrite(ch);
+ continue;
+ case '.':
+ out.unsafeWrite('.');
+ valstate = readFrac(out,22-i);
+ return 0;
+ case 'e':
+ case 'E':
+ out.unsafeWrite(ch);
+ nstate=0;
+ valstate = readExp(out,22-i);
+ return 0;
+ default:
+ // return the number, relying on nextEvent() to return an error
+ // for invalid chars following the number.
+ if (ch!=-1) --start; // push back last char if not EOF
+
+ valstate = LONG;
+ return isNeg ? v : -v;
+ }
+ }
+
+ // after this, we could overflow a long and need to do extra checking
+ boolean overflow = false;
+ long maxval = isNeg ? Long.MIN_VALUE : -Long.MAX_VALUE;
+
+ for (; i<22; i++) {
+ int ch = getChar();
+ switch(ch) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (v < (0x8000000000000000L/10)) overflow=true; // can't multiply by 10 w/o overflowing
+ v *= 10;
+ int digit = ch - '0';
+ if (v < maxval + digit) overflow=true; // can't add digit w/o overflowing
+ v -= digit;
+ out.unsafeWrite(ch);
+ continue;
+ case '.':
+ out.unsafeWrite('.');
+ valstate = readFrac(out,22-i);
+ return 0;
+ case 'e':
+ case 'E':
+ out.unsafeWrite(ch);
+ nstate=0;
+ valstate = readExp(out,22-i);
+ return 0;
+ default:
+ // return the number, relying on nextEvent() to return an error
+ // for invalid chars following the number.
+ if (ch!=-1) --start; // push back last char if not EOF
+
+ valstate = overflow ? BIGNUMBER : LONG;
+ return isNeg ? v : -v;
+ }
+ }
+
+
+ nstate=0;
+ valstate = BIGNUMBER;
+ return 0;
+ }
+
+
+ // read digits right of decimal point
+ private int readFrac(CharArr arr, int lim) throws IOException {
+ nstate = HAS_FRACTION; // deliberate set instead of '|'
+ while(--lim>=0) {
+ int ch = getChar();
+ if (ch>='0' && ch<='9') {
+ arr.write(ch);
+ } else if (ch=='e' || ch=='E') {
+ arr.write(ch);
+ return readExp(arr,lim);
+ } else {
+ if (ch!=-1) start--; // back up
+ return NUMBER;
+ }
+ }
+ return BIGNUMBER;
+ }
+
+
+ // call after 'e' or 'E' has been seen to read the rest of the exponent
+ private int readExp(CharArr arr, int lim) throws IOException {
+ nstate |= HAS_EXPONENT;
+ int ch = getChar(); lim--;
+
+ if (ch=='+' || ch=='-') {
+ arr.write(ch);
+ ch = getChar(); lim--;
+ }
+
+ // make sure at least one digit is read.
+ if (ch<'0' || ch>'9') {
+ throw err("missing exponent number");
+ }
+ arr.write(ch);
+
+ return readExpDigits(arr,lim);
+ }
+
+ // continuation of readExpStart
+ private int readExpDigits(CharArr arr, int lim) throws IOException {
+ while (--lim>=0) {
+ int ch = getChar();
+ if (ch>='0' && ch<='9') {
+ arr.write(ch);
+ } else {
+ if (ch!=-1) start--; // back up
+ return NUMBER;
+ }
+ }
+ return BIGNUMBER;
+ }
+
+ private void continueNumber(CharArr arr) throws IOException {
+ if (arr != out) arr.write(out);
+
+ if ((nstate & HAS_EXPONENT)!=0){
+ readExpDigits(arr, Integer.MAX_VALUE);
+ return;
+ }
+ if (nstate != 0) {
+ readFrac(arr, Integer.MAX_VALUE);
+ return;
+ }
+
+ for(;;) {
+ int ch = getChar();
+ if (ch>='0' && ch <='9') {
+ arr.write(ch);
+ } else if (ch=='.') {
+ arr.write(ch);
+ readFrac(arr,Integer.MAX_VALUE);
+ return;
+ } else if (ch=='e' || ch=='E') {
+ arr.write(ch);
+ readExp(arr,Integer.MAX_VALUE);
+ return;
+ } else {
+ if (ch!=-1) start--;
+ return;
+ }
+ }
+ }
+
+
+ private int hexval(int hexdig) {
+ if (hexdig>='0' && hexdig <='9') {
+ return hexdig-'0';
+ } else if (hexdig>='A' && hexdig <='F') {
+ return hexdig+(10-'A');
+ } else if (hexdig>='a' && hexdig <='f') {
+ return hexdig+(10-'a');
+ }
+ throw err("invalid hex digit");
+ }
+
+ // backslash has already been read when this is called
+ private char readEscapedChar() throws IOException {
+ switch (getChar()) {
+ case '"' : return '"';
+ case '\\' : return '\\';
+ case '/' : return '/';
+ case 'n' : return '\n';
+ case 'r' : return '\r';
+ case 't' : return '\t';
+ case 'f' : return '\f';
+ case 'b' : return '\b';
+ case 'u' :
+ return (char)(
+ (hexval(getChar()) << 12)
+ | (hexval(getChar()) << 8)
+ | (hexval(getChar()) << 4)
+ | (hexval(getChar())));
+ }
+ throw err("Invalid character escape in string");
+ }
+
+ // a dummy buffer we can use to point at other buffers
+ private final CharArr tmp = new CharArr(null,0,0);
+
+ private CharArr readStringChars() throws IOException {
+ char c=0;
+ int i;
+ for (i=start; i<end; i++) {
+ c = buf[i];
+ if (c=='"') {
+ tmp.set(buf,start,i); // directly use input buffer
+ start=i+1; // advance past last '"'
+ return tmp;
+ } else if (c=='\\') {
+ break;
+ }
+ }
+ out.reset();
+ readStringChars2(out, i);
+ return out;
+ }
+
+
+ // middle is the pointer to the middle of a buffer to start scanning for a non-string
+ // character ('"' or "/"). start<=middle<end
+ // this should be faster for strings with fewer escapes, but probably slower for many escapes.
+ private void readStringChars2(CharArr arr, int middle) throws IOException {
+ for (;;) {
+ if (middle>=end) {
+ arr.write(buf,start,middle-start);
+ start=middle;
+ getMore();
+ middle=start;
+ }
+ int ch = buf[middle++];
+ if (ch=='"') {
+ int len = middle-start-1;
+ if (len>0) arr.write(buf,start,len);
+ start=middle;
+ return;
+ } else if (ch=='\\') {
+ int len = middle-start-1;
+ if (len>0) arr.write(buf,start,len);
+ start=middle;
+ arr.write(readEscapedChar());
+ middle=start;
+ }
+ }
+ }
+
+
+ /*** alternate implelentation
+ // middle is the pointer to the middle of a buffer to start scanning for a non-string
+ // character ('"' or "/"). start<=middle<end
+ private void readStringChars2a(CharArr arr, int middle) throws IOException {
+ int ch=0;
+ for(;;) {
+ // find the next non-string char
+ for (; middle<end; middle++) {
+ ch = buf[middle];
+ if (ch=='"' || ch=='\\') break;
+ }
+
+ arr.write(buf,start,middle-start);
+ if (middle>=end) {
+ getMore();
+ middle=start;
+ } else {
+ start = middle+1; // set buffer pointer to correct spot
+ if (ch=='"') {
+ valstate=0;
+ return;
+ } else if (ch=='\\') {
+ arr.write(readEscapedChar());
+ if (start>=end) getMore();
+ middle=start;
+ }
+ }
+ }
+ }
+ ***/
+
+
+ // return the next event when parser is in a neutral state (no
+ // map separators or array element separators to read
+ private int next(int ch) throws IOException {
+ for(;;) {
+ switch (ch) {
+ case ' ':
+ case '\t': break;
+ case '\r':
+ case '\n': break; // try and keep track of linecounts?
+ case '"' :
+ valstate = STRING;
+ return STRING;
+ case '{' :
+ push();
+ state= DID_OBJSTART;
+ return OBJECT_START;
+ case '[':
+ push();
+ state=DID_ARRSTART;
+ return ARRAY_START;
+ case '0' :
+ out.reset();
+ //special case '0'? If next char isn't '.' val=0
+ ch=getChar();
+ if (ch=='.') {
+ start--; ch='0';
+ readNumber('0',false);
+ return valstate;
+ } else if (ch>'9' || ch<'0') {
+ out.unsafeWrite('0');
+ if (ch!=-1) start--;
+ lval = 0;
+ valstate=LONG;
+ return LONG;
+ } else {
+ throw err("Leading zeros not allowed");
+ }
+ case '1' :
+ case '2' :
+ case '3' :
+ case '4' :
+ case '5' :
+ case '6' :
+ case '7' :
+ case '8' :
+ case '9' :
+ out.reset();
+ lval = readNumber(ch,false);
+ return valstate;
+ case '-' :
+ out.reset();
+ out.unsafeWrite('-');
+ ch = getChar();
+ if (ch<'0' || ch>'9') throw err("expected digit after '-'");
+ lval = readNumber(ch,true);
+ return valstate;
+ case 't':
+ valstate=BOOLEAN;
+ // TODO: test performance of this non-branching inline version.
+ // if ((('r'-getChar())|('u'-getChar())|('e'-getChar())) != 0) err("");
+ expect(JSONUtil.TRUE_CHARS);
+ bool=true;
+ return BOOLEAN;
+ case 'f':
+ valstate=BOOLEAN;
+ expect(JSONUtil.FALSE_CHARS);
+ bool=false;
+ return BOOLEAN;
+ case 'n':
+ valstate=NULL;
+ expect(JSONUtil.NULL_CHARS);
+ return NULL;
+ case -1:
+ if (getLevel()>0) throw err("Premature EOF");
+ return EOF;
+ default: throw err(null);
+ }
+
+ ch = getChar();
+ }
+ }
+
+ public String toString() {
+ return "start="+start+",end="+end+",state="+state+"valstate="+valstate;
+ }
+
+
+ /** Returns the next event encountered in the JSON stream, one of
+ * <ul>
+ * <li>{@link #STRING}</li>
+ * <li>{@link #LONG}</li>
+ * <li>{@link #NUMBER}</li>
+ * <li>{@link #BIGNUMBER}</li>
+ * <li>{@link #BOOLEAN}</li>
+ * <li>{@link #NULL}</li>
+ * <li>{@link #OBJECT_START}</li>
+ * <li>{@link #OBJECT_END}</li>
+ * <li>{@link #OBJECT_END}</li>
+ * <li>{@link #ARRAY_START}</li>
+ * <li>{@link #ARRAY_END}</li>
+ * <li>{@link #EOF}</li>
+ * </ul>
+ */
+ public int nextEvent() throws IOException {
+ if (valstate==STRING) {
+ readStringChars2(devNull,start);
+ }
+ else if (valstate==BIGNUMBER) {
+ continueNumber(devNull);
+ }
+
+ valstate=0;
+
+ int ch; // TODO: factor out getCharNWS() to here and check speed
+ switch (state) {
+ case 0:
+ return event = next(getCharNWS());
+ case DID_OBJSTART:
+ ch = getCharNWS();
+ if (ch=='}') {
+ pop();
+ return event = OBJECT_END;
+ }
+ if (ch != '"') {
+ throw err("Expected string");
+ }
+ state = DID_MEMNAME;
+ valstate = STRING;
+ return event = STRING;
+ case DID_MEMNAME:
+ ch = getCharNWS();
+ if (ch!=':') {
+ throw err("Expected key,value separator ':'");
+ }
+ state = DID_MEMVAL; // set state first because it might be pushed...
+ return event = next(getChar());
+ case DID_MEMVAL:
+ ch = getCharNWS();
+ if (ch=='}') {
+ pop();
+ return event = OBJECT_END;
+ } else if (ch!=',') {
+ throw err("Expected ',' or '}'");
+ }
+ ch = getCharNWS();
+ if (ch != '"') {
+ throw err("Expected string");
+ }
+ state = DID_MEMNAME;
+ valstate = STRING;
+ return event = STRING;
+ case DID_ARRSTART:
+ ch = getCharNWS();
+ if (ch==']') {
+ pop();
+ return event = ARRAY_END;
+ }
+ state = DID_ARRELEM; // set state first, might be pushed...
+ return event = next(ch);
+ case DID_ARRELEM:
+ ch = getCharNWS();
+ if (ch==']') {
+ pop();
+ return event = ARRAY_END;
+ } else if (ch!=',') {
+ throw err("Expected ',' or ']'");
+ }
+ // state = DID_ARRELEM;
+ return event = next(getChar());
+ }
+ return 0;
+ }
+
+ public int lastEvent() {
+ return event;
+ }
+
+ public boolean wasKey()
+ {
+ return state == DID_MEMNAME;
+ }
+
+
+ private void goTo(int what) throws IOException {
+ if (valstate==what) { valstate=0; return; }
+ if (valstate==0) {
+ int ev = nextEvent(); // TODO
+ if (valstate!=what) {
+ throw err("type mismatch");
+ }
+ valstate=0;
+ }
+ else {
+ throw err("type mismatch");
+ }
+ }
+
+ /** Returns the JSON string value, decoding any escaped characters. */
+ public String getString() throws IOException {
+ return getStringChars().toString();
+ }
+
+ /** Returns the characters of a JSON string value, decoding any escaped characters.
+ * <p/>The underlying buffer of the returned <code>CharArr</code> should *not* be
+ * modified as it may be shared with the input buffer.
+ * <p/>The returned <code>CharArr</code> will only be valid up until
+ * the next JSONParser method is called. Any required data should be
+ * read before that point.
+ */
+ public CharArr getStringChars() throws IOException {
+ goTo(STRING);
+ return readStringChars();
+ }
+
+ /** Reads a JSON string into the output, decoding any escaped characters. */
+ public void getString(CharArr output) throws IOException {
+ goTo(STRING);
+ readStringChars2(output,start);
+ }
+
+ /** Reads a number from the input stream and parses it as a long, only if
+ * the value will in fact fit into a signed 64 bit integer. */
+ public long getLong() throws IOException {
+ goTo(LONG);
+ return lval;
+ }
+
+ /** Reads a number from the input stream and parses it as a double */
+ public double getDouble() throws IOException {
+ return Double.parseDouble(getNumberChars().toString());
+ }
+
+ /** Returns the characters of a JSON numeric value.
+ * <p/>The underlying buffer of the returned <code>CharArr</code> should *not* be
+ * modified as it may be shared with the input buffer.
+ * <p/>The returned <code>CharArr</code> will only be valid up until
+ * the next JSONParser method is called. Any required data should be
+ * read before that point.
+ */
+ public CharArr getNumberChars() throws IOException {
+ int ev=0;
+ if (valstate==0) ev = nextEvent();
+
+ if (valstate == LONG || valstate == NUMBER) {
+ valstate=0;
+ return out;
+ }
+ else if (valstate==BIGNUMBER) {
+ continueNumber(out);
+ valstate=0;
+ return out;
+ } else {
+ throw err("Unexpected " + ev);
+ }
+ }
+
+ /** Reads a JSON numeric value into the output. */
+ public void getNumberChars(CharArr output) throws IOException {
+ int ev=0;
+ if (valstate==0) ev=nextEvent();
+ if (valstate == LONG || valstate == NUMBER) output.write(this.out);
+ else if (valstate==BIGNUMBER) {
+ continueNumber(output);
+ } else {
+ throw err("Unexpected " + ev);
+ }
+ valstate=0;
+ }
+
+ /** Reads a boolean value */
+ public boolean getBoolean() throws IOException {
+ goTo(BOOLEAN);
+ return bool;
+ }
+
+ /** Reads a null value */
+ public void getNull() throws IOException {
+ goTo(NULL);
+ }
+
+ /**
+ * @return the current nesting level, the number of parent objects or arrays.
+ */
+ public int getLevel() {
+ return ptr;
+ }
+
+ public long getPosition()
+ {
+ return gpos+start;
+ }
+}
diff --git a/solr/solrj/src/java/org/apache/noggit/JSONUtil.java b/solr/solrj/src/java/org/apache/noggit/JSONUtil.java
new file mode 100755
index 00000000000..9003f8b830a
--- /dev/null
+++ b/solr/solrj/src/java/org/apache/noggit/JSONUtil.java
@@ -0,0 +1,164 @@
+/**
+ * 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.
+ */
+
+package org.apache.noggit;
+
+/**
+ * @author yonik
+ * @version $Id: JSONUtil.java 1209632 2011-12-02 18:48:42Z yonik $
+ */
+
+public class JSONUtil {
+ public static final char[] TRUE_CHARS = new char[] {'t','r','u','e'};
+ public static final char[] FALSE_CHARS = new char[] {'f','a','l','s','e'};
+ public static final char[] NULL_CHARS = new char[] {'n','u','l','l'};
+ public static final char[] HEX_CHARS = new char[] {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
+ public static final char VALUE_SEPARATOR = ',';
+ public static final char NAME_SEPARATOR = ':';
+ public static final char OBJECT_START = '{';
+ public static final char OBJECT_END = '}';
+ public static final char ARRAY_START = '[';
+ public static final char ARRAY_END = ']';
+
+ public static String toJSON(Object o) {
+ CharArr out = new CharArr();
+ new JSONWriter(out).write(o);
+ return out.toString();
+ }
+
+ /**
+ * @param o The object to convert to JSON
+ * @param indentSize The number of space characters to use as an indent (default 2). 0=newlines but no spaces, -1=no indent at all.
+ * @return Given Object converted to its JSON representation using the given indentSize
+ */
+ public static String toJSON(Object o, int indentSize) {
+ CharArr out = new CharArr();
+ new JSONWriter(out,indentSize).write(o);
+ return out.toString();
+ }
+
+ public static void writeNumber(int number, CharArr out) {
+ out.write(Integer.toString(number));
+ }
+
+ public static void writeNumber(long number, CharArr out) {
+ out.write(Long.toString(number));
+ }
+
+ public static void writeNumber(float number, CharArr out) {
+ out.write(Float.toString(number));
+ }
+
+ public static void writeNumber(double number, CharArr out) {
+ out.write(Double.toString(number));
+ }
+
+ public static void writeString(CharArr val, CharArr out) {
+ writeString(val.getArray(), val.getStart(), val.getEnd(), out);
+ }
+
+ public static void writeString(char[] val, int start, int end, CharArr out) {
+ out.write('"');
+ writeStringPart(val,start,end,out);
+ out.write('"');
+ }
+
+ public static void writeString(CharSequence val, int start, int end, CharArr out) {
+ out.write('"');
+ writeStringPart(val,start,end,out);
+ out.write('"');
+ }
+
+ public static void writeStringPart(char[] val, int start, int end, CharArr out) {
+ for (int i=start; i<end; i++) {
+ char ch = val[i];
+ switch(ch) {
+ case '"':
+ case '\\':
+ out.write('\\');
+ out.write(ch);
+ break;
+ case '\r': out.write('\\'); out.write('r'); break;
+ case '\n': out.write('\\'); out.write('n'); break;
+ case '\t': out.write('\\'); out.write('t'); break;
+ case '\b': out.write('\\'); out.write('b'); break;
+ case '\f': out.write('\\'); out.write('f'); break;
+ // case '/':
+ default:
+ if (ch <= 0x1F) {
+ unicodeEscape(ch,out);
+ } else {
+ // These characters are valid JSON, but not valid JavaScript
+ if (ch=='\u2028' || ch=='\u2029') {
+ unicodeEscape(ch,out);
+ } else {
+ out.write(ch);
+ }
+ }
+ }
+ }
+ }
+
+ public static void writeStringPart(CharSequence chars, int start, int end, CharArr out) {
+ for (int i=start; i<end; i++) {
+ char ch = chars.charAt(i);
+ switch(ch) {
+ case '"':
+ case '\\':
+ out.write('\\');
+ out.write(ch);
+ break;
+ case '\r': out.write('\\'); out.write('r'); break;
+ case '\n': out.write('\\'); out.write('n'); break;
+ case '\t': out.write('\\'); out.write('t'); break;
+ case '\b': out.write('\\'); out.write('b'); break;
+ case '\f': out.write('\\'); out.write('f'); break;
+ // case '/':
+ default:
+ if (ch <= 0x1F) {
+ unicodeEscape(ch,out);
+ } else {
+ // These characters are valid JSON, but not valid JavaScript
+ if (ch=='\u2028' || ch=='\u2029') {
+ unicodeEscape(ch,out);
+ } else {
+ out.write(ch);
+ }
+ }
+ }
+ }
+ }
+
+
+ public static void unicodeEscape(int ch, CharArr out) {
+ out.write('\\');
+ out.write('u');
+ out.write(HEX_CHARS[ch>>>12]);
+ out.write(HEX_CHARS[(ch>>>8)&0xf]);
+ out.write(HEX_CHARS[(ch>>>4)&0xf]);
+ out.write(HEX_CHARS[ch&0xf]);
+ }
+
+ public static void writeNull(CharArr out) {
+ out.write(NULL_CHARS);
+ }
+
+ public static void writeBoolean(boolean val, CharArr out) {
+ out.write(val ? TRUE_CHARS : FALSE_CHARS);
+ }
+
+}
diff --git a/solr/solrj/src/java/org/apache/noggit/JSONWriter.java b/solr/solrj/src/java/org/apache/noggit/JSONWriter.java
new file mode 100755
index 00000000000..18376947536
--- /dev/null
+++ b/solr/solrj/src/java/org/apache/noggit/JSONWriter.java
@@ -0,0 +1,344 @@
+/**
+ * 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.
+ */
+
+package org.apache.noggit;
+
+import java.util.*;
+
+/**
+ * @author yonik
+ * @version $Id: JSONWriter.java 1211150 2011-12-06 21:10:01Z yonik $
+ */
+public class JSONWriter {
+
+ /** Implement this interface on your class to support serialization */
+ public static interface Writable {
+ public void write(JSONWriter writer);
+ }
+
+ protected int level;
+ protected int indent;
+ protected final CharArr out;
+
+ /**
+ * @param out the CharArr to write the output to.
+ * @param indentSize The number of space characters to use as an indent (default 2). 0=newlines but no spaces, -1=no indent at all.
+ */
+ public JSONWriter(CharArr out, int indentSize) {
+ this.out = out;
+ this.indent = indentSize;
+ }
+
+ public JSONWriter(CharArr out) {
+ this(out, 2);
+ }
+
+ public void setIndentSize(int indentSize) {
+ this.indent = indentSize;
+ }
+
+ public void indent() {
+ if (indent >= 0) {
+ out.write('\n');
+ if (indent > 0) {
+ int spaces = level*indent;
+ out.reserve(spaces);
+ for (int i=0; i<spaces; i++) {
+ out.unsafeWrite(' ');
+ }
+ }
+ }
+ }
+
+ public void write(Object o) {
+ if (o == null) {
+ writeNull();
+ } else if (o instanceof CharSequence) {
+ writeString((CharSequence)o);
+ } else if (o instanceof Number) {
+ if (o instanceof Integer || o instanceof Long) {
+ write(((Number)o).longValue());
+ } else if (o instanceof Float || o instanceof Double) {
+ write(((Number)o).doubleValue());
+ } else {
+ CharArr arr = new CharArr();
+ arr.write(o.toString());
+ writeNumber(arr);
+ }
+ } else if (o instanceof Map) {
+ write((Map)o);
+ } else if (o instanceof Collection) {
+ write((Collection)o);
+ } else if (o instanceof Object[]) {
+ write(Arrays.asList((Object[])o));
+ } else if (o instanceof Boolean) {
+ write(((Boolean)o).booleanValue());
+ } else if (o instanceof Writable) {
+ ((Writable) o).write(this);
+ }
+ else if (o instanceof int[]) {
+ write((int[])o);
+ } else if (o instanceof float[]) {
+ write((float[])o);
+ } else if (o instanceof long[]) {
+ write((long[])o);
+ } else if (o instanceof double[]) {
+ write((double[])o);
+ } else if (o instanceof short[]) {
+ write((short[])o);
+ } else if (o instanceof boolean[]) {
+ write((boolean[])o);
+ } else if (o instanceof char[]) {
+ write((char[])o);
+ } else if (o instanceof byte[]) {
+ write((byte[])o);
+ } else {
+ handleUnknownClass(o);
+ }
+ }
+
+ /** Override this method for custom handling of unknown classes. Also see the Writable interface. */
+ public void handleUnknownClass(Object o) {
+ writeString(out.toString());
+ }
+
+ public void write(Map val) {
+ startObject();
+ int sz = val.size();
+ boolean first = true;
+ for (Map.Entry entry : (Set<Map.Entry>)val.entrySet()) {
+ if (first) {
+ first = false;
+ } else {
+ writeValueSeparator();
+ }
+ if (sz>1) indent();
+ writeString(entry.getKey().toString());
+ writeNameSeparator();
+ write(entry.getValue());
+ }
+ endObject();
+ }
+
+ public void write(Collection val) {
+ startArray();
+ int sz = val.size();
+ boolean first = true;
+ for (Object o : val) {
+ if (first) {
+ first = false;
+ } else {
+ writeValueSeparator();
+ }
+ if (sz>1) indent();
+ write(o);
+ }
+ endArray();
+ }
+
+ /** A byte[] may be either a single logical value, or a list of small integers.
+ * It's up to the implementation to decide.
+ */
+ public void write(byte[] val) {
+ startArray();
+ boolean first = true;
+ for (short v : val) {
+ if (first) {
+ first = false;
+ } else {
+ writeValueSeparator();
+ }
+ write(v);
+ }
+ endArray();
+ }
+
+ public void write(short[] val) {
+ startArray();
+ boolean first = true;
+ for (short v : val) {
+ if (first) {
+ first = false;
+ } else {
+ writeValueSeparator();
+ }
+ write(v);
+ }
+ endArray();
+ }
+
+ public void write(int[] val) {
+ startArray();
+ boolean first = true;
+ for (int v : val) {
+ if (first) {
+ first = false;
+ } else {
+ writeValueSeparator();
+ }
+ write(v);
+ }
+ endArray();
+ }
+
+ public void write(long[] val) {
+ startArray();
+ boolean first = true;
+ for (long v : val) {
+ if (first) {
+ first = false;
+ } else {
+ writeValueSeparator();
+ }
+ write(v);
+ }
+ endArray();
+ }
+
+ public void write(float[] val) {
+ startArray();
+ boolean first = true;
+ for (float v : val) {
+ if (first) {
+ first = false;
+ } else {
+ writeValueSeparator();
+ }
+ write(v);
+ }
+ endArray();
+ }
+
+ public void write(double[] val) {
+ startArray();
+ boolean first = true;
+ for (double v : val) {
+ if (first) {
+ first = false;
+ } else {
+ writeValueSeparator();
+ }
+ write(v);
+ }
+ endArray();
+ }
+
+ public void write(boolean[] val) {
+ startArray();
+ boolean first = true;
+ for (boolean v : val) {
+ if (first) {
+ first = false;
+ } else {
+ writeValueSeparator();
+ }
+ write(v);
+ }
+ endArray();
+ }
+
+
+ public void write(short number) { write ((int)number); }
+ public void write(byte number) { write((int)number); }
+
+
+ public void writeNull() {
+ JSONUtil.writeNull(out);
+ }
+
+ public void writeString(CharSequence str) {
+ JSONUtil.writeString(str,0,str.length(),out);
+ }
+
+ public void writeString(CharArr str) {
+ JSONUtil.writeString(str,out);
+ }
+
+ public void writeStringStart() {
+ out.write('"');
+ }
+
+ public void writeStringChars(CharArr partialStr) {
+ JSONUtil.writeStringPart(partialStr.getArray(), partialStr.getStart(), partialStr.getEnd(), out);
+ }
+
+ public void writeStringEnd() {
+ out.write('"');
+ }
+
+ public void write(long number) {
+ JSONUtil.writeNumber(number,out);
+ }
+
+ public void write(int number) {
+ JSONUtil.writeNumber(number,out);
+ }
+
+ public void write(double number) {
+ JSONUtil.writeNumber(number,out);
+ }
+
+ public void write(float number) {
+ JSONUtil.writeNumber(number,out);
+ }
+
+ public void write(boolean bool) {
+ JSONUtil.writeBoolean(bool,out);
+ }
+
+ public void write(char[] val) {
+ JSONUtil.writeString(val, 0, val.length, out);
+ }
+
+ public void writeNumber(CharArr digits) {
+ out.write(digits);
+ }
+
+ public void writePartialNumber(CharArr digits) {
+ out.write(digits);
+ }
+
+ public void startObject() {
+ out.write('{');
+ level++;
+ }
+
+ public void endObject() {
+ out.write('}');
+ level--;
+ }
+
+ public void startArray() {
+ out.write('[');
+ level++;
+ }
+
+ public void endArray() {
+ out.write(']');
+ level--;
+ }
+
+ public void writeValueSeparator() {
+ out.write(',');
+ }
+
+ public void writeNameSeparator() {
+ out.write(':');
+ }
+
+}
+
diff --git a/solr/solrj/src/java/org/apache/noggit/ObjectBuilder.java b/solr/solrj/src/java/org/apache/noggit/ObjectBuilder.java
new file mode 100644
index 00000000000..8ba31dbc712
--- /dev/null
+++ b/solr/solrj/src/java/org/apache/noggit/ObjectBuilder.java
@@ -0,0 +1,154 @@
+/**
+ * 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.
+ */
+
+package org.apache.noggit;
+
+import java.util.*;
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+/**
+ * @author yonik
+ * @version $Id$
+ */
+public class ObjectBuilder {
+
+ public static Object fromJSON(String json) throws IOException {
+ JSONParser p = new JSONParser(json);
+ return getVal(p);
+ }
+
+ public static Object getVal(JSONParser parser) throws IOException {
+ return new ObjectBuilder(parser).getVal();
+ }
+
+ final JSONParser parser;
+
+ public ObjectBuilder(JSONParser parser) throws IOException {
+ this.parser = parser;
+ if (parser.lastEvent()==0) parser.nextEvent();
+ }
+
+
+ public Object getVal() throws IOException {
+ int ev = parser.lastEvent();
+ switch(ev) {
+ case JSONParser.STRING: return getString();
+ case JSONParser.LONG: return getLong();
+ case JSONParser.NUMBER: return getNumber();
+ case JSONParser.BIGNUMBER: return getBigNumber();
+ case JSONParser.BOOLEAN: return getBoolean();
+ case JSONParser.NULL: return getNull();
+ case JSONParser.OBJECT_START: return getObject();
+ case JSONParser.OBJECT_END: return null; // OR ERROR?
+ case JSONParser.ARRAY_START: return getArray();
+ case JSONParser.ARRAY_END: return null; // OR ERROR?
+ case JSONParser.EOF: return null; // OR ERROR?
+ default: return null; // OR ERROR?
+ }
+ }
+
+
+ public Object getString() throws IOException {
+ return parser.getString();
+ }
+
+ public Object getLong() throws IOException {
+ return Long.valueOf(parser.getLong());
+ }
+
+ public Object getNumber() throws IOException {
+ CharArr num = parser.getNumberChars();
+ String numstr = num.toString();
+ double d = Double.parseDouble(numstr);
+ if (!Double.isInfinite(d)) return Double.valueOf(d);
+ // TODO: use more efficient constructor in Java5
+ return new BigDecimal(numstr);
+ }
+
+ public Object getBigNumber() throws IOException {
+ CharArr num = parser.getNumberChars();
+ String numstr = num.toString();
+ for(int ch; (ch=num.read())!=-1;) {
+ if (ch=='.' || ch=='e' || ch=='E') return new BigDecimal(numstr);
+ }
+ return new BigInteger(numstr);
+ }
+
+ public Object getBoolean() throws IOException {
+ return parser.getBoolean();
+ }
+
+ public Object getNull() throws IOException {
+ parser.getNull();
+ return null;
+ }
+
+ public Object newObject() throws IOException {
+ return new LinkedHashMap();
+ }
+
+ public Object getKey() throws IOException {
+ return parser.getString();
+ }
+
+ public void addKeyVal(Object map, Object key, Object val) throws IOException {
+ Object prev = ((Map)map).put(key,val);
+ // TODO: test for repeated value?
+ }
+
+ public Object objectEnd(Object obj) {
+ return obj;
+ }
+
+
+ public Object getObject() throws IOException {
+ Object m = newObject();
+ for(;;) {
+ int ev = parser.nextEvent();
+ if (ev==JSONParser.OBJECT_END) return objectEnd(m);
+ Object key = getKey();
+ ev = parser.nextEvent();
+ Object val = getVal();
+ addKeyVal(m, key, val);
+ }
+ }
+
+ public Object newArray() {
+ return new ArrayList();
+ }
+
+ public void addArrayVal(Object arr, Object val) throws IOException {
+ ((List)arr).add(val);
+ }
+
+ public Object endArray(Object arr) {
+ return arr;
+ }
+
+ public Object getArray() throws IOException {
+ Object arr = newArray();
+ for(;;) {
+ int ev = parser.nextEvent();
+ if (ev==JSONParser.ARRAY_END) return endArray(arr);
+ Object val = getVal();
+ addArrayVal(arr, val);
+ }
+ }
+
+}
diff --git a/solr/test-framework/build.xml b/solr/test-framework/build.xml
index 069a8d7c171..bcf1da138c2 100644
--- a/solr/test-framework/build.xml
+++ b/solr/test-framework/build.xml
@@ -42,7 +42,7 @@
<!-- Override common-solr.javadocs to include a JUnit javadoc link -->
<!-- and to copy the built javadocs to ${dest}/docs/api/test-framework -->
<target name="javadocs"
- depends="compile-core,lucene-javadocs-all,define-lucene-javadoc-url">
+ depends="compile-core,define-lucene-javadoc-url">
<sequential>
<mkdir dir="${javadoc.dir}"/>
<mkdir dir="${dest}/META-INF/"/>
diff --git a/solr/test-framework/ivy.xml b/solr/test-framework/ivy.xml
new file mode 100644
index 00000000000..812984d0175
--- /dev/null
+++ b/solr/test-framework/ivy.xml
@@ -0,0 +1,21 @@
+<!--
+ 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="2.0">
+ <info organisation="org.apache.solr" module="core-test-framework"/>
+</ivy-module>
diff --git a/solr/webapp/build.xml b/solr/webapp/build.xml
index 6d2eeb3a87a..d34db9e4fd9 100644
--- a/solr/webapp/build.xml
+++ b/solr/webapp/build.xml
@@ -27,6 +27,16 @@
<!-- no more JSP -->
</target>
+ <!-- this module has no javadocs -->
+ <target name="javadocs"/>
+
+ <!-- this module has no jar either -->
+ <target name="jar-core"/>
+
+ <!-- nothing to compile -->
+ <target name="compile-core"/>
+ <target name="compile-test"/>
+
<target name="dist"
description="Creates the Solr WAR Distribution file."
depends="test, init-dist, dist-core, dist-solrj, lucene-jars-to-solr">