Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-2452: Merged up to trunk r1126232; adjusted solr/config/analysis-extras/ directory structure to match other solr contribs; updated configuration for maven and intellij idea.

Steven Rowe674feedec605
diff --cc dev-tools/idea/.idea/ant.xml
index b5c457676a8,c50e9505405..7182ebc2be3
--- a/dev-tools/idea/.idea/ant.xml
+++ b/dev-tools/idea/.idea/ant.xml
@@@ -30,6 -31,6 +31,7 @@@
<buildFile url="file://$PROJECT_DIR$/solr/contrib/analysis-extras/build.xml" />
<buildFile url="file://$PROJECT_DIR$/solr/contrib/clustering/build.xml" />
<buildFile url="file://$PROJECT_DIR$/solr/contrib/dataimporthandler/build.xml" />
++ <buildFile url="file://$PROJECT_DIR$/solr/contrib/dataimporthandler-extras/build.xml" />
<buildFile url="file://$PROJECT_DIR$/solr/contrib/extraction/build.xml" />
<buildFile url="file://$PROJECT_DIR$/solr/contrib/uima/build.xml" />
</component>
diff --cc dev-tools/idea/.idea/modules.xml
index ecd7c276c37,1618e1c9a87..998299e4597
--- a/dev-tools/idea/.idea/modules.xml
+++ b/dev-tools/idea/.idea/modules.xml
@@@ -30,7 -31,7 +31,7 @@@
<module filepath="$PROJECT_DIR$/solr/contrib/analysis-extras/analysis-extras.iml" />
<module filepath="$PROJECT_DIR$/solr/contrib/clustering/clustering.iml" />
<module filepath="$PROJECT_DIR$/solr/contrib/dataimporthandler/dataimporthandler.iml" />
-- <module filepath="$PROJECT_DIR$/solr/contrib/dataimporthandler/src/extras/extras.iml" />
++ <module filepath="$PROJECT_DIR$/solr/contrib/dataimporthandler-extras/dataimporthandler-extras.iml" />
<module filepath="$PROJECT_DIR$/solr/contrib/extraction/extraction.iml" />
<module filepath="$PROJECT_DIR$/solr/contrib/uima/uima.iml" />
</modules>
diff --cc dev-tools/idea/.idea/workspace.xml
index 150a2334ca6,28288b3deff..2a7a38b0741
--- a/dev-tools/idea/.idea/workspace.xml
+++ b/dev-tools/idea/.idea/workspace.xml
@@@ -4,7 -4,7 +4,7 @@@
<configuration default="false" name="analysis-extras contrib" type="JUnit" factoryName="JUnit">
<module name="analysis-extras" />
<option name="TEST_OBJECT" value="package" />
-- <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/solr/contrib/analysis-extras/build" />
++ <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/solr/build/contrib/analysis-extras" />
<option name="VM_PARAMETERS" value="-ea -Dtests.luceneMatchVersion=4.0 -DtempDir=temp" />
<option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option>
</configuration>
@@@ -39,7 -39,7 +39,7 @@@
<configuration default="false" name="clustering contrib" type="JUnit" factoryName="JUnit">
<module name="clustering" />
<option name="TEST_OBJECT" value="package" />
-- <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/solr/contrib/clustering/build" />
++ <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/solr/build/contrib/clustering" />
<option name="VM_PARAMETERS" value="-ea -Dtests.luceneMatchVersion=4.0 -DtempDir=temp" />
<option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option>
</configuration>
@@@ -53,14 -53,21 +53,21 @@@
<configuration default="false" name="dataimporthandler contrib" type="JUnit" factoryName="JUnit">
<module name="dataimporthandler" />
<option name="TEST_OBJECT" value="package" />
-- <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/solr/contrib/dataimporthandler/target" />
++ <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/solr/build/contrib/dataimporthandler" />
+ <option name="VM_PARAMETERS" value="-ea -DtempDir=temp" />
+ <option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option>
+ </configuration>
- <configuration default="false" name="extraction contrib" type="JUnit" factoryName="JUnit">
- <module name="extraction" />
++ <configuration default="false" name="dataimporthandler-extras contrib" type="JUnit" factoryName="JUnit">
++ <module name="dataimporthandler-extras" />
+ <option name="TEST_OBJECT" value="package" />
- <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/solr/contrib/extraction/build" />
++ <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/solr/build/contrib/dataimporthandler-extras" />
<option name="VM_PARAMETERS" value="-ea -DtempDir=temp" />
<option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option>
</configuration>
- <configuration default="false" name="extras from dataimporthandler contrib" type="JUnit" factoryName="JUnit">
- <module name="extras" />
+ <configuration default="false" name="extraction contrib" type="JUnit" factoryName="JUnit">
+ <module name="extraction" />
<option name="TEST_OBJECT" value="package" />
- <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/solr/contrib/extraction/build" />
- <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/solr/contrib/dataimporthandler/target/extras" />
++ <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/solr/build/contrib/extraction" />
<option name="VM_PARAMETERS" value="-ea -DtempDir=temp" />
<option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option>
</configuration>
@@@ -186,7 -193,7 +193,7 @@@
<configuration default="false" name="uima contrib" type="JUnit" factoryName="JUnit">
<module name="uima" />
<option name="TEST_OBJECT" value="package" />
-- <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/solr/contrib/uima/build" />
++ <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/solr/build/contrib/uima" />
<option name="VM_PARAMETERS" value="-ea -Dtests.luceneMatchVersion=4.0 -DtempDir=temp" />
<option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option>
</configuration>
@@@ -213,27 -220,28 +220,28 @@@
<item index="5" class="java.lang.String" itemvalue="JUnit.clustering contrib" />
<item index="6" class="java.lang.String" itemvalue="JUnit.common analysis module" />
<item index="7" class="java.lang.String" itemvalue="JUnit.dataimporthandler contrib" />
-- <item index="8" class="java.lang.String" itemvalue="JUnit.extraction contrib" />
-- <item index="9" class="java.lang.String" itemvalue="JUnit.extras from dataimporthandler contrib" />
- <item index="10" class="java.lang.String" itemvalue="JUnit.highlighter contrib" />
- <item index="11" class="java.lang.String" itemvalue="JUnit.icu analysis module" />
- <item index="12" class="java.lang.String" itemvalue="JUnit.instantiated contrib" />
- <item index="13" class="java.lang.String" itemvalue="JUnit.lucene" />
- <item index="14" class="java.lang.String" itemvalue="JUnit.lucli contrib" />
- <item index="15" class="java.lang.String" itemvalue="JUnit.memory contrib" />
- <item index="16" class="java.lang.String" itemvalue="JUnit.misc contrib" />
- <item index="17" class="java.lang.String" itemvalue="JUnit.phonetic analysis module" />
- <item index="18" class="java.lang.String" itemvalue="JUnit.queries contrib" />
- <item index="19" class="java.lang.String" itemvalue="JUnit.queryparser contrib" />
- <item index="20" class="java.lang.String" itemvalue="JUnit.smartcn analysis module" />
- <item index="21" class="java.lang.String" itemvalue="JUnit.solr" />
- <item index="22" class="java.lang.String" itemvalue="JUnit.spatial contrib" />
- <item index="23" class="java.lang.String" itemvalue="JUnit.spellchecker contrib" />
- <item index="24" class="java.lang.String" itemvalue="JUnit.stempel analysis module" />
- <item index="25" class="java.lang.String" itemvalue="JUnit.swing contrib" />
- <item index="26" class="java.lang.String" itemvalue="JUnit.uima contrib" />
- <item index="27" class="java.lang.String" itemvalue="JUnit.wordnet contrib" />
- <item index="28" class="java.lang.String" itemvalue="JUnit.xml-query-parser contrib" />
++ <item index="8" class="java.lang.String" itemvalue="JUnit.dataimporthandler-extras contrib" />
++ <item index="9" class="java.lang.String" itemvalue="JUnit.extraction contrib" />
+ <item index="10" class="java.lang.String" itemvalue="JUnit.grouping module" />
+ <item index="11" class="java.lang.String" itemvalue="JUnit.highlighter contrib" />
+ <item index="12" class="java.lang.String" itemvalue="JUnit.icu analysis module" />
+ <item index="13" class="java.lang.String" itemvalue="JUnit.instantiated contrib" />
+ <item index="14" class="java.lang.String" itemvalue="JUnit.lucene" />
+ <item index="15" class="java.lang.String" itemvalue="JUnit.lucli contrib" />
+ <item index="16" class="java.lang.String" itemvalue="JUnit.memory contrib" />
+ <item index="17" class="java.lang.String" itemvalue="JUnit.misc contrib" />
+ <item index="18" class="java.lang.String" itemvalue="JUnit.phonetic analysis module" />
+ <item index="19" class="java.lang.String" itemvalue="JUnit.queries contrib" />
+ <item index="20" class="java.lang.String" itemvalue="JUnit.queryparser contrib" />
+ <item index="21" class="java.lang.String" itemvalue="JUnit.smartcn analysis module" />
+ <item index="22" class="java.lang.String" itemvalue="JUnit.solr" />
+ <item index="23" class="java.lang.String" itemvalue="JUnit.spatial contrib" />
+ <item index="24" class="java.lang.String" itemvalue="JUnit.spellchecker contrib" />
+ <item index="25" class="java.lang.String" itemvalue="JUnit.stempel analysis module" />
+ <item index="26" class="java.lang.String" itemvalue="JUnit.swing contrib" />
+ <item index="27" class="java.lang.String" itemvalue="JUnit.uima contrib" />
+ <item index="28" class="java.lang.String" itemvalue="JUnit.wordnet contrib" />
+ <item index="29" class="java.lang.String" itemvalue="JUnit.xml-query-parser contrib" />
</list>
</component>
</project>
diff --cc dev-tools/idea/modules/grouping/grouping.iml
index 00000000000,50cb2814087..bbd6eabbd4e
mode 000000,100644..100644
--- a/dev-tools/idea/modules/grouping/grouping.iml
+++ b/dev-tools/idea/modules/grouping/grouping.iml
@@@ -1,0 -1,17 +1,16 @@@
+ <?xml version="1.0" encoding="UTF-8"?>
+ <module type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/build/classes/java" />
+ <output-test url="file://$MODULE_DIR$/build/classes/test" />
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
- <excludeFolder url="file://$MODULE_DIR$/work" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" scope="TEST" name="JUnit" level="project" />
+ <orderEntry type="module" module-name="lucene" />
+ </component>
+ </module>
diff --cc dev-tools/idea/solr/contrib/analysis-extras/analysis-extras.iml
index 0cdc269bcd3,0861ae2bace..12ddaa64be3
--- a/dev-tools/idea/solr/contrib/analysis-extras/analysis-extras.iml
+++ b/dev-tools/idea/solr/contrib/analysis-extras/analysis-extras.iml
@@@ -1,21 -1,15 +1,13 @@@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
-- <output url="file://$MODULE_DIR$/build/classes" />
-- <output-test url="file://$MODULE_DIR$/build/test-classes" />
++ <output url="file://$MODULE_DIR$/../../build/contrib/analysis-extras/classes" />
++ <output-test url="file://$MODULE_DIR$/../../build/contrib/analysis-extras/test-classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
-- <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
-- <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
-- <excludeFolder url="file://$MODULE_DIR$/build" />
-- <excludeFolder url="file://$MODULE_DIR$/lucene-libs" />
++ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
++ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
</content>
- <orderEntry type="module" module-name="common" />
- <orderEntry type="module" module-name="icu" />
- <orderEntry type="module" module-name="lucene" />
- <orderEntry type="module" module-name="smartcn" />
- <orderEntry type="module" module-name="solr" />
- <orderEntry type="module" module-name="stempel" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
diff --cc dev-tools/idea/solr/contrib/clustering/clustering.iml
index aa2c18fed22,6f9e756d218..5f641fbfa69
--- a/dev-tools/idea/solr/contrib/clustering/clustering.iml
+++ b/dev-tools/idea/solr/contrib/clustering/clustering.iml
@@@ -1,25 -1,15 +1,14 @@@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
-- <output url="file://$MODULE_DIR$/build/classes" />
-- <output-test url="file://$MODULE_DIR$/build/test-classes" />
++ <output url="file://$MODULE_DIR$/../../build/contrib/clustering/classes" />
++ <output-test url="file://$MODULE_DIR$/../../build/contrib/clustering/test-classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
-- <excludeFolder url="file://$MODULE_DIR$/build" />
</content>
- <orderEntry type="module" module-name="common" />
- <orderEntry type="module" module-name="highlighter" />
- <orderEntry type="module" module-name="lucene" />
- <orderEntry type="module" module-name="memory" />
- <orderEntry type="module" module-name="misc" />
- <orderEntry type="module" module-name="phonetic" />
- <orderEntry type="module" module-name="queries" />
- <orderEntry type="module" module-name="solr" />
- <orderEntry type="module" module-name="spatial" />
- <orderEntry type="module" module-name="spellchecker" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
diff --cc dev-tools/idea/solr/contrib/dataimporthandler-extras/dataimporthandler-extras.iml
index 7e6986bb709,7f35a8a24cd..738d131ec14
--- a/dev-tools/idea/solr/contrib/dataimporthandler-extras/dataimporthandler-extras.iml
+++ b/dev-tools/idea/solr/contrib/dataimporthandler-extras/dataimporthandler-extras.iml
@@@ -1,17 -1,14 +1,14 @@@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
-- <output url="file://$MODULE_DIR$/../../target/extras/classes" />
-- <output-test url="file://$MODULE_DIR$/../../target/extras/test-classes" />
++ <output url="file://$MODULE_DIR$/../../build/contrib/dataimporthandler-extras/classes" />
++ <output-test url="file://$MODULE_DIR$/../../build/contrib/dataimporthandler-extras/test-classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
-- <sourceFolder url="file://$MODULE_DIR$/main/java" isTestSource="false" />
-- <sourceFolder url="file://$MODULE_DIR$/test/java" isTestSource="true" />
-- <sourceFolder url="file://$MODULE_DIR$/test/resources" isTestSource="true" />
++ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
++ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
++ <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" />
</content>
- <orderEntry type="module" module-name="solr" />
- <orderEntry type="module" module-name="dataimporthandler" />
- <orderEntry type="module" module-name="lucene" scope="TEST" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Solr library" level="project" />
diff --cc dev-tools/idea/solr/contrib/dataimporthandler/dataimporthandler.iml
index 49652d0cdee,220ad8ceabd..3570c183627
--- a/dev-tools/idea/solr/contrib/dataimporthandler/dataimporthandler.iml
+++ b/dev-tools/idea/solr/contrib/dataimporthandler/dataimporthandler.iml
@@@ -1,19 -1,16 +1,15 @@@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
-- <output url="file://$MODULE_DIR$/target/classes" />
-- <output-test url="file://$MODULE_DIR$/target/test-classes" />
++ <output url="file://$MODULE_DIR$/../../build/contrib/dataimporthandler/classes" />
++ <output-test url="file://$MODULE_DIR$/../../build/contrib/dataimporthandler/test-classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/webapp" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" />
-- <excludeFolder url="file://$MODULE_DIR$/target" />
</content>
- <orderEntry type="module" module-name="common" />
- <orderEntry type="module" module-name="lucene" />
- <orderEntry type="module" module-name="solr" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Solr library" level="project" />
diff --cc dev-tools/idea/solr/contrib/extraction/extraction.iml
index 32bda9774b2,e5493a86550..46f38c45ee4
--- a/dev-tools/idea/solr/contrib/extraction/extraction.iml
+++ b/dev-tools/idea/solr/contrib/extraction/extraction.iml
@@@ -1,17 -1,15 +1,14 @@@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
-- <output url="file://$MODULE_DIR$/build/classes" />
-- <output-test url="file://$MODULE_DIR$/build/test-classes" />
++ <output url="file://$MODULE_DIR$/../../build/contrib/extraction/classes" />
++ <output-test url="file://$MODULE_DIR$/../../build/contrib/extraction/test-classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
-- <excludeFolder url="file://$MODULE_DIR$/build" />
</content>
- <orderEntry type="module" module-name="solr" />
- <orderEntry type="module" module-name="lucene" scope="TEST" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Solr library" level="project" />
diff --cc dev-tools/idea/solr/contrib/uima/uima.iml
index b1aafa79912,099f6f614c8..b0a3c422dc8
--- a/dev-tools/idea/solr/contrib/uima/uima.iml
+++ b/dev-tools/idea/solr/contrib/uima/uima.iml
@@@ -1,18 -1,16 +1,15 @@@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
-- <output url="file://$MODULE_DIR$/build/classes" />
-- <output-test url="file://$MODULE_DIR$/build/test-classes" />
++ <output url="file://$MODULE_DIR$/../../build/contrib/uima/classes" />
++ <output-test url="file://$MODULE_DIR$/../../build/contrib/uima/test-classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
-- <excludeFolder url="file://$MODULE_DIR$/build" />
</content>
- <orderEntry type="module" module-name="solr" />
- <orderEntry type="module" module-name="lucene" scope="TEST" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Solr library" level="project" />
diff --cc dev-tools/idea/solr/solr.iml
index 0a45dd1db1d,6d1951d9a7d..7db90d00a04
--- a/dev-tools/idea/solr/solr.iml
+++ b/dev-tools/idea/solr/solr.iml
@@@ -12,14 -12,18 +12,17 @@@
<sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test-files" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test-framework" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/dist" />
-- <excludeFolder url="file://$MODULE_DIR$/lucene-libs" />
<excludeFolder url="file://$MODULE_DIR$/package" />
</content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Solr library" level="project" />
+ <orderEntry type="library" name="Solr example library" level="project" />
<orderEntry type="module" module-name="spatial" />
<orderEntry type="module" module-name="highlighter" />
- <orderEntry type="module" module-name="common" />
<orderEntry type="module" module-name="icu" />
<orderEntry type="module" module-name="queries" />
<orderEntry type="module" module-name="misc" />
diff --cc dev-tools/maven/solr/contrib/analysis-extras/pom.xml.template
index 4ecff9241ff,59b0d0acf7e..a8084384c3d
--- a/dev-tools/maven/solr/contrib/analysis-extras/pom.xml.template
+++ b/dev-tools/maven/solr/contrib/analysis-extras/pom.xml.template
@@@ -33,7 -33,7 +33,7 @@@
<description>Apache Solr Analysis Extras</description>
<properties>
<module-directory>solr/contrib/analysis-extras</module-directory>
-- <build-directory>build</build-directory>
++ <build-directory>../../build/contrib/analysis-extras</build-directory>
<tests.luceneMatchVersion>4.0</tests.luceneMatchVersion>
</properties>
<dependencies>
@@@ -95,8 -94,8 +94,8 @@@
<directory>${build-directory}</directory>
<outputDirectory>${build-directory}/classes</outputDirectory>
<testOutputDirectory>${build-directory}/test-classes</testOutputDirectory>
-- <sourceDirectory>src/java</sourceDirectory>
-- <testSourceDirectory>src/test</testSourceDirectory>
++ <sourceDirectory>src/main/java</sourceDirectory>
++ <testSourceDirectory>src/test/java</testSourceDirectory>
<testResources>
<testResource>
<directory>src/test-files</directory>
diff --cc dev-tools/maven/solr/contrib/clustering/pom.xml.template
index 8a10434de47,fd205c1ea57..1c032ebd541
--- a/dev-tools/maven/solr/contrib/clustering/pom.xml.template
+++ b/dev-tools/maven/solr/contrib/clustering/pom.xml.template
@@@ -33,7 -33,7 +33,7 @@@
<description>Apache Solr Clustering</description>
<properties>
<module-directory>solr/contrib/clustering</module-directory>
-- <build-directory>build</build-directory>
++ <build-directory>../../build/contrib/clustering</build-directory>
<tests.luceneMatchVersion>4.0</tests.luceneMatchVersion>
</properties>
<dependencies>
diff --cc dev-tools/maven/solr/contrib/dataimporthandler-extras/pom.xml.template
index 20de6cbf843,9c08baab4f1..ca2621d97ce
--- a/dev-tools/maven/solr/contrib/dataimporthandler-extras/pom.xml.template
+++ b/dev-tools/maven/solr/contrib/dataimporthandler-extras/pom.xml.template
@@@ -24,7 -24,7 +24,7 @@@
<groupId>org.apache.solr</groupId>
<artifactId>solr-parent</artifactId>
<version>@version@</version>
-- <relativePath>../../../../pom.xml</relativePath>
++ <relativePath>../../pom.xml</relativePath>
</parent>
<groupId>org.apache.solr</groupId>
<artifactId>solr-dataimporthandler-extras</artifactId>
@@@ -32,8 -32,8 +32,8 @@@
<name>Apache Solr DataImportHandler Extras</name>
<description>Apache Solr DataImportHandler Extras</description>
<properties>
-- <module-directory>solr/contrib/dataimporthandler/src/extras</module-directory>
-- <build-directory>../../target/extras</build-directory>
++ <module-directory>solr/contrib/dataimporthandler-extras</module-directory>
++ <build-directory>../../build/contrib/dataimporthandler-extras</build-directory>
<tests.luceneMatchVersion>4.0</tests.luceneMatchVersion>
</properties>
<dependencies>
@@@ -104,16 -103,16 +103,16 @@@
</dependencies>
<build>
<directory>${build-directory}</directory>
- <outputDirectory>${build-directory}/extras/classes</outputDirectory>
- <testOutputDirectory>${build-directory}/extras/test-classes</testOutputDirectory>
- <sourceDirectory>main/java</sourceDirectory>
- <testSourceDirectory>test/java</testSourceDirectory>
+ <outputDirectory>${build-directory}/classes</outputDirectory>
+ <testOutputDirectory>${build-directory}/test-classes</testOutputDirectory>
- <sourceDirectory>main/java</sourceDirectory>
- <testSourceDirectory>test/java</testSourceDirectory>
++ <sourceDirectory>src/main/java</sourceDirectory>
++ <testSourceDirectory>src/test/java</testSourceDirectory>
<testResources>
<testResource>
-- <directory>test/resources</directory>
++ <directory>src/test/resources</directory>
</testResource>
<testResource>
-- <directory>../../../../src/test-files</directory>
++ <directory>../../src/test-files</directory>
</testResource>
</testResources>
<plugins>
@@@ -122,7 -121,7 +121,7 @@@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
-- <java.util.logging.config.file>../../../../../../testlogging.properties</java.util.logging.config.file>
++ <java.util.logging.config.file>../../../../testlogging.properties</java.util.logging.config.file>
</systemPropertyVariables>
</configuration>
</plugin>
diff --cc dev-tools/maven/solr/contrib/dataimporthandler/pom.xml.template
index 72b5a1ccb0a,72b5a1ccb0a..d5560729c24
--- a/dev-tools/maven/solr/contrib/dataimporthandler/pom.xml.template
+++ b/dev-tools/maven/solr/contrib/dataimporthandler/pom.xml.template
@@@ -27,22 -27,22 +27,110 @@@
<relativePath>../../pom.xml</relativePath>
</parent>
<groupId>org.apache.solr</groupId>
-- <artifactId>solr-dataimporthandler-aggregator</artifactId>
-- <packaging>pom</packaging>
-- <name>Apache Solr DataImportHandler aggregator POM</name>
-- <description>Apache Solr DataImportHandler aggregator POM</description>
-- <modules>
-- <module>src</module>
-- <module>src/extras</module>
-- </modules>
++ <artifactId>solr-dataimporthandler</artifactId>
++ <packaging>jar</packaging>
++ <name>Apache Solr DataImportHandler</name>
++ <description>Apache Solr DataImportHandler</description>
++ <properties>
++ <module-directory>solr/contrib/dataimporthandler</module-directory>
++ <build-directory>../../build/contrib/dataimporthandler</build-directory>
++ <tests.luceneMatchVersion>4.0</tests.luceneMatchVersion>
++ </properties>
++ <dependencies>
++ <dependency>
++ <groupId>${project.groupId}</groupId>
++ <artifactId>solr-core</artifactId>
++ <version>${project.version}</version>
++ </dependency>
++ <dependency>
++ <groupId>org.apache.solr</groupId>
++ <artifactId>solr-test-framework</artifactId>
++ <version>${project.version}</version>
++ <scope>test</scope>
++ </dependency>
++ <dependency>
++ <groupId>${project.groupId}</groupId>
++ <artifactId>solr-solrj</artifactId>
++ <version>${project.version}</version>
++ </dependency>
++ <dependency>
++ <groupId>org.apache.lucene</groupId>
++ <artifactId>lucene-analyzers-common</artifactId>
++ <version>${project.version}</version>
++ </dependency>
++ <dependency>
++ <groupId>org.apache.lucene</groupId>
++ <artifactId>lucene-test-framework</artifactId>
++ <version>${project.version}</version>
++ <scope>test</scope>
++ </dependency>
++ <dependency>
++ <groupId>javax.servlet</groupId>
++ <artifactId>servlet-api</artifactId>
++ <scope>provided</scope>
++ </dependency>
++ <dependency>
++ <groupId>commons-io</groupId>
++ <artifactId>commons-io</artifactId>
++ </dependency>
++ <dependency>
++ <groupId>org.slf4j</groupId>
++ <artifactId>slf4j-api</artifactId>
++ </dependency>
++ <dependency>
++ <groupId>junit</groupId>
++ <artifactId>junit</artifactId>
++ <scope>test</scope>
++ </dependency>
++ <dependency>
++ <groupId>org.easymock</groupId>
++ <artifactId>easymock</artifactId>
++ <scope>test</scope>
++ </dependency>
++ <dependency>
++ <groupId>org.mortbay.jetty</groupId>
++ <artifactId>jetty</artifactId>
++ <scope>test</scope>
++ </dependency>
++ <dependency>
++ <groupId>org.mortbay.jetty</groupId>
++ <artifactId>jetty-util</artifactId>
++ <scope>test</scope>
++ </dependency>
++ </dependencies>
<build>
-- <directory>target/solr-dataimporthandler-aggregator</directory>
++ <directory>${build-directory}</directory>
++ <outputDirectory>${build-directory}/classes</outputDirectory>
++ <testOutputDirectory>${build-directory}/test-classes</testOutputDirectory>
++ <sourceDirectory>src/main/java</sourceDirectory>
++ <testSourceDirectory>src/test/java</testSourceDirectory>
++ <testResources>
++ <testResource>
++ <directory>src/test/resources</directory>
++ </testResource>
++ <testResource>
++ <directory>../../src/test-files</directory>
++ </testResource>
++ </testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
-- <artifactId>maven-deploy-plugin</artifactId>
++ <artifactId>maven-jar-plugin</artifactId>
++ <executions>
++ <execution>
++ <goals>
++ <goal>test-jar</goal>
++ </goals>
++ </execution>
++ </executions>
++ </plugin>
++ <plugin>
++ <groupId>org.apache.maven.plugins</groupId>
++ <artifactId>maven-surefire-plugin</artifactId>
<configuration>
-- <skip>true</skip>
++ <systemPropertyVariables>
++ <java.util.logging.config.file>../../../../testlogging.properties</java.util.logging.config.file>
++ </systemPropertyVariables>
</configuration>
</plugin>
</plugins>
diff --cc dev-tools/maven/solr/contrib/dataimporthandler/src/pom.xml.template
index ba247a354b2,9241a01c980..00000000000
deleted file mode 100644,100644
--- a/dev-tools/maven/solr/contrib/dataimporthandler/src/pom.xml.template
+++ /dev/null
@@@ -1,143 -1,138 +1,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.
-- -->
-- <modelVersion>4.0.0</modelVersion>
-- <parent>
-- <groupId>org.apache.solr</groupId>
-- <artifactId>solr-parent</artifactId>
-- <version>@version@</version>
-- <relativePath>../../../pom.xml</relativePath>
-- </parent>
-- <groupId>org.apache.solr</groupId>
-- <artifactId>solr-dataimporthandler</artifactId>
-- <packaging>jar</packaging>
-- <name>Apache Solr DataImportHandler</name>
-- <description>Apache Solr DataImportHandler</description>
-- <properties>
-- <module-directory>solr/contrib/dataimporthandler</module-directory>
-- <build-directory>../target</build-directory>
-- <tests.luceneMatchVersion>4.0</tests.luceneMatchVersion>
-- </properties>
-- <dependencies>
-- <dependency>
-- <groupId>${project.groupId}</groupId>
-- <artifactId>solr-core</artifactId>
-- <version>${project.version}</version>
-- </dependency>
-- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>solr-core</artifactId>
- <groupId>org.apache.solr</groupId>
- <artifactId>solr-test-framework</artifactId>
-- <version>${project.version}</version>
- <type>test-jar</type>
-- <scope>test</scope>
-- </dependency>
-- <dependency>
-- <groupId>${project.groupId}</groupId>
-- <artifactId>solr-solrj</artifactId>
-- <version>${project.version}</version>
-- </dependency>
-- <dependency>
-- <groupId>org.apache.lucene</groupId>
-- <artifactId>lucene-analyzers-common</artifactId>
-- <version>${project.version}</version>
-- </dependency>
-- <dependency>
-- <groupId>org.apache.lucene</groupId>
-- <artifactId>lucene-test-framework</artifactId>
-- <version>${project.version}</version>
-- <scope>test</scope>
-- </dependency>
-- <dependency>
-- <groupId>javax.servlet</groupId>
-- <artifactId>servlet-api</artifactId>
-- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-stax-api_1.0_spec</artifactId>
-- </dependency>
-- <dependency>
-- <groupId>commons-io</groupId>
-- <artifactId>commons-io</artifactId>
-- </dependency>
-- <dependency>
-- <groupId>org.slf4j</groupId>
-- <artifactId>slf4j-api</artifactId>
-- </dependency>
-- <dependency>
-- <groupId>junit</groupId>
-- <artifactId>junit</artifactId>
-- <scope>test</scope>
-- </dependency>
-- <dependency>
-- <groupId>org.easymock</groupId>
-- <artifactId>easymock</artifactId>
-- <scope>test</scope>
-- </dependency>
-- <dependency>
-- <groupId>org.mortbay.jetty</groupId>
-- <artifactId>jetty</artifactId>
-- <scope>test</scope>
-- </dependency>
-- <dependency>
-- <groupId>org.mortbay.jetty</groupId>
-- <artifactId>jetty-util</artifactId>
-- <scope>test</scope>
-- </dependency>
-- </dependencies>
-- <build>
-- <directory>${build-directory}</directory>
-- <outputDirectory>${build-directory}/classes</outputDirectory>
-- <testOutputDirectory>${build-directory}/test-classes</testOutputDirectory>
-- <sourceDirectory>main/java</sourceDirectory>
-- <testSourceDirectory>test/java</testSourceDirectory>
-- <testResources>
-- <testResource>
-- <directory>test/resources</directory>
-- </testResource>
-- <testResource>
-- <directory>../../../src/test-files</directory>
-- </testResource>
-- </testResources>
-- <plugins>
-- <plugin>
-- <groupId>org.apache.maven.plugins</groupId>
-- <artifactId>maven-jar-plugin</artifactId>
-- <executions>
-- <execution>
-- <goals>
-- <goal>test-jar</goal>
-- </goals>
-- </execution>
-- </executions>
-- </plugin>
-- <plugin>
-- <groupId>org.apache.maven.plugins</groupId>
-- <artifactId>maven-surefire-plugin</artifactId>
-- <configuration>
-- <systemPropertyVariables>
-- <java.util.logging.config.file>../../../../../testlogging.properties</java.util.logging.config.file>
-- </systemPropertyVariables>
-- </configuration>
-- </plugin>
-- </plugins>
-- </build>
--</project>
diff --cc dev-tools/maven/solr/contrib/extraction/pom.xml.template
index e1a2581ff17,da012e5c8cd..e487d6ca5e1
--- a/dev-tools/maven/solr/contrib/extraction/pom.xml.template
+++ b/dev-tools/maven/solr/contrib/extraction/pom.xml.template
@@@ -36,7 -36,7 +36,7 @@@
</description>
<properties>
<module-directory>solr/contrib/extraction</module-directory>
-- <build-directory>build</build-directory>
++ <build-directory>../../build/contrib/extraction</build-directory>
<tests.luceneMatchVersion>4.0</tests.luceneMatchVersion>
</properties>
<dependencies>
diff --cc dev-tools/maven/solr/contrib/pom.xml.template
index e4a731aa6a7,e4a731aa6a7..c6d44db8d92
--- a/dev-tools/maven/solr/contrib/pom.xml.template
+++ b/dev-tools/maven/solr/contrib/pom.xml.template
@@@ -34,6 -34,6 +34,7 @@@
<module>analysis-extras</module>
<module>clustering</module>
<module>dataimporthandler</module>
++ <module>dataimporthandler-extras</module>
<module>extraction</module>
<module>uima</module>
</modules>
diff --cc dev-tools/maven/solr/contrib/uima/pom.xml.template
index 6e58ddb464d,62b8a4bad37..526703376a7
--- a/dev-tools/maven/solr/contrib/uima/pom.xml.template
+++ b/dev-tools/maven/solr/contrib/uima/pom.xml.template
@@@ -33,7 -33,7 +33,7 @@@
<description>Apache Solr - UIMA integration</description>
<properties>
<module-directory>solr/contrib/uima</module-directory>
-- <build-directory>build</build-directory>
++ <build-directory>../../build/contrib/uima</build-directory>
<tests.luceneMatchVersion>4.0</tests.luceneMatchVersion>
</properties>
<dependencies>
diff --cc solr/build.xml
index 82c1cd09094,de7ef217bee..b8f678433ed
--- a/solr/build.xml
+++ b/solr/build.xml
@@@ -16,138 -16,1171 +16,154 @@@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
+<project name="solr-core" default="usage">
+ <description>Solr</description>
-<project name="solr" default="usage" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant">
+ <property name="src.dir" location="src/java"/>
- <property name="solr-path" value="." />
-
- <import file="common-build.xml"/>
-
- <!-- 3rd party libraries for compilation -->
- <property name="lib" location="lib" />
-
- <!-- solr source files -->
- <property name="src" location="src" />
- <property name="web.xml" location="${src}/webapp/web/WEB-INF/web.xml"/>
-
- <!-- Destination for distribution files (demo WAR, contrib JARs, etc.) -->
- <property name="dist" location="dist" />
+ <!-- solr uses this as the test working directory: nocommit classpath -->
+ <property name="tests.userdir" value="src/test-files"/>
- <property name="clover.db.dir" location="${dest}/tests/clover/db"/>
- <property name="clover.report.dir" location="${dest}/tests/clover/reports"/>
-
- <available
- property="clover.present"
- classname="com.cenqua.clover.tasks.CloverReportTask"
- />
- <condition property="clover.enabled">
- <and>
- <isset property="run.clover"/>
- <isset property="clover.present"/>
- </and>
- </condition>
-
- <!-- Default target: usage. Prints out instructions. -->
- <target name="usage"
- description="Prints out instructions">
- <echo message="Welcome to the Solr project!" />
- <echo message="Use 'ant example' to create a runnable example configuration." />
- <echo message="Use 'ant run-example' to create and run the example." />
- <echo message="And for developers:"/>
- <echo message="Use 'ant clean' to clean compiled files." />
- <echo message="Use 'ant compile' to compile the source code." />
- <echo message="Use 'ant dist' to build the project WAR and JAR files." />
- <echo message="Use 'ant javadoc' to build javadoc under build/docs/api" />
- <echo message="Use 'ant generate-maven-artifacts' to generate maven artifacts." />
- <echo message="Use 'ant package' to generate zip, tgz for distribution." />
- <echo message="Use 'ant luke' to start luke. see: http://luke.googlecode.com" />
- <echo message="Use 'ant test' to run unit tests." />
- </target>
-
- <!-- Clean: cleans compiled files and other temporary artifacts. -->
- <target name="clean" depends="clean-contrib"
- description="Cleans compiled files and other temporary artifacts.">
- <delete dir="${dest}" />
- <delete dir="${dist}" />
- <delete dir="${package.dir}" />
- <delete dir="example/solr/lib" />
- <delete dir="${lucene-libs}" />
- </target>
-
- <target name="clean-dest"
- description="Cleans out ${dest} but leaves ${dist} and ${package.dir} alone. This allows us to run nightly and clover together in Hudson">
- <delete includeemptydirs="true" >
- <fileset dir="${dest}">
- <exclude name="docs/"/>
- </fileset>
- </delete>
- </target>
-
- <!-- ========================================================================= -->
- <!-- ===================== COMPILATION-RELATED TASKS ========================= -->
- <!-- ========================================================================= -->
-
- <!-- The compilation classpath -->
- <path id="compile.classpath">
- <fileset dir="${lib}">
- <include name="*.jar" />
- </fileset>
- <path refid="lucene.classpath"/>
+ <path id="additional.dependencies">
+ <fileset dir="lib" includes="**/*.jar"/>
+ <fileset dir="example/lib" includes="**/*.jar"/>
</path>
-
- <target name="compile-solrj"
- description="Compile the java client."
- depends="compile-lucene">
-
- <solr-javac destdir="${dest}/solrj"
- classpathref="compile.classpath">
- <src path="${src}/common" />
- <src path="${src}/solrj" />
- </solr-javac>
- </target>
-
-
- <!-- This depend on all of solr -->
- <path id="compile.classpath.solrj">
- <path refid="compile.classpath" />
- <pathelement location="${dest}/solrj"/>
- <!-- jetty -->
- <fileset dir="example/lib">
- <include name="**/*.jar" />
- </fileset>
- </path>
-
- <!-- Compile the project. -->
- <target name="compile"
- description="Compile the source code."
- depends="compile-solrj">
-
- <solr-javac destdir="${dest}/solr"
- classpathref="compile.classpath.solrj">
- <src path="${src}/java" />
- <src path="${src}/webapp/src" />
- </solr-javac>
- </target>
-
- <target name="javadoc-dep">
- <copy failonerror="false" todir="${build.docs}">
- <fileset dir="site" />
- </copy>
- </target>
-
- <target name="javadoc-solrj" depends="compile-solrj,javadoc-dep" description="Generates solrj javadoc documentation.">
- <sequential>
- <mkdir dir="${build.javadoc}/solrj"/>
-
- <path id="javadoc.classpath">
- <path refid="compile.classpath"/>
- </path>
-
- <invoke-javadoc
- destdir="${build.javadoc}/solrj"
- title="${Name}-j ${version} API (${specversion})">
- <sources>
- <packageset dir="${src}/common"/>
- <packageset dir="${src}/solrj"/>
- </sources>
- </invoke-javadoc>
- </sequential>
- </target>
- <target name="javadoc-core" depends="compile,javadoc-dep" description="Generates javadoc documentation for core.">
+ <import file="common-build.xml"/>
+ <!-- add some descriptions to some inherited targets -->
+ <target name="compile" description="Compile the source code."
+ depends="compile-core, build-contrib"/>
- <target name="test" description="Run core and contrib unit tests."
- depends="common.test, test-contrib"/>
++ <target name="test" description="Validate, then run core and contrib unit tests."
++ depends="validate-solr, common.test, test-contrib"/>
+ <target name="test-core" description="Runs the core unit tests."
+ depends="common.test"/>
+ <target name="compile-test" description="Compile unit tests."
+ depends="compile-test-framework, common.compile-test"/>
- <target name="javadocs" description="Generate javadocs for core, client, and contrib"
- depends="contrib-build.javadocs, javadocs-solrj, javadocs-contrib"/>
++ <target name="javadocs" description="Generate javadocs for core, client, test-framework, and contrib"
++ depends="contrib-build.javadocs, javadocs-solrj, javadocs-test-framework, javadocs-contrib"/>
+ <target name="javadocs-core" description="Generate javadocs for core."
+ depends="contrib-build.javadocs"/>
+
+ <!-- hackish we have to call init/clover here, but solr core depends upon solrj? -->
+ <target name="compile-core" depends="init, clover, compile-analyzers-common,
+ compile-analyzers-phonetic, compile-highlighter, compile-memory, compile-misc,
+ compile-queries, compile-spatial, compile-spellchecker, compile-solrj,
+ common.compile-core, compile-webapp"
+ unless="solr-core.compiled">
+ </target>
+
+ <target name="compile-webapp" depends="compile-solrj">
+ <compile srcdir="src/webapp/src"
+ destdir="${build.dir}/classes/webapp">
+ <classpath refid="classpath"/>
+ </compile>
+ </target>
+
+ <!-- TODO: factor solrj into a separate dir so its a normal module?
+ we have to reinvent wheels the way it is now -->
+
+ <target name="compile-solrj" description="Compile the java client.">
+ <compile srcdir="src/common:src/solrj"
+ destdir="${build.dir}/classes/solrj">
+ <classpath refid="classpath"/>
+ </compile>
+ </target>
+
+ <!-- hacky? -->
+ <target name="compile-test-framework" depends="compile-core">
+ <compile srcdir="src/test-framework" destdir="${build.dir}/classes/test-framework">
- <classpath refid="test.classpath"/>
++ <classpath refid="test.base.classpath"/>
+ </compile>
+ </target>
+
+ <target name="javadocs-solrj" depends="compile-solrj" description="Generates solrj javadoc documentation.">
<sequential>
- <mkdir dir="${build.javadoc}/solr"/>
-
- <path id="javadoc.classpath">
- <path refid="compile.classpath"/>
- <path refid="compile.classpath.solrj"/>
- <pathelement location="${dest}/solrj"/>
- </path>
-
+ <mkdir dir="${javadoc.dir}/solrj"/>
<invoke-javadoc
- destdir="${build.javadoc}/solr"
- title="${Name} ${version} core API (${specversion})">
+ destdir="${javadoc.dir}/solrj"
+ title="${Name}-j ${version} API (${specversion})">
<sources>
- <packageset dir="${src}/java" />
- <packageset dir="${src}/webapp/src"/>
+ <packageset dir="src/common"/>
+ <packageset dir="src/solrj"/>
</sources>
</invoke-javadoc>
</sequential>
</target>
- <target name="javadoc-test-framework" depends="compileTestFramework,javadoc-dep"
++ <target name="javadocs-test-framework" depends="compile-test-framework"
+ description="Generates javadoc documentation for the Solr test-framework.">
+ <sequential>
+ <mkdir dir="${build.javadoc}/test-framework"/>
-
+ <path id="javadoc.classpath">
- <path refid="testframework.compile.classpath"/>
++ <path refid="test.classpath"/> <!-- nocommit switch to testframework.compile.classpath -->
+ </path>
-
+ <invoke-javadoc
- destdir="${build.javadoc}/test-framework"
- title="${Name} ${version} Test Framework API (${specversion})">
++ destdir="${javadoc.dir}/test-framework"
++ title="${Name} ${version} Test Framework API (${specversion})">
+ <sources>
- <packageset dir="${src}/test-framework" />
++ <packageset dir="src/test-framework" />
+ </sources>
+ </invoke-javadoc>
+ </sequential>
+ </target>
+
- <target name="javadoc-all" depends="compile,javadoc-dep" description="Generate javadoc for core, client and contrib">
- <sequential>
- <mkdir dir="${build.javadoc}"/>
-
- <path id="javadoc.classpath">
- <path refid="compile.classpath"/>
- <path refid="compile.classpath.solrj"/>
- <fileset dir="contrib">
- <include name="**/lib/**/*.jar"/>
- <include name="**/lucene-libs/**/*.jar"/>
- <exclude name="**/analysis-extras/lib/**/*icu4j*.jar"/> <!-- extraction/lib/ has this one -->
- </fileset>
- <pathelement location="${dest}/client/solrj"/>
- </path>
-
- <invoke-javadoc destdir="${build.javadoc}">
- <sources>
- <packageset dir="${src}/common" />
- <packageset dir="${src}/solrj" />
- <packageset dir="${src}/java" />
- <packageset dir="${src}/webapp/src" />
- <packageset dir="contrib/dataimporthandler/src/main/java" />
- <packageset dir="contrib/dataimporthandler/src/extras/main/java" />
- <packageset dir="contrib/clustering/src/main/java" />
- <packageset dir="contrib/extraction/src/main/java" />
- <packageset dir="contrib/uima/src/main/java" />
- <packageset dir="contrib/analysis-extras/src/java" />
- <group title="Core" packages="org.apache.*" />
- <group title="Common" packages="org.apache.solr.common.*" />
- <group title="SolrJ" packages="org.apache.solr.client.solrj*" />
- <group title="contrib: DataImportHandler" packages="org.apache.solr.handler.dataimport*" />
- <group title="contrib: Clustering" packages="org.apache.solr.handler.clustering*" />
- <group title="contrib: Solr Cell" packages="org.apache.solr.handler.extraction*" />
- <group title="contrib: Solr UIMA" packages="org.apache.solr.uima*" />
- </sources>
- </invoke-javadoc>
- </sequential>
- </target>
-
- <target name="javadoc-contrib" description="Generate javadoc for contrib classes" depends="build-contrib,javadoc-dep">
- <contrib-crawl target="javadoc"
- failonerror="true"/>
- </target>
-
- <target name="javadoc" depends="javadoc-core, javadoc-test-framework, javadoc-contrib, javadoc-solrj, javadoc-all">
- </target>
- <target name="javadocs" depends="javadoc"/>
-
- <target name="stub-factories" depends="dist-jar"
- description="Generates stub factories as needed">
-
- <path id="stub.jars">
- <!-- this needs to be a list of all jars that might contain
- classes we want to build factories for
- -->
- <fileset dir="${lib}">
- <include name="lucene-*.jar"/>
- </fileset>
- <fileset dir="${dist}">
- <include name="*.jar"/>
- <exclude name="*solrj*.jar"/>
- </fileset>
- </path>
- <pathconvert property="jar.list" pathsep=" " refid="stub.jars" />
- <property name="stub.list" value="${dest}/need-stub-factories.txt" />
- <java fork="false"
- classname="org.apache.solr.util.SuggestMissingFactories"
- logError="true"
- failonerror="true"
- classpathref="test.run.classpath"
- output="${stub.list}">
- <arg line="${jar.list}" />
- </java>
- <fail unless="stub.src.path">...
-
- This task requires that the property 'stub.src.path' be set.
-
- It must contain a "path" listing directories containing source
- files that this task should use when looking for classes that
- need factories created, the format is platform specific --
- typically it is colon seperated in Unix, semi-colon seperated
- on windows, ie:
-
- ant stub-factories -Dstub.src.path="./src:../lucene/contrib:../lucene/src/java"
-
- FYI: The file ${stub.list} contains a list of classes
- that seem to need stub factories. (if java files can be found to
- use as guides for creating them).
- </fail>
-
- <pathconvert pathsep=" " property="stub.src.dirs">
- <path>
- <pathelement path="${stub.src.path}"/>
- </path>
- </pathconvert>
- <exec executable="${basedir}/src/dev-tools/stub-analysis-factory-maker.pl"
- dir="src/java/org/apache/solr/analysis/"
- failonerror="true">
- <redirector input="${stub.list}">
- <!-- place to put special case classes we want to ignore -->
- <inputfilterchain>
- <linecontainsregexp negate="true">
- <!-- only for internal Solr highlighting purposes -->
- <regexp pattern="TokenOrderingFilter"/>
- </linecontainsregexp>
- <linecontainsregexp negate="true">
- <!-- no way to leverage this in Solr -->
- <regexp pattern="CachingTokenFilter"/>
- </linecontainsregexp>
- <linecontainsregexp negate="true">
- <!-- no way to leverage this in Solr -->
- <regexp pattern="HyphenationCompoundWordTokenFilter"/>
- </linecontainsregexp>
- <linecontainsregexp negate="true">
- <!-- no way to leverage these in Solr (yet) -->
- <regexp pattern="Sink|Tee"/>
- </linecontainsregexp>
- <linecontainsregexp negate="true">
- <!-- Solr already has a different impl for this -->
- <regexp pattern="SynonymTokenFilter"/>
- </linecontainsregexp>
- <linecontainsregexp negate="true">
- <!-- solr and lucene both have one? ? ? ? -->
- <regexp pattern="LengthFilter"/>
- </linecontainsregexp>
- <linecontainsregexp negate="true">
- <!-- solr provides it's own SnowballPorterFilter variant -->
- <regexp pattern="SnowballFilter"/>
- </linecontainsregexp>
- </inputfilterchain>
- </redirector>
- <arg line="${stub.src.dirs}"/>
- </exec>
- </target>
-
-
- <!-- ========================================================================= -->
- <!-- ===================== TESTING-RELATED TASKS ============================= -->
- <!-- ========================================================================= -->
-
-
- <!-- Classpath for unit test compilation. -->
- <!-- For now, it's the same as main classpath. Later it will have JUnit, Clover, etc. -->
- <path id="testframework.compile.classpath">
- <path refid="compile.classpath" />
- <path refid="compile.classpath.solrj" />
- <pathelement location="${dest}/solr"/>
- <pathelement location="${dest}/solrj"/> <!-- include solrj -->
- <pathelement location="${common-solr.dir}/../lucene/build/classes/test-framework" /> <!-- include some lucene test code -->
- </path>
-
- <path id="test.compile.classpath">
- <path refid="testframework.compile.classpath"/>
- <pathelement location="${dest}/test-framework"/> <!-- include some solr test code -->
- </path>
-
- <path id="test.run.classpath">
- <path refid="test.compile.classpath" />
- <pathelement location="${dest}/tests"/>
- <!-- include the solrj classpath and jetty files included in example -->
- <path refid="compile.classpath.solrj" />
- <pathelement location="${common-solr.dir}/../lucene/build/classes/test-framework" /> <!-- include some lucene test code -->
- <pathelement path="${java.class.path}"/>
- </path>
-
- <target name="compileTestFramework" depends="compile,compile-solrj">
- <mkdir dir="${dest}/test-framework"/>
- <solr-javac
- destdir="${dest}/test-framework"
- classpathref="testframework.compile.classpath">
- <src path="${src}/test-framework"/>
- </solr-javac>
- </target>
-
- <!-- Compile unit tests. -->
- <target name="compileTests"
- description="Compile unit tests."
- depends="compileTestFramework">
-
- <mkdir dir="${dest}/tests" />
- <solr-javac
- destdir="${dest}/tests"
- classpathref="test.compile.classpath">
- <src path="${src}/test" />
- </solr-javac>
- <!-- Copy any data files present to the classpath -->
- <copy todir="${dest}/tests">
- <fileset dir="${src}/test-files" excludes="**/*.java"/>
- </copy>
- </target>
-
- <!-- Run core unit tests. -->
- <target name="test-core"
- description="Runs the core unit tests."
- depends="compileTests, junit" />
-
- <!-- Run contrib unit tests. -->
- <target name="test"
- description="Runs the core unit tests."
- depends="validate-solr, test-core, test-contrib, test-jsp" />
-
- <target name="junit" depends="compileTests,junit-mkdir,junit-sequential,junit-parallel"/>
-
- <target name="junit-sequential" if="tests.sequential">
- <junit-macro/>
- </target>
-
- <target name="junit-parallel" unless="tests.sequential">
- <parallel threadsPerProcessor="${tests.threadspercpu}">
- <junit-macro threadNum="1" threadTotal="8"/>
- <junit-macro threadNum="2" threadTotal="8"/>
- <junit-macro threadNum="3" threadTotal="8"/>
- <junit-macro threadNum="4" threadTotal="8"/>
- <junit-macro threadNum="5" threadTotal="8"/>
- <junit-macro threadNum="6" threadTotal="8"/>
- <junit-macro threadNum="7" threadTotal="8"/>
- <junit-macro threadNum="8" threadTotal="8"/>
- </parallel>
- </target>
-
- <target name="junit-mkdir">
- <mkdir dir="${junit.output.dir}"/>
- </target>
-
- <macrodef name="junit-macro">
- <attribute name="threadNum" default="1"/>
- <attribute name="threadTotal" default="1"/>
- <attribute name="tempDir" default="${junit.output.dir}/temp"/>
- <sequential>
- <!-- no description so it doesn't show up in -projecthelp -->
- <condition property="runall">
- <not>
- <or>
- <isset property="testcase"/>
- <isset property="testpackage"/>
- <isset property="testpackageroot"/>
- </or>
- </not>
- </condition>
- <!-- <mkdir dir="@{tempDir}/@{pattern}"/>
- This is very loud and obnoxious. abuse touch instead for a "quiet" mkdir
- -->
- <touch file="@{tempDir}/@{threadNum}/quiet.ant" verbose="false" mkdirs="true"/>
- <property name="dir.prop" value=""/>
- <junit printsummary="no"
- haltonfailure="no"
- maxmemory="512M"
- errorProperty="tests.failed"
- failureProperty="tests.failed"
- dir="@{tempDir}/@{threadNum}"
- tempdir="@{tempDir}/@{threadNum}"
- forkmode="perBatch"
- >
- <sysproperty key="java.util.logging.config.file" value="${common-solr.dir}/testlogging.properties"/>
- <sysproperty key="tests.luceneMatchVersion" value="${tests.luceneMatchVersion}"/>
- <sysproperty key="tests.codecprovider" value="${tests.codecprovider}"/>
- <sysproperty key="tests.codec" value="${tests.codec}"/>
- <sysproperty key="tests.locale" value="${tests.locale}"/>
- <sysproperty key="tests.timezone" value="${tests.timezone}"/>
- <sysproperty key="tests.multiplier" value="${tests.multiplier}"/>
- <sysproperty key="tests.iter" value="${tests.iter}"/>
- <sysproperty key="tests.seed" value="${tests.seed}"/>
- <sysproperty key="tests.verbose" value="${tests.verbose}"/>
- <sysproperty key="jetty.testMode" value="1"/>
- <sysproperty key="tempDir" file="@{tempDir}/@{threadNum}"/>
- <sysproperty key="testmethod" value="${testmethod}"/>
- <!-- set whether or not nightly tests should run -->
- <sysproperty key="tests.nightly" value="${tests.nightly}"/>
- <!-- TODO: why is this unconditionally set to "" above? disable for now
- <jvmarg line="${dir.prop}"/>
- -->
- <jvmarg line="${args}"/>
-
- <formatter classname="${junit.details.formatter}" usefile="false" if="junit.details"/>
- <classpath refid="test.run.classpath"/>
- <assertions>
- <enable package="org.apache.lucene"/>
- <enable package="org.apache.solr"/>
- </assertions>
- <formatter type="${junit.formatter}"/>
- <batchtest fork="yes" todir="${junit.output.dir}" if="runall">
- <fileset dir="src/test" includes="**/Test*.java,**/*Test.java">
- <custom classname="${junit.parallel.selector}" classpathref="test.run.classpath">
- <param name="divisor" value="@{threadTotal}" />
- <param name="part" value="@{threadNum}" />
- </custom>
- </fileset>
- </batchtest>
- <batchtest fork="yes" todir="${junit.output.dir}" if="testpackage">
- <fileset dir="src/test" includes="**/${testpackage}/**/Test*.java,**/${testpackage}/**/*Test.java">
- <custom classname="${junit.parallel.selector}" classpathref="test.run.classpath">
- <param name="divisor" value="@{threadTotal}" />
- <param name="part" value="@{threadNum}" />
- </custom>
- </fileset>
- </batchtest>
- <batchtest fork="yes" todir="${junit.output.dir}" if="testpackageroot">
- <fileset dir="src/test" includes="**/${testpackageroot}/Test*.java,**/${testpackageroot}/*Test.java">
- <custom classname="${junit.parallel.selector}" classpathref="test.run.classpath">
- <param name="divisor" value="@{threadTotal}" />
- <param name="part" value="@{threadNum}" />
- </custom>
- </fileset>
- </batchtest>
- <batchtest fork="yes" todir="${junit.output.dir}" if="testcase">
- <fileset dir="src/test" includes="**/${testcase}.java"/>
- </batchtest>
- </junit>
-
- <fail if="tests.failed">Tests failed!</fail>
- </sequential>
- </macrodef>
-
-
- <target name="test-reports"
- description="Generates HTML test reports.">
- <mkdir dir="${junit.reports}"/>
- <junitreport todir="${junit.output.dir}">
- <fileset dir="${junit.output.dir}">
- <include name="TEST-*.xml"/>
- </fileset>
- <report format="frames" todir="${junit.reports}"/>
- </junitreport>
- </target>
-
- <target name="clover" depends="clover.setup, clover.info"
- description="Instrument the Unit tests using Clover. Requires a Clover license and clover.jar in the ANT classpath. To use, specify -Drun.clover=true on the command line."/>
-
- <target name="clover.setup" if="clover.enabled">
- <taskdef resource="cloverlib.xml"/>
- <mkdir dir="${clover.db.dir}"/>
- <clover-setup initString="${clover.db.dir}/solr_coverage.db">
- <fileset dir="src/common"/>
- <fileset dir="src/solrj"/>
- <fileset dir="src/java"/>
- <fileset dir="src/webapp/src"/>
- <fileset dir="contrib/dataimporthandler/src/main/java" />
- <fileset dir="contrib/clustering/src/main/java" />
- <fileset dir="contrib/extraction/src/main/java" />
- <fileset dir="contrib/uima/src/main/java" />
- <fileset dir="contrib/analysis-extras/src/java" />
- </clover-setup>
- </target>
-
- <target name="clover.info" unless="clover.present">
- <echo>
- Clover not found. Code coverage reports disabled.
- </echo>
- </target>
-
- <target name="clover.check">
- <fail unless="clover.present">
- ##################################################################
- Clover not found.
- Please make sure clover.jar is in ANT_HOME/lib, or made available
- to Ant using other mechanisms like -lib or CLASSPATH.
- ##################################################################
- </fail>
- </target>
- <!--
- Run after Junit tests.
- -->
- <target name="generate-clover-reports" depends="clover.check, clover">
- <mkdir dir="${clover.report.dir}"/>
- <clover-report>
- <current outfile="${clover.report.dir}/clover.xml"
- title="${fullnamever}">
- <format type="xml"/>
- </current>
- <current outfile="${clover.report.dir}" title="${fullnamever}">
- <format type="html"/>
- </current>
- </clover-report>
- </target>
-
- <!-- ========================================================================= -->
-
- <!-- Checks that all JSP files in the webapp compile successfully using Jetty's Jasper -->
- <target name="test-jsp" depends="compile">
- <property name="jsp.target" location="${dest}/jsp-temp" />
- <taskdef classname="org.apache.jasper.JspC" name="jasper" >
- <classpath>
- <fileset dir="example/lib" includes="**/*.jar" />
- </classpath>
- </taskdef>
- <delete dir="${jsp.target}" />
- <mkdir dir="${jsp.target}" />
- <jasper
- uriroot="${src}/webapp/web"
- outputDir="${jsp.target}"
- compile="false"
- verbose="1"
- package="j"
- />
- <javac
- srcdir="${jsp.target}"
- destdir="${jsp.target}"
- target="${java.compat.version}"
- source="${java.compat.version}"
- debug="off"
- encoding="utf8"
- includeAntRuntime="${javac.includeAntRuntime}"
- classpathref="test.compile.classpath"
- />
- </target>
-
-
- <!-- ========================================================================= -->
- <!-- ===================== DISTRIBUTION-RELATED TASKS ======================== -->
- <!-- ========================================================================= -->
-
-
- <!-- Creates the Solr distribution files. -->
- <target name="dist"
- description="Creates the Solr distribution files."
- depends="dist-solrj, dist-jar, dist-test-framework, dist-contrib, dist-war" />
-
- <!-- Creates the Solr WAR file. -->
- <target name="dist-war"
- description="Creates the Solr WAR Distribution file."
- depends="compile, test-jsp, make-manifest, dist-jar, dist-solrj, lucene-jars-to-solr">
- <mkdir dir="${dist}" />
- <war destfile="${dist}/${fullnamever}.war"
- webxml="${web.xml}"
- filesetmanifest="skip"
- manifest="${dest}/META-INF/MANIFEST.MF">
- <lib dir="${lib}">
- <exclude name="servlet-api*.jar" />
- <exclude name="easymock-*.jar" />
- <exclude name="junit-*.jar" />
- <exclude name="*.txt" />
- <exclude name="*.template" />
- </lib>
-
- <lib dir="${lucene-libs}"/>
-
- <lib dir="${dist}">
- <include name="${fullname}-solrj-${version}.jar" />
- <include name="${fullname}-core-${version}.jar" />
- </lib>
- <fileset dir="${src}/webapp/web" />
-
- <!-- Include anything put in by contrib projects -->
- <fileset dir="${dest}/web" />
-
- <metainf dir="${basedir}" includes="LICENSE.txt,NOTICE.txt"/>
- </war>
- </target>
-
- <target name="dist-src" description="Creates the Solr source distribution files for maven"
- depends="make-manifest">
- <mkdir dir="${dist}" />
-
- <solr-jar destfile="${dist}/${fullname}-solrj-src-${version}.jar">
- <fileset dir="${src}/common" />
- <fileset dir="${src}/solrj"/>
- </solr-jar>
-
- <solr-jar destfile="${dist}/${fullname}-core-src-${version}.jar">
- <fileset dir="${src}/java" />
- <fileset dir="${src}/webapp/src"/>
- </solr-jar>
-
- <solr-jar destfile="${dist}/${fullname}-test-framework-src-${version}.jar"
- basedir="${src}/test-framework" />
-
- <solr-jar destfile="${dist}/apache-solr-dataimporthandler-src-${version}.jar"
- basedir="contrib/dataimporthandler/src/main/java" />
- <solr-jar destfile="${dist}/apache-solr-dataimporthandler-extras-src-${version}.jar"
- basedir="contrib/dataimporthandler/src/extras/main/java" />
-
- <solr-jar destfile="${dist}/apache-solr-cell-src-${version}.jar"
- basedir="contrib/extraction/src" />
- <solr-jar destfile="${dist}/apache-solr-clustering-src-${version}.jar"
- basedir="contrib/clustering/src" />
- <solr-jar destfile="${dist}/apache-solr-analysis-extras-src-${version}.jar"
- basedir="contrib/analysis-extras/src" />
- <solr-jar destfile="${dist}/apache-solr-uima-src-${version}.jar"
- basedir="contrib/uima/src/main/java" >
- <fileset dir="contrib/uima/src/main/resources" />
- </solr-jar>
- </target>
-
- <target name="dist-javadoc" description="Creates the Solr javadoc distribution files for maven"
- depends="make-manifest, javadoc">
- <mkdir dir="${dist}" />
-
- <solr-jar destfile="${dist}/${fullname}-core-docs-${version}.jar"
- basedir="${build.javadoc}/solr" />
- <solr-jar destfile="${dist}/${fullname}-solrj-docs-${version}.jar"
- basedir="${build.javadoc}/solrj" />
- <solr-jar destfile="${dist}/${fullname}-test-framework-docs-${version}.jar"
- basedir="${build.javadoc}/test-framework" />
- <solr-jar destfile="${dist}/apache-solr-dataimporthandler-docs-${version}.jar"
- basedir="${build.javadoc}/contrib-solr-dataimporthandler" />
- <solr-jar destfile="${dist}/apache-solr-clustering-docs-${version}.jar"
- basedir="${build.javadoc}/contrib-solr-clustering" />
- <solr-jar destfile="${dist}/apache-solr-cell-docs-${version}.jar"
- basedir="${build.javadoc}/contrib-solr-cell" />
- <solr-jar destfile="${dist}/apache-solr-analysis-extras-docs-${version}.jar"
- basedir="${build.javadoc}/contrib-solr-analysis-extras" />
- <solr-jar destfile="${dist}/apache-solr-uima-docs-${version}.jar"
- basedir="${build.javadoc}/contrib-solr-uima" />
- </target>
-
- <!-- Creates the solr jar. -->
- <target name="dist-jar"
- description="Creates the Solr JAR Distribution file."
- depends="compile, make-manifest">
- <mkdir dir="${dist}" />
- <solr-jar destfile="${dist}/${fullname}-core-${version}.jar">
- <fileset dir="${dest}/solr" />
- </solr-jar>
-
- </target>
-
- <!-- Creates the test-framework jar -->
- <target name="dist-test-framework"
- description="Creates the Solr test-framework JAR."
- depends="compileTestFramework">
- <mkdir dir="${dist}" />
- <solr-jar destfile="${dist}/${fullname}-test-framework-${version}.jar">
- <fileset dir="${dest}/test-framework" />
- </solr-jar>
- </target>
-
- <!-- Creates the solr jar. -->
- <target name="dist-solrj"
- description="Creates the Solr JAR Distribution file."
- depends="compile-solrj, make-manifest">
- <mkdir dir="${dist}" />
- <solr-jar
- destfile="${dist}/${fullname}-solrj-${version}.jar"
- basedir="${dest}/solrj" />
-
- <mkdir dir="${dist}/solrj-lib" />
- <copy todir="${dist}/solrj-lib">
- <fileset dir="${lib}">
- <include name="commons-codec-*.jar"/>
- <include name="commons-io-*.jar"/>
- <include name="commons-httpclient-*.jar"/>
- <include name="*stax-*.jar" />
- <include name="wstx-*.jar" />
- <include name="jcl-over-slf4j-*.jar" />
- <include name="slf4j-api-*.jar" />
- </fileset>
- </copy>
-
- </target>
-
- <target name="example"
- description="Creates a runnable example configuration."
- depends="compile-lucene,dist-contrib,dist-war,example-contrib">
- <copy file="${dist}/${fullnamever}.war"
- tofile="${example}/webapps/${ant.project.name}.war"/>
- <jar destfile="${example}/exampledocs/post.jar"
- basedir="${dest}/solr"
- filesetmanifest="skip"
- includes="org/apache/solr/util/SimplePostTool*.class">
- <manifest>
- <attribute name="Main-Class"
- value="org.apache.solr.util.SimplePostTool"/>
- </manifest>
- </jar>
-
- <delete includeemptydirs="true">
- <fileset dir="${example}/work" includes="**/*"/>
- </delete>
- <echo>See ${example}/README.txt for how to run the Solr example configuration.</echo>
- </target>
-
- <target name="run-example" depends="example"
- description="Run Solr interactively, via Jetty. -Dexample.debug=true to enable JVM debugger">
- <property name="example.solr.home" location="example/solr"/>
- <property name="example.data.dir" location="example/solr/data"/>
- <property name="example.debug.suspend" value="n"/>
- <property name="example.jetty.port" value="8983"/>
- <condition property="example.jvm.line" value="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=${example.debug.suspend},address=5005">
- <isset property="example.debug"/>
- </condition>
- <property name="example.jvm.line" value=""/>
- <property name="example.heap.size" value="512M"/>
- <java jar="${example}/start.jar" fork="true" dir="${example}" maxmemory="${example.heap.size}">
- <jvmarg line="${example.jvm.line}"/>
- <sysproperty key="solr.solr.home" file="${example.solr.home}"/>
- <sysproperty key="solr.data.dir" file="${example.data.dir}"/>
- <sysproperty key="jetty.port" value="${example.jetty.port}"/>
- </java>
-
- </target>
-
- <!-- make a distribution -->
- <target name="package" depends="package-src,create-package"/>
-
- <property name="svn.export.dir" location="${dest}/svn-export"/>
-
- <!-- Makes a tarball from running "svn export" at the root level. -->
- <!-- Copies NOTICE.txt and LICENSE.txt from solr/ to the root level. -->
- <target name="package-src" depends="svn-export-source"
- description="Packages the Solr Source Distribution">
- <mkdir dir="${package.dir}"/>
- <property name="source.package.file"
- value="${package.dir}/${fullnamever}-src.tgz"/>
- <delete file="${source.package.file}" failonerror="false" />
- <tar destfile="${source.package.file}" compression="gzip" longfile="gnu">
- <tarfileset dir="${svn.export.dir}" prefix="${fullnamever}"/>
- <tarfileset dir="${svn.export.dir}/solr" prefix="${fullnamever}"
- includes="NOTICE.txt,LICENSE.txt"/>
- </tar>
- <solr-checksum file="${source.package.file}"/>
- </target>
-
- <!-- Runs "svn export" in build/svn-export/ with the same root-level URL -->
- <!-- and revision as the current working copy. -->
- <target name="svn-export-source" depends="get-svn-info">
- <delete dir="${svn.export.dir}" includeemptydirs="true" failonerror="false"/>
- <mkdir dir="${dest}"/>
- <exec dir="." executable="${svn.exe}" failonerror="true">
- <arg value="export"/>
- <arg value="--native-eol"/>
- <arg value="LF"/>
- <arg value="-r"/>
- <arg value="${svn.Revision}"/>
- <arg value="${svn.URL}"/>
- <arg value="${svn.export.dir}"/>
- </exec>
- </target>
-
- <!-- Populates properties svn.URL and svn.Revision using "svn info" -->
- <target name="get-svn-info">
- <exec dir=".." executable="${svn.exe}" outputproperty="svn.info" failonerror="true">
- <arg value="info"/>
- </exec>
- <loadproperties>
- <propertyresource name="svn.info"/>
- <filterchain>
- <linecontainsregexp>
- <regexp pattern="(URL|Revision):"/>
- </linecontainsregexp>
- <replacestring from=": " to="="/>
- <prefixlines prefix="svn."/>
- </filterchain>
- </loadproperties>
+ <!-- Default target: usage. Prints out instructions. -->
+ <target name="usage"
+ description="Prints out instructions">
+ <echo message="Welcome to the Solr project!" />
+ <echo message="Use 'ant example' to create a runnable example configuration." />
+ <echo message="Use 'ant run-example' to create and run the example." />
+ <echo message="And for developers:"/>
+ <echo message="Use 'ant clean' to clean compiled files." />
+ <echo message="Use 'ant compile' to compile the source code." />
+ <echo message="Use 'ant dist' to build the project WAR and JAR files." />
+ <echo message="Use 'ant javadoc' to build javadoc under build/docs/api" />
+ <echo message="Use 'ant generate-maven-artifacts' to generate maven artifacts." />
+ <echo message="Use 'ant package' to generate zip, tgz for distribution." />
+ <echo message="Use 'ant luke' to start luke. see: http://luke.googlecode.com" />
+ <echo message="Use 'ant test' to run unit tests." />
</target>
- <target name="create-package"
- description="Packages the Solr Binary Distribution"
- depends="dist, example, javadoc">
- <mkdir dir="${package.dir}"/>
-
- <delete includeemptydirs="true">
- <fileset dir="${example}/work" includes="**/*"/>
- </delete>
-
- <delete includeemptydirs="true" failonerror="false">
- <fileset dir="${dest}/${fullnamever}" includes="**/*"/>
- </delete>
-
- <delete file="${package.dir}/${fullnamever}.tgz" failonerror="false" />
- <delete file="${package.dir}/${fullnamever}.zip" failonerror="false" />
-
- <tar destfile="${package.dir}/${fullnamever}.tgz" compression="gzip" longfile="gnu">
- <tarfileset dir="."
- prefix="${fullnamever}"
- includes="LICENSE.txt NOTICE.txt *.txt example/** client/** contrib/**/lib/ contrib/**/lucene-libs/ contrib/**/README.txt contrib/**/CHANGES.txt"
- excludes="${dist}/** ${dest}/** lib/README.committers.txt **/data/ **/logs/* **/classes/ **/*.sh **/bin/ src/scripts/** src/site/build/** **/target/** client/ruby/flare/** client/python/** client/javascript/** contrib/**/build/** **/*.iml **/*.ipr **/*.iws **/*pom.xml.template" />
- <tarfileset dir="."
- mode="755"
- prefix="${fullnamever}"
- includes="example/**/*.sh example/**/bin/" />
- <tarfileset dir="."
- prefix="${fullnamever}"
- includes="dist/*.jar dist/*.war dist/solrj-lib/*"
- excludes="**/*.tgz **/*.zip **/*.md5 **/*src*.jar **/*docs*.jar" />
- <!-- hack: the javadocs are built twice since maven needs separate packages... exclude those -->
- <tarfileset dir="${build.docs}"
- prefix="${fullnamever}/docs/"
- excludes="api/solr/** api/contrib-*/**"
- />
- </tar>
- <solr-checksum file="${package.dir}/${fullnamever}.tgz"/>
-
- <gunzip src="${package.dir}/${fullnamever}.tgz" dest="${dest}/${fullnamever}.tar"/>
- <untar src="${dest}/${fullnamever}.tar" dest="${dest}"/>
-
- <!--
- This is a list of text file patterns to convert to CRLF line-ending style.
- Shell scripts and files included in shell scripts should not be converted.
- NB: The line-ending conversion process will mangle non-UTF8-encoded files.
- -->
- <fixcrlf srcdir="${dest}/${fullnamever}"
- encoding="UTF-8"
- eol="crlf"
- includes="**/*.alg **/*.cfg **/*.cgi **/*.cpp **/*.css **/*.csv **/*.dtd
- **/*.erb **/*.fcgi **/.htaccess **/*.htm **/*.html **/*.incl
- **/*.java **/*.javacc **/*.jflex **/*.jflex-macro **/*.jj
- **/*.js **/*.json **/*.jsp **/*LICENSE **/package-list **/*.pl
- **/*.pom **/*pom.xml.template **/*.properties **/*.py
- **/*.rake **/Rakefile **/*.rb **/*.rbbi **/README* **/*.rhtml
- **/*.rslp **/*.rxml **/*.script **/*.svg **/*.tsv **/*.txt
- **/UPGRADING **/USAGE **/*.uxf **/*.vm **/*.xcat **/*.xml
- **/*.xsl **/*.xslt **/*.yml"
- excludes="**/stopwordsWrongEncoding.txt **/gb18030-example.xml"
- />
-
- <zip destfile="${package.dir}/${fullnamever}.zip">
- <zipfileset dir="${dest}/${fullnamever}"
- prefix="${fullnamever}"
- excludes="**/*.sh **/bin/ src/scripts/" />
- <zipfileset dir="${dest}/${fullnamever}"
- prefix="${fullnamever}"
- includes="**/*.sh **/bin/ src/scripts/"
- filemode="755" />
- </zip>
- <solr-checksum file="${package.dir}/${fullnamever}.zip"/>
-
+ <!-- TODO: lucene/solr could share these -->
+ <target name="build-contrib" depends="compile-test"
+ description="Builds all contrib modules and their tests">
+ <contrib-crawl target="build-artifacts-and-tests"/>
</target>
-
- <target name="build-site" depends="svn-up"
- description="Prototype Helper for Committers. Assumes SVN is in the path">
- <delete dir="src/site/build"/>
- <exec executable="forrest" dir="src/site"/>
- <copy todir="site">
- <fileset dir="src/site/build/site"/>
- </copy>
- <antcall target="svn-up"/>
-
- </target>
- <target name="svn-up">
- <exec executable="${svn.exe}">
- <arg value="update"/>
- </exec>
+ <target name="javadocs-contrib" description="Generate javadocs for contrib classes"
+ depends="build-contrib">
+ <contrib-crawl target="javadocs" failonerror="true"/>
</target>
- <target name="clean-package-signatures">
- <delete failonerror="false">
- <fileset dir="${package.dir}">
- <include name="**/*.asc"/>
- </fileset>
- </delete>
+ <target name="test-contrib" description="Run contrib unit tests."
+ depends="build-contrib">
+ <contrib-crawl target="test" failonerror="true"/>
</target>
- <target name="sign-artifacts" depends="clean-package-signatures">
- <!--<property file="${user.home}/.solr/build.properties" />-->
- <input message="password:>" addproperty="gpg.passphrase">
- <handler classname="org.apache.tools.ant.input.SecureInputHandler" />
- </input>
- <sign-artifact input.file="${package.dir}/${fullnamever}.tgz" output.file="${package.dir}/${fullnamever}.tgz.asc" gpg.passphrase="${gpg.passphrase}"/>
- <sign-artifact input.file="${package.dir}/${fullnamever}.zip" output.file="${package.dir}/${fullnamever}.zip.asc" gpg.passphrase="${gpg.passphrase}"/>
- <sign-artifact input.file="${package.dir}/${fullnamever}-src.tgz" output.file="${package.dir}/${fullnamever}-src.tgz.asc" gpg.passphrase="${gpg.passphrase}"/>
-
- <!-- Maven artifacts -->
- <sign-maven-dependency-artifacts artifact.id="solr-commons-csv" gpg.passphrase="${gpg.passphrase}"/>
- <sign-maven-dependency-artifacts artifact.id="solr-noggit" gpg.passphrase="${gpg.passphrase}"/>
- <sign-maven-dependency-artifacts artifact.id="solr-uima-an-alchemy" gpg.passphrase="${gpg.passphrase}"/>
- <sign-maven-dependency-artifacts artifact.id="solr-uima-an-calais" gpg.passphrase="${gpg.passphrase}"/>
- <sign-maven-dependency-artifacts artifact.id="solr-uima-an-tagger" gpg.passphrase="${gpg.passphrase}"/>
- <sign-maven-dependency-artifacts artifact.id="solr-uima-an-wst" gpg.passphrase="${gpg.passphrase}"/>
- <sign-maven-war-artifacts artifact.id="solr" gpg.passphrase="${gpg.passphrase}"/>
- <sign-maven-artifacts artifact.id="solr-analysis-extras" gpg.passphrase="${gpg.passphrase}"/>
- <sign-maven-artifacts artifact.id="solr-cell" gpg.passphrase="${gpg.passphrase}"/>
- <sign-maven-artifacts artifact.id="solr-clustering" gpg.passphrase="${gpg.passphrase}"/>
- <sign-maven-artifacts artifact.id="solr-core" gpg.passphrase="${gpg.passphrase}"/>
- <sign-maven-artifacts artifact.id="solr-dataimporthandler" gpg.passphrase="${gpg.passphrase}"/>
- <sign-maven-artifacts artifact.id="solr-dataimporthandler-extras" gpg.passphrase="${gpg.passphrase}"/>
- <sign-maven-artifacts artifact.id="solr-solrj" gpg.passphrase="${gpg.passphrase}"/>
- <sign-maven-artifacts artifact.id="solr-uima" gpg.passphrase="${gpg.passphrase}"/>
- <sign-maven-artifacts artifact.id="solr-test-framework" gpg.passphrase="${gpg.passphrase}"/>
- <!-- These are special since there are no jars, just poms -->
- <sign-artifact input.file="${maven.dist.prefix}/solr-parent/${version}/solr-parent-${version}.pom" gpg.passphrase="${gpg.passphrase}"/>
+ <target name="compile-analyzers-common" unless="analyzers-common.uptodate">
+ <ant dir="${common.dir}/../modules/analysis/common" target="default" inheritAll="false"/>
</target>
-
- <property name="rc" value="rc0"/>
- <property name="remote.staging.dir" value="public_html/staging_area/${rc}/${version}"/>
- <property name="keyfile" value="${user.home}/.ssh/id_rsa"/>
- <property name="scp.user" value="${user.name}"/>
- <!--keys.dir is the location of the https://svn.apache.org/repos/asf/lucene/java/dist/ directory-->
- <property name="keys.dir" value="${common-solr.dir}/../../dist"/>
- <target name="copy-to-stage">
- <sshexec host="people.apache.org"
- username="${scp.user}"
- keyfile="${keyfile}"
- command="mkdir -p ${remote.staging.dir}"/>
- <echo>Uploading artifacts to ${scp.user}@people.apache.org:${remote.staging.dir}</echo>
- <scp todir="${scp.user}@people.apache.org:${remote.staging.dir}"
- username="${scp.user}"
- keyfile="${keyfile}"
- verbose="true"
- >
- <fileset dir="package"/>
- <fileset dir="${keys.dir}">
- <include name="KEYS"/>
- </fileset>
- </scp>
+ <target name="compile-analyzers-phonetic" unless="analyzers-phonetic.uptodate">
+ <ant dir="${common.dir}/../modules/analysis/phonetic" target="default" inheritAll="false"/>
</target>
-
- <target name="prepare-release" depends="clean, svn-up, package, generate-maven-artifacts, sign-artifacts"
- description="Prototype helper for Committers. Assumes gpg is in the path"/>
-
- <target name="stage" depends="prepare-release, copy-to-stage"/>
-
- <target name="generate-maven-artifacts" depends="maven.ant.tasks-check,dist,dist-src,dist-javadoc">
- <sequential>
- <ant target="get-maven-poms" dir=".."/>
-
- <!--
-
- !!!!!!!!!!
- NOTE: If you add new artifacts, please make sure you also add to the sign-artifacts target
- so that they get signed during release.
- !!!!!!!
- -->
-
- <mkdir dir="${maven.build.dir}"/>
- <mkdir dir="${maven.dist.dir}"/>
-
- <!-- ========== SOLR PARENT POM ========== -->
-
- <m2-deploy pom.xml="pom.xml"/>
-
- <!-- ========== SOLR SPECIFIC NON-MAVENIZED DEPENDENCIES ========== -->
- <m2-deploy-with-pom-template pom.xml="lib/solr-commons-csv-pom.xml.template"
- jar.file="lib/commons-csv-1.0-SNAPSHOT-r966014.jar" />
-
- <m2-deploy-with-pom-template pom.xml="lib/apache-solr-noggit-pom.xml.template"
- jar.file="lib/apache-solr-noggit-r1099557.jar" />
-
- <m2-deploy-with-pom-template pom.xml="contrib/uima/lib/solr-uima-an-alchemy-pom.xml.template"
- jar.file="contrib/uima/lib/uima-an-alchemy-2.3.1-SNAPSHOT-r1062868.jar" />
-
- <m2-deploy-with-pom-template pom.xml="contrib/uima/lib/solr-uima-an-calais-pom.xml.template"
- jar.file="contrib/uima/lib/uima-an-calais-2.3.1-SNAPSHOT-r1062868.jar" />
-
- <m2-deploy-with-pom-template pom.xml="contrib/uima/lib/solr-uima-an-tagger-pom.xml.template"
- jar.file="contrib/uima/lib/uima-an-tagger-2.3.1-SNAPSHOT-r1062868.jar" />
-
- <m2-deploy-with-pom-template pom.xml="contrib/uima/lib/solr-uima-an-wst-pom.xml.template"
- jar.file="contrib/uima/lib/uima-an-wst-2.3.1-SNAPSHOT-r1076132.jar" />
-
- <!-- ========== SOLR ARTIFACTS ========== -->
-
- <m2-deploy pom.xml="contrib/dataimporthandler/src/pom.xml"
- jar.file="${dist}/apache-solr-dataimporthandler-${version}.jar">
- <artifact-attachments>
- <attach file="${dist}/apache-solr-dataimporthandler-src-${version}.jar" classifier="sources"/>
- <attach file="${dist}/apache-solr-dataimporthandler-docs-${version}.jar" classifier="javadoc"/>
- </artifact-attachments>
- </m2-deploy>
-
- <m2-deploy pom.xml="contrib/dataimporthandler/src/extras/pom.xml"
- jar.file="${dist}/apache-solr-dataimporthandler-extras-${version}.jar">
- <artifact-attachments>
- <attach file="${dist}/apache-solr-dataimporthandler-extras-src-${version}.jar" classifier="sources"/>
- <attach file="${dist}/apache-solr-dataimporthandler-docs-${version}.jar" classifier="javadoc"/>
- </artifact-attachments>
- </m2-deploy>
-
- <m2-deploy pom.xml="contrib/extraction/pom.xml"
- jar.file="${dist}/apache-solr-cell-${version}.jar">
- <artifact-attachments>
- <attach file="${dist}/apache-solr-cell-src-${version}.jar" classifier="sources"/>
- <attach file="${dist}/apache-solr-cell-docs-${version}.jar" classifier="javadoc"/>
- </artifact-attachments>
- </m2-deploy>
-
- <m2-deploy pom.xml="contrib/clustering/pom.xml"
- jar.file="${dist}/apache-solr-clustering-${version}.jar">
- <artifact-attachments>
- <attach file="${dist}/apache-solr-clustering-src-${version}.jar" classifier="sources"/>
- <attach file="${dist}/apache-solr-clustering-docs-${version}.jar" classifier="javadoc"/>
- </artifact-attachments>
- </m2-deploy>
-
- <m2-deploy pom.xml="contrib/analysis-extras/pom.xml"
- jar.file="${dist}/apache-solr-analysis-extras-${version}.jar">
- <artifact-attachments>
- <attach file="${dist}/apache-solr-analysis-extras-src-${version}.jar" classifier="sources"/>
- <attach file="${dist}/apache-solr-analysis-extras-docs-${version}.jar" classifier="javadoc"/>
- </artifact-attachments>
- </m2-deploy>
-
- <m2-deploy pom.xml="contrib/uima/pom.xml"
- jar.file="${dist}/apache-solr-uima-${version}.jar">
- <artifact-attachments>
- <attach file="${dist}/apache-solr-uima-src-${version}.jar" classifier="sources"/>
- <attach file="${dist}/apache-solr-uima-docs-${version}.jar" classifier="javadoc"/>
- </artifact-attachments>
- </m2-deploy>
-
- <m2-deploy pom.xml="src/pom.xml"
- jar.file="${dist}/apache-solr-core-${version}.jar">
- <artifact-attachments>
- <attach file="${dist}/apache-solr-core-src-${version}.jar" classifier="sources"/>
- <attach file="${dist}/apache-solr-core-docs-${version}.jar" classifier="javadoc"/>
- </artifact-attachments>
- </m2-deploy>
-
- <m2-deploy pom.xml="src/solrj/pom.xml"
- jar.file="${dist}/apache-solr-solrj-${version}.jar">
- <artifact-attachments>
- <attach file="${dist}/apache-solr-solrj-src-${version}.jar" classifier="sources"/>
- <attach file="${dist}/apache-solr-solrj-docs-${version}.jar" classifier="javadoc"/>
- </artifact-attachments>
- </m2-deploy>
-
- <m2-deploy pom.xml="src/webapp/pom.xml"
- jar.file="${dist}/apache-solr-${version}.war"/>
-
- <m2-deploy pom.xml="${src}/test-framework/pom.xml"
- jar.file="${dist}/${fullname}-test-framework-${version}.jar">
- <artifact-attachments>
- <attach file="${dist}/${fullname}-test-framework-src-${version}.jar" classifier="sources"/>
- <attach file="${dist}/${fullname}-test-framework-docs-${version}.jar" classifier="javadoc"/>
- </artifact-attachments>
- </m2-deploy>
- </sequential>
+ <target name="compile-highlighter" unless="highlighter.uptodate">
+ <ant dir="${common.dir}/contrib/highlighter" target="default" inheritAll="false"/>
</target>
-
- <target name="set-fsdir">
- <property name="use.fsdir" value="true"/>
+ <target name="compile-memory" unless="memory.uptodate">
+ <ant dir="${common.dir}/contrib/memory" target="default" inheritAll="false"/>
</target>
-
- <target name="-taskdef">
- <typedef resource="org/apache/rat/anttasks/antlib.xml" uri="antlib:rat.anttasks">
- <classpath>
- <fileset dir="." includes="rat*.jar"/>
- </classpath>
- </typedef>
+ <target name="compile-misc" unless="misc.uptodate">
+ <ant dir="${common.dir}/contrib/misc" target="default" inheritAll="false"/>
</target>
- <target name="rat-sources" depends="-taskdef"
- description="runs the tasks over src/java excluding the license directory">
- <rat:report xmlns:rat="antlib:org.apache.rat.anttasks">
- <fileset dir="src/java"/>
- <fileset dir="src/test"/>
- <fileset dir="src/webapp"/>
- <fileset dir="src/common"/>
- <fileset dir="src/solrj"/>
- <fileset dir="client">
- <exclude name="**/CHANGES.*"/>
- </fileset>
- <fileset dir="contrib/dataimporthandler/src/main/java"/>
- <fileset dir="contrib/dataimporthandler/src/test/java"/>
- <fileset dir="contrib/dataimporthandler/src/extras/main/java"/>
- <fileset dir="contrib/dataimporthandler/src/extras/test/java"/>
- <fileset dir="contrib/clustering/src/main/java"/>
- <fileset dir="contrib/clustering/src/test/java"/>
- <fileset dir="contrib/extraction/src/main/java"/>
- <fileset dir="contrib/extraction/src/test/java"/>
- <fileset dir="contrib/analysis-extras/src/test"/>
- <fileset dir="contrib/analysis-extras/src/test"/>
- <fileset dir="contrib/uima/src/main/java"/>
- <fileset dir="contrib/uima/src/test/java"/>
- </rat:report>
+ <target name="compile-queries" unless="queries.uptodate">
+ <ant dir="${common.dir}/contrib/queries" target="default" inheritAll="false"/>
</target>
-
-
- <!-- ========================================================================= -->
- <!-- ===================== Runtime: luke ============================= -->
- <!-- ========================================================================= -->
- <property name="luke.version" value="1.0.1"/>
- <available file="luke/luke-${luke.version}.jar" property="luke.jar.exists" />
- <target name="luke-download" unless="luke.jar.exists" depends="proxy.setup">
- <mkdir dir="luke"/>
- <get src="http://luke.googlecode.com/files/luke-${luke.version}.jar"
- dest="luke/luke-${luke.version}.jar"/>
+ <target name="compile-spatial" unless="spatial.uptodate">
+ <ant dir="${common.dir}/contrib/spatial" target="default" inheritAll="false"/>
</target>
- <path id="luke.classpath">
- <pathelement location="${common-solr.dir}/../lucene/build/classes/java" />
- <pathelement location="${common-solr.dir}/../lucene/build/contrib/xml-query-parser/classes/java" />
-
- </path>
- <target name="luke" depends="luke-download">
- <java fork="true"
- classname="org.getopt.luke.Luke"
- logError="true"
- failonerror="true">
- <classpath>
- <fileset dir="luke">
- <include name="luke-${luke.version}.jar"/>
- </fileset>
- <path refid="lucene.classpath"/>
- <path refid="luke.classpath"/>
- <path refid="test.run.classpath"/>
- </classpath>
- </java>
+ <target name="compile-spellchecker" unless="spellchecker.uptodate">
+ <ant dir="${common.dir}/contrib/spellchecker" target="default" inheritAll="false"/>
</target>
</project>
diff --cc solr/common-build.xml
index 32006ba1470,a57b4074e25..6dd27fd58c3
--- a/solr/common-build.xml
+++ b/solr/common-build.xml
@@@ -103,18 -331,309 +103,55 @@@
</sequential>
</macrodef>
- <property name="failonjavadocwarning" value="true"/>
- <macrodef name="invoke-javadoc">
- <element name="sources" optional="yes"/>
- <attribute name="destdir"/>
- <attribute name="title" default="${Name} ${version} API (${specversion})"/>
- <sequential>
- <mkdir dir="@{destdir}"/>
- <copy todir="@{destdir}/prettify" overwrite="false">
- <fileset dir="${prettify.dir}"/>
- </copy>
- <record name="@{destdir}/log_javadoc.txt" action="start" append="no"/>
- <javadoc
- packagenames="org.apache.solr.*"
- failonerror="true"
- destdir="@{destdir}"
- access="${javadoc.access}"
- encoding="utf-8"
- author="true"
- version="true"
- use="true"
- source="${ant.java.version}"
- link="${javadoc.link.java}"
- windowtitle="${Name} ${version} API"
- doctitle="@{title}"
- stylesheetfile="@{destdir}/prettify/stylesheet+prettify.css"
- bottom="Copyright &amp;copy; ${year} Apache Software Foundation. All Rights Reserved.">
- <tag name="todo" description="To Do:"/>
- <tag name="uml.property" description="UML Property:"/>
- <tag name="lucene.experimental"
- description="WARNING: This API is experimental and might change in incompatible ways in the next release."/>
- <tag name="lucene.internal"
- description="NOTE: This API is for Lucene internal purposes only and might change in incompatible ways in the next release."/>
- <link offline="true" packagelistLoc="${build.javadoc}"/>
- <link href="${javadoc.link.java}"/>
- <link href="${javadoc.link.junit}"/>
- <link href="${javadoc.link.lucene}"/>
- <header><![CDATA[
- <script src="{@docRoot}/prettify/prettify.js" type="text/javascript"></script>
- <script language="JavaScript">window.onload=function(){windowTitle();prettyPrint();}</script>
- ]]></header>
-
- <sources />
-
- <classpath refid="javadoc.classpath"/>
- </javadoc>
- <record name="@{destdir}/log_javadoc.txt" action="stop"/>
-
- <delete>
- <fileset file="@{destdir}/log_javadoc.txt">
- <not>
- <containsregexp expression="\[javadoc\]\s*[1-9][0-9]*[\s]*warning"/>
- </not>
- </fileset>
- </delete>
-
- <fail message="Javadocs warnings were found!" >
- <condition>
- <and>
- <available file="@{destdir}/log_javadoc.txt"/>
- <istrue value="${failonjavadocwarning}"/>
- </and>
- </condition>
- </fail>
- </sequential>
- </macrodef>
-
- <!-- NOTE, the pom.xml MUST be a relative path. An absolute path may break the build on windows -->
- <macrodef name="m2-deploy" description="Builds a Maven artifact">
- <element name="artifact-attachments" optional="yes"/>
- <attribute name="pom.xml" default="pom.xml"/>
- <attribute name="jar.file" default="${jar.file}"/>
- <sequential>
- <artifact:install-provider artifactId="wagon-ssh" version="1.0-beta-7"/>
- <artifact:pom id="maven.project" file="@{pom.xml}"/>
- <artifact:deploy file="@{jar.file}">
- <artifact-attachments/>
- <remoteRepository url="${m2.repository.url}">
- <authentication username="${m2.repository.username}" privateKey="${m2.repository.private.key}"/>
- </remoteRepository>
- <pom refid="maven.project"/>
- </artifact:deploy>
- </sequential>
- </macrodef>
-
- <macrodef name="m2-deploy-with-pom-template" description="Builds a Maven artifact given a POM template">
- <attribute name="pom.xml"/>
- <attribute name="jar.file"/>
- <sequential>
- <copy file="@{pom.xml}" tofile="${maven.build.dir}/@{pom.xml}">
- <filterset begintoken="@" endtoken="@">
- <filter token="version" value="${version}"/>
- </filterset>
- </copy>
- <artifact:install-provider artifactId="wagon-ssh" version="1.0-beta-7"/>
- <artifact:pom id="maven.project" file="${maven.build.dir}/@{pom.xml}" />
- <artifact:deploy file="@{jar.file}">
- <remoteRepository url="${m2.repository.url}">
- <authentication username="${m2.repository.username}" privateKey="${m2.repository.private.key}"/>
- </remoteRepository>
- <pom refid="maven.project"/>
- </artifact:deploy>
- </sequential>
- </macrodef>
-
- <property name="gpg.exe" value="gpg" />
- <property name="gpg.key" value="CODE SIGNING KEY" />
- <macrodef name="sign-artifact" description="Signs the artifact">
- <attribute name="input.file"/>
- <attribute name="output.file" default="@{input.file}.asc"/>
- <attribute name="gpg.passphrase"/>
- <sequential>
- <echo >Signing @{input.file} Sig File: @{output.file}</echo>
-
- <exec executable="${gpg.exe}" >
- <arg value="--batch"/>
- <arg value="--armor"/>
- <arg value="--output"/>
- <arg value="@{output.file}"/>
- <arg value="--default-key"/>
- <arg value="${gpg.key}"/>
- <arg value="--passphrase"/>
- <arg value="@{gpg.passphrase}"/>
- <arg value="--detach-sig"/>
- <arg value="@{input.file}"/>
- </exec>
- </sequential>
- </macrodef>
-
- <!--
- We need to sign:
- The POM
- The library jar
- The sources jar
- the javadoc jar
- -->
- <macrodef name="sign-maven-artifacts" description="Signs maven artifacts">
- <attribute name="artifact.id"/>
- <attribute name="prefix.dir" default="${maven.dist.prefix}"/>
- <attribute name="gpg.passphrase"/>
- <sequential>
- <sign-artifact input.file="@{prefix.dir}/@{artifact.id}/${version}/@{artifact.id}-${version}.jar" gpg.passphrase="@{gpg.passphrase}"/>
- <sign-artifact input.file="@{prefix.dir}/@{artifact.id}/${version}/@{artifact.id}-${version}-javadoc.jar" gpg.passphrase="@{gpg.passphrase}"/>
- <sign-artifact input.file="@{prefix.dir}/@{artifact.id}/${version}/@{artifact.id}-${version}-sources.jar" gpg.passphrase="@{gpg.passphrase}"/>
- <sign-artifact input.file="@{prefix.dir}/@{artifact.id}/${version}/@{artifact.id}-${version}.pom" gpg.passphrase="@{gpg.passphrase}"/>
- </sequential>
- </macrodef>
-
- <macrodef name="sign-maven-war-artifacts" description="Signs maven artifacts">
- <attribute name="artifact.id"/>
- <attribute name="prefix.dir" default="${maven.dist.prefix}"/>
- <attribute name="gpg.passphrase"/>
- <sequential>
- <sign-artifact input.file="@{prefix.dir}/@{artifact.id}/${version}/@{artifact.id}-${version}.war" gpg.passphrase="@{gpg.passphrase}"/>
- <sign-artifact input.file="@{prefix.dir}/@{artifact.id}/${version}/@{artifact.id}-${version}.pom" gpg.passphrase="@{gpg.passphrase}"/>
- </sequential>
- </macrodef>
-
- <macrodef name="sign-maven-dependency-artifacts" description="Signs a maven artifact and its POM">
- <attribute name="artifact.id"/>
- <attribute name="prefix.dir" default="${maven.dist.prefix}"/>
- <attribute name="gpg.passphrase"/>
- <sequential>
- <sign-artifact input.file="@{prefix.dir}/@{artifact.id}/${version}/@{artifact.id}-${version}.jar" gpg.passphrase="@{gpg.passphrase}"/>
- <sign-artifact input.file="@{prefix.dir}/@{artifact.id}/${version}/@{artifact.id}-${version}.pom" gpg.passphrase="@{gpg.passphrase}"/>
+ <macrodef name="solr-contrib-uptodate">
+ <attribute name="name"/>
+ <attribute name="property" default="@{name}.uptodate"/>
+ <attribute name="classpath.property" default="@{name}.jar"/>
+ <!-- set jarfile only, if the target jar file has no generic name -->
+ <attribute name="jarfile" default="${common-solr.dir}/build/contrib/@{name}/@{name}-${version}.jar"/>
+ <sequential>
+ <!--<echo message="Checking '@{jarfile}' against source folder '${common.dir}/contrib/@{name}/src/java'"/>-->
+ <property name="@{classpath.property}" location="@{jarfile}"/>
+ <uptodate property="@{property}" targetfile="@{jarfile}">
+ <srcfiles dir="${common-solr.dir}/contrib/@{name}/src/main/java" includes="**/*.java"/>
+ </uptodate>
</sequential>
</macrodef>
+
- <!-- setup proxy for download tasks -->
- <condition property="proxy.specified">
- <or>
- <isset property="proxy.host"/>
- <isset property="proxy.port"/>
- <isset property="proxy.user"/>
- </or>
- </condition>
-
- <target name="proxy.setup" if="proxy.specified">
- <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.user}" proxypassword="${proxy.password}"/>
- </target>
-
-
- <target name="clean-contrib"
- description="Cleans all contrib modules and their tests">
- <contrib-crawl target="clean"/>
- </target>
-
- <target name="build-contrib"
- description="Builds all contrib modules and their tests">
- <contrib-crawl target="build"/>
- </target>
-
- <target name="test-contrib" depends="build-contrib">
- <contrib-crawl target="test" failonerror="true"/>
- </target>
-
- <target name="dist-contrib" description="Make the contribs ready for distribution">
- <contrib-crawl target="dist" failonerror="true" />
- </target>
-
- <target name="example-contrib" description="Tell the contrib to add their stuff to examples">
- <contrib-crawl target="example" failonerror="true" />
- </target>
-
- <!-- Creates a Manifest file for Jars and WARs -->
- <target name="make-manifest">
- <!-- If possible, include the svnversion -->
- <exec dir="." executable="${svnversion.exe}" outputproperty="svnversion" failifexecutionfails="false">
- <arg line="."/>
- </exec>
-
- <!-- no description, don't advertise -->
- <mkdir dir="${dest}/META-INF/" />
- <manifest mode="replace" file="${dest}/META-INF/MANIFEST.MF">
- <!--
- http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#JAR%20Manifest
- http://java.sun.com/j2se/1.5.0/docs/guide/versioning/spec/versioning2.html
- http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Package.html
- http://java.sun.com/j2se/1.5.0/docs/api/java/util/jar/package-summary.html
- http://java.sun.com/developer/Books/javaprogramming/JAR/basics/manifest.html
- -->
- <!-- Don't set 'Manifest-Version' it identifies the version of the
- manifest file format, and should always be 1.0 (the default)
-
- Don't set 'Created-by' attribute, its purpose is
- to identify the version of java used to build the jar,
- which ant will do by default.
-
- Ant will happily override these with bogus strings if you
- tell it to, so don't.
-
- NOTE: we don't use section info because all of our manifest data
- applies to the entire jar/war ... no package specific info.
- -->
- <attribute name="Extension-Name"
- value="org.apache.solr"/>
- <attribute name="Specification-Title"
- value="Apache Solr Search Server"/>
- <!-- spec version must match "digit+{.digit+}*" -->
- <attribute name="Specification-Version"
- value="${specversion}"/>
- <attribute name="Specification-Vendor"
- value="The Apache Software Foundation"/>
- <attribute name="Implementation-Title"
- value="org.apache.solr"/>
- <!-- impl version can be any string -->
- <attribute name="Implementation-Version"
- value="${version} ${svnversion} - ${user.name} - ${DSTAMP} ${TSTAMP}"/>
- <attribute name="Implementation-Vendor"
- value="The Apache Software Foundation"/>
- <attribute name="X-Compile-Source-JDK"
- value="${java.compat.version}"/>
- <attribute name="X-Compile-Target-JDK"
- value="${java.compat.version}"/>
- </manifest>
- </target>
-
- <target name="maven.ant.tasks-check">
- <fail unless="maven.ant.tasks.present">#
- ##########################################################################
- Maven ant tasks not found.
-
- Please download the Maven ant tasks JAR (maven-ant-tasks-2.1.1.jar)
- from http://maven.apache.org/ant-tasks/download.html and add it to your
- $$HOME/.ant/lib/ directory, or to your $$ANT_HOME/lib/ directory, or
- to your $$CLASSPATH, or add "-lib /path/to/maven-ant-tasks-2.1.1.jar"
- to the ant command.
- ##########################################################################
- </fail>
- </target>
- <!-- Validation -->
+ <target name="validate" depends="validate-solr"/>
+ <target name="validate-solr" depends="check-legal-solr" unless="validated-solr"/>
+
+ <target name="check-legal-solr" depends="compile-tools">
+ <java classname="org.apache.lucene.validation.DependencyChecker" failonerror="true" fork="true">
+ <classpath>
+ <path refid="tools.runtime.classpath" />
+ </classpath>
+ <!-- TODO: it might be better to just automatically find all directories that contain jar files, but that could take a
+ long time. This should be faster, but we could miss a directory
+ -->
+ <!-- Solr -->
+ <arg value="-c" />
+ <arg value="${basedir}/lib" />
+ <arg value="-c" />
+ <arg value="${basedir}/contrib/analysis-extras/lib" />
+ <arg value="-c" />
+ <arg value="${basedir}/contrib/clustering/lib" />
+ <arg value="-c" />
+ <arg value="${basedir}/contrib/dataimporthandler/lib" />
+ <arg value="-c" />
++ <arg value="${basedir}/contrib/dataimporthandler-extras/lib" />
++ <arg value="-c" />
+ <arg value="${basedir}/contrib/extraction/lib" />
+ <arg value="-c" />
+ <arg value="${basedir}/contrib/uima/lib" />
+ <arg value="-c" />
+ <arg value="${basedir}/example/example-DIH/solr/db/lib" />
+ <arg value="-c" />
+ <arg value="${basedir}/example/example-DIH/solr/mail/lib" />
+ <arg value="-c" />
+ <arg value="${basedir}/example/example/lib" />
+ <arg value="-c" />
+ <arg value="${basedir}/src/test-files/solr/lib" />
+ </java>
+ </target>
-
</project>
diff --cc solr/contrib/analysis-extras/build.xml
index d4c455e4186,6ec8ecdbaa8..07f8d2fb2cc
--- a/solr/contrib/analysis-extras/build.xml
+++ b/solr/contrib/analysis-extras/build.xml
@@@ -23,37 -27,185 +23,37 @@@
Additional analysis components
</description>
- <property name="src.dir" location="src/java"/>
- <property name="tests.src.dir" location="src/test"/>
- <property name="example.local" value="example"/>
-
- <!-- support for the additional analyzers modules -->
- <path id="modules.classpath">
- <pathelement location="${common-solr.dir}/../modules/analysis/build/icu/classes/java" />
- <pathelement location="${common-solr.dir}/../modules/analysis/build/smartcn/classes/java" />
- <pathelement location="${common-solr.dir}/../modules/analysis/build/stempel/classes/java" />
- </path>
-
- <target name="prep-module-jars">
- <subant target="jar" inheritall="false" failonerror="true">
- <fileset dir="${common-solr.dir}/../modules/analysis/icu" includes="build.xml" />
- <fileset dir="${common-solr.dir}/../modules/analysis/smartcn" includes="build.xml" />
- <fileset dir="${common-solr.dir}/../modules/analysis/stempel" includes="build.xml" />
- </subant>
- </target>
-
- <target name="module-jars-to-solr" depends="prep-module-jars">
- <mkdir dir="${lucene-libs}"/>
- <copy todir="${lucene-libs}" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
- <fileset dir="${common-solr.dir}/../modules/analysis/build/icu">
- <include name="lucene-analyzers-icu-${version}.jar" />
- </fileset>
- <fileset dir="${common-solr.dir}/../modules/analysis/build/smartcn">
- <include name="lucene-analyzers-smartcn-${version}.jar" />
- </fileset>
- <fileset dir="${common-solr.dir}/../modules/analysis/build/stempel">
- <include name="lucene-analyzers-stempel-${version}.jar" />
- </fileset>
- </copy>
- </target>
-
- <path id="common.classpath">
- <fileset dir="lib"/>
- <pathelement location="${solr-path}/build/solr"/>
- <pathelement location="${solr-path}/build/solrj"/>
- <path refid="lucene.classpath"/>
- <path refid="modules.classpath"/>
- <fileset dir="${solr-path}/lib" includes="*.jar"/>
- </path>
-
- <path id="test.classpath">
- <pathelement path="${dest}/classes"/>
- <pathelement path="${dest}/test-classes"/>
- <pathelement path="${java.class.path}"/>
- <pathelement location="${common-solr.dir}/build/test-framework"/> <!-- include solr test code -->
- <pathelement location="${common-solr.dir}/../lucene/build/classes/test-framework" /> <!-- include some lucene test code -->
- <path refid="common.classpath"/>
- </path>
-
- <target name="clean">
- <delete failonerror="false" dir="${dest}"/>
++ <property name="src.dir" location="src/main/java"/>
++ <property name="tests.src.dir" location="src/test/java"/>
+ <property name="tests.userdir" location="src/test-files"/>
- <!-- example doesn't create this anymore, but clean it up
- if it's still there from an old build
- -->
- <delete dir="example/lib" />
- <delete dir="${lucene-libs}" />
- </target>
-
-
- <target name="init" depends="module-jars-to-solr">
- <mkdir dir="${dest}/classes"/>
-
- <mkdir dir="${build.javadoc}"/>
- <subant target="compileTestFramework">
- <fileset dir="${solr-path}" includes="build.xml"/>
- </subant>
- <subant target="make-manifest">
- <fileset dir="${solr-path}" includes="build.xml"/>
- </subant>
- </target>
+ <import file="../contrib-build.xml"/>
+ <module-uptodate name="analysis/icu" jarfile="${common.dir}/../modules/analysis/build/icu/lucene-analyzers-icu-${version}.jar"
+ property="analyzers-icu.uptodate" classpath.property="analyzers-icu.jar"/>
+ <module-uptodate name="analysis/smartcn" jarfile="${common.dir}/../modules/analysis/build/smartcn/lucene-analyzers-smartcn-${version}.jar"
+ property="analyzers-smartcn.uptodate" classpath.property="analyzers-smartcn.jar"/>
+ <module-uptodate name="analysis/stempel" jarfile="${common.dir}/../modules/analysis/build/stempel/lucene-analyzers-stempel-${version}.jar"
+ property="analyzers-stempel.uptodate" classpath.property="analyzers-stempel.jar"/>
- <target name="compile" depends="init">
- <solr-javac destdir="${dest}/classes"
- classpathref="common.classpath">
- <src path="src/java"/>
- </solr-javac>
- </target>
-
- <target name="build" depends="compile">
- <solr-jar destfile="${dest}/${fullnamever}.jar" basedir="${dest}/classes"
- manifest="../../${dest}/META-INF/MANIFEST.MF"/>
- </target>
-
- <target name="compileTests" depends="compile">
- <solr-javac destdir="${dest}/test-classes"
- classpathref="test.classpath">
- <src path="src/test"/>
- </solr-javac>
- <!-- Copy any data files present to the classpath -->
- <copy todir="${dest}/test-classes">
- <fileset dir="src/test-files" excludes="**/*.java"/>
- </copy>
- </target>
-
- <target name="example" depends="build,dist">
- <!-- this task use to copy lib's but that's no longer needed because
- ../lib and ../lib/downloads are now included explicitly by
- example/conf/solrconfig.xml
- -->
- </target>
-
-
- <target name="test" depends="compileTests">
- <mkdir dir="${junit.output.dir}"/>
-
- <junit printsummary="no"
- haltonfailure="no"
- maxmemory="512M"
- errorProperty="tests.failed"
- failureProperty="tests.failed"
- dir="${junit.output.dir}"
- tempdir="${junit.output.dir}"
- forkmode="perBatch"
- >
- <sysproperty key="java.util.logging.config.file" value="${common-solr.dir}/testlogging.properties"/>
- <sysproperty key="tests.luceneMatchVersion" value="${tests.luceneMatchVersion}"/>
- <sysproperty key="tests.codecprovider" value="${tests.codecprovider}"/>
- <sysproperty key="tests.codec" value="${tests.codec}"/>
- <sysproperty key="tests.locale" value="${tests.locale}"/>
- <sysproperty key="tests.timezone" value="${tests.timezone}"/>
- <sysproperty key="tests.multiplier" value="${tests.multiplier}"/>
- <sysproperty key="tests.seed" value="${tests.seed}"/>
- <sysproperty key="tests.verbose" value="${tests.verbose}"/>
- <sysproperty key="tests.iter" value="${tests.iter}"/>
- <!-- set whether or not nightly tests should run -->
- <sysproperty key="tests.nightly" value="${tests.nightly}"/>
- <sysproperty key="jetty.testMode" value="1"/>
- <sysproperty key="tempDir" file="${junit.output.dir}"/>
- <sysproperty key="testmethod" value="${testmethod}"/>
- <jvmarg line="${args}"/>
- <formatter classname="${junit.details.formatter}" usefile="false" if="junit.details"/>
- <classpath refid="test.classpath"/>
- <assertions>
- <enable package="org.apache.lucene"/>
- <enable package="org.apache.solr"/>
- </assertions>
- <formatter type="${junit.formatter}"/>
- <batchtest fork="yes" todir="${junit.output.dir}" unless="testcase">
- <fileset dir="src/test" includes="${junit.includes}"/>
- </batchtest>
- <batchtest fork="yes" todir="${junit.output.dir}" if="testcase">
- <fileset dir="src/test" includes="**/${testcase}.java"/>
- </batchtest>
- </junit>
+ <path id="classpath">
+ <pathelement path="${analyzers-icu.jar}"/>
+ <pathelement path="${analyzers-smartcn.jar}"/>
+ <pathelement path="${analyzers-stempel.jar}"/>
+ <path refid="solr.base.classpath"/>
+ </path>
- <fail if="tests.failed">Tests failed!</fail>
+ <target name="compile-analyzers-icu" unless="analyzers-icu.uptodate">
+ <ant dir="${common.dir}/../modules/analysis/icu" target="default" inheritAll="false"/>
</target>
- <target name="dist" depends="build">
- <!--
- <copy file="${dest}/${fullnamever}.jar" todir="${solr-path}/build/web/WEB-INF/lib"/>
- <copy todir="${solr-path}/build/web/WEB-INF/lib" flatten="true">
- <fileset dir="lib">
- <include name="**/*.jar"/>
- </fileset>
- </copy>
- -->
- <copy file="${dest}/${fullnamever}.jar" todir="${solr-path}/dist"/>
+ <target name="compile-analyzers-smartcn" unless="analyzers-smartcn.uptodate">
+ <ant dir="${common.dir}/../modules/analysis/smartcn" target="default" inheritAll="false"/>
</target>
- <target name="javadoc">
- <sequential>
- <mkdir dir="${build.javadoc}/contrib-${name}"/>
-
- <path id="javadoc.classpath">
- <path refid="common.classpath"/>
- </path>
-
- <invoke-javadoc
- destdir="${build.javadoc}/contrib-${name}"
- title="${Name} ${version} contrib-${fullnamever} API">
- <sources>
- <packageset dir="src/java"/>
- </sources>
- </invoke-javadoc>
- </sequential>
+ <target name="compile-analyzers-stempel" unless="analyzers-stempel.uptodate">
+ <ant dir="${common.dir}/../modules/analysis/stempel" target="default" inheritAll="false"/>
</target>
+ <target name="compile-core" depends="compile-analyzers-icu, compile-analyzers-smartcn, compile-analyzers-stempel, solr-contrib-build.compile-core"/>
</project>
diff --cc solr/contrib/contrib-build.xml
index 252f357eb60,00000000000..f30881f601d
mode 100644,000000..100644
--- a/solr/contrib/contrib-build.xml
+++ b/solr/contrib/contrib-build.xml
@@@ -1,49 -1,0 +1,49 @@@
+<?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-contrib-build">
+ <!-- TODO: adjust build.dir/dist.dir appropriately when a contrib project is run individually -->
+ <property name="build.dir" location="../../build/contrib/${ant.project.name}"/>
- <property name="dist.dir" location="../../dist/"/>
++ <property name="dist.dir" location="../../dist"/>
+
+ <import file="../common-build.xml"/>
+
+ <target name="build-solr" unless="solr.core.compiled">
+ <ant dir="${common-solr.dir}" target="compile-test" inheritAll="false"/>
+ <!-- set the property for this ant execution to speed up later tasks depending on this -->
+ <property name="solr.core.compiled" value="true"/>
+ </target>
+
+ <target name="compile-core" depends="build-solr, common.compile-core"/>
+
+ <macrodef name="solr-contrib-uptodate">
+ <attribute name="name"/>
+ <attribute name="property" default="solr-@{name}.uptodate"/>
+ <attribute name="classpath.property" default="solr-@{name}.jar"/>
+ <!-- set jarfile only, if the target jar file has no generic name -->
+ <attribute name="jarfile" default="${common-solr.dir}/build/contrib/solr-@{name}/apache-solr-@{name}-${version}.jar"/>
+ <sequential>
- <!--<echo message="Checking '@{jarfile}' against source folder '${common.dir}/contrib/@{name}/src/java'"/>-->
++ <!--<echo message="Checking '@{jarfile}' against source folder '${common.dir}/contrib/@{name}/src/main/java'"/>-->
+ <property name="@{classpath.property}" location="@{jarfile}"/>
+ <uptodate property="@{property}" targetfile="@{jarfile}">
+ <srcfiles dir="../@{name}/src/main/java" includes="**/*.java"/>
+ </uptodate>
+ </sequential>
+ </macrodef>
+</project>
diff --cc solr/src/test-framework/org/apache/solr/JSONTestUtil.java
index 8bd5a79c8f3,deb681d99f7..1900e13c8c6
--- a/solr/src/test-framework/org/apache/solr/JSONTestUtil.java
+++ b/solr/src/test-framework/org/apache/solr/JSONTestUtil.java
@@@ -25,7 -25,44 +25,44 @@@ import java.util.*
public class JSONTestUtil {
+ /**
+ * Default delta used in numeric equality comparisons for floats and doubles.
+ */
+ public final static double DEFAULT_DELTA = 1e-5;
+
- /**
++ /**
+ * comparison using default delta
+ * @see #DEFAULT_DELTA
+ * @see #match(String,String,double)
+ */
public static String match(String input, String pathAndExpected) throws Exception {
+ return match(input, pathAndExpected, DEFAULT_DELTA);
+ }
+
- /**
++ /**
+ * comparison using default delta
+ * @see #DEFAULT_DELTA
+ * @see #match(String,String,String,double)
+ */
+ public static String match(String path, String input, String expected) throws Exception {
+ return match(path, input, expected, DEFAULT_DELTA);
+ }
+
+ /**
+ * comparison using default delta
+ * @see #DEFAULT_DELTA
+ * @see #matchObj(String,Object,Object,double)
+ */
+ public static String matchObj(String path, Object input, Object expected) throws Exception {
+ return matchObj(path,input,expected, DEFAULT_DELTA);
+ }
+
+ /**
+ * @param input JSON Structure to parse and test against
+ * @param pathAndExpected JSON path expression + '==' + expected value
+ * @param delta tollerance allowed in comparing float/double values
+ */
+ public static String match(String input, String pathAndExpected, double delta) throws Exception {
int pos = pathAndExpected.indexOf("==");
String path = pos>=0 ? pathAndExpected.substring(0,pos) : null;
String expected = pos>=0 ? pathAndExpected.substring(pos+2) : pathAndExpected;
@@@ -37,17 -80,14 +80,14 @@@
Object expectObj = ObjectBuilder.fromJSON(expected);
return matchObj(path, inputObj, expectObj);
}
-
+
/**
- public static Object fromJSON(String json) {
- try {
- Object out = ObjectBuilder.fromJSON(json);
- } finally {
-
- }
- **/
-
- public static String matchObj(String path, Object input, Object expected) throws Exception {
+ * @param path JSON path expression
+ * @param input JSON Structure
+ * @param expected expected JSON Object
+ * @param delta tollerance allowed in comparing float/double values
+ */
+ public static String matchObj(String path, Object input, Object expected, double delta) throws Exception {
CollectionTester tester = new CollectionTester(input);
boolean reversed = path.startsWith("!");
String positivePath = reversed ? path.substring(1) : path;
diff --cc solr/src/test-framework/org/apache/solr/SolrTestCaseJ4.java
index da5d837af74,f053c3c1f8d..efc0eef7678
--- a/solr/src/test-framework/org/apache/solr/SolrTestCaseJ4.java
+++ b/solr/src/test-framework/org/apache/solr/SolrTestCaseJ4.java
@@@ -374,15 -378,29 +378,29 @@@ public abstract class SolrTestCaseJ4 ex
}
}
- /** Validates a query matches some JSON test expressions and closes the query.
- * The text expression is of the form path:JSON. To facilitate easy embedding
- * in Java strings, the JSON can have double quotes replaced with single quotes.
- *
- * Please use this with care: this makes it easy to match complete structures, but doing so
- * can result in fragile tests if you are matching more than what you want to test.
- *
- **/
- /**
++ /**
+ * Validates a query matches some JSON test expressions using the default double delta tollerance.
+ * @see JSONTestUtil#DEFAULT_DELTA
+ * @see #assertJQ(SolrQueryRequest,double,String...)
+ */
public static void assertJQ(SolrQueryRequest req, String... tests) throws Exception {
+ assertJQ(req, JSONTestUtil.DEFAULT_DELTA, tests);
+ }
- /**
- * Validates a query matches some JSON test expressions and closes the
- * query. The text expression is of the form path:JSON. To facilitate
- * easy embedding in Java strings, the JSON can have double quotes
++ /**
++ * Validates a query matches some JSON test expressions and closes the
++ * query. The text expression is of the form path:JSON. To facilitate
++ * easy embedding in Java strings, the JSON can have double quotes
+ * replaced with single quotes.
+ * <p>
- * Please use this with care: this makes it easy to match complete
- * structures, but doing so can result in fragile tests if you are
++ * Please use this with care: this makes it easy to match complete
++ * structures, but doing so can result in fragile tests if you are
+ * matching more than what you want to test.
+ * </p>
+ * @param req Solr request to execute
+ * @param delta tollerance allowed in comparing float/double values
+ * @param tests JSON path expression + '==' + expected value
+ */
+ public static void assertJQ(SolrQueryRequest req, double delta, String... tests) throws Exception {
SolrParams params = null;
try {
params = req.getParams();