2011-04-01 16:42:03 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
|
|
|
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
|
|
|
|
|
|
|
<!-- ===========================================
|
|
|
|
Deploy script for basic solr webapp for use by a vitro webapp.
|
|
|
|
Vitro should be deployed before this script is run.
|
|
|
|
=========================================== -->
|
|
|
|
|
|
|
|
<project name="vitroSolr" default="describe">
|
2011-06-28 23:47:44 +00:00
|
|
|
<property name="ant.task.dir" location="../utilities/buildutils"/>
|
2011-04-01 16:42:03 +00:00
|
|
|
<property name="solr.build.dir" location="."/>
|
|
|
|
<property name="solr.example.dir" location="${solr.build.dir}/exampleSolr" />
|
|
|
|
<property name="solr.context.config.example" location="${solr.build.dir}/exampleSolrContext.xml"/>
|
2011-05-16 21:58:24 +00:00
|
|
|
<property name="solr.war" location="${solr.build.dir}/apache-solr-3.1.0.war"/>
|
2011-04-01 16:42:03 +00:00
|
|
|
|
|
|
|
<!-- =================================
|
|
|
|
target: describe
|
|
|
|
================================= -->
|
|
|
|
|
|
|
|
<target name="describe" description="--> Describe the targets (this is the default).">
|
|
|
|
<echo>
|
2011-06-28 23:47:44 +00:00
|
|
|
deploy - Deploy solr service for use by vitro.
|
|
|
|
makeSolrjClientJar - Isolate solrj libraries in single jar.
|
2011-04-01 16:42:03 +00:00
|
|
|
</echo>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- =================================
|
|
|
|
target: deploy
|
|
|
|
================================= -->
|
|
|
|
|
|
|
|
<target name="deploy" depends="properties" description="Deploy solr service for use by vitro.">
|
2011-04-06 14:51:18 +00:00
|
|
|
<property name="solr.home" location="${vitro.home.directory}/solr"/>
|
2011-04-01 16:42:03 +00:00
|
|
|
<property name="solr.docbase" location="${solr.home}/solr.war"/>
|
|
|
|
<property name="solr.context.name" value="${webapp.name}solr"/>
|
|
|
|
<property name="solr.context.config" location="${solr.home}/${solr.context.name}.xml"/>
|
|
|
|
|
|
|
|
<!-- Create and copy the example directory to the solr.home directory. -->
|
|
|
|
<mkdir dir="${solr.home}"/>
|
|
|
|
<copy todir="${solr.home}">
|
|
|
|
<fileset dir="${solr.example.dir}" includes="**/*"/>
|
|
|
|
</copy>
|
|
|
|
|
|
|
|
<!-- Add the war file. -->
|
2011-04-04 20:02:54 +00:00
|
|
|
<copy tofile="${solr.docbase}">
|
2011-04-01 16:42:03 +00:00
|
|
|
<fileset file="${solr.war}"/>
|
|
|
|
</copy>
|
|
|
|
|
|
|
|
<!-- Create the context configuration XML with expanded properties. -->
|
|
|
|
<copy tofile="${solr.context.config}" filtering="true">
|
|
|
|
<fileset file="${solr.context.config.example}"/>
|
|
|
|
<filterchain>
|
|
|
|
<expandproperties />
|
|
|
|
</filterchain>
|
|
|
|
</copy>
|
|
|
|
|
|
|
|
<!-- Place context configuration XML in tomcat config directory. -->
|
2011-04-01 18:55:46 +00:00
|
|
|
<copy todir="${tomcat.home}/conf/Catalina/localhost">
|
2011-04-01 16:42:03 +00:00
|
|
|
<fileset file="${solr.context.config}"/>
|
|
|
|
</copy>
|
|
|
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- - - - - - - - - - - - - - - - - -
|
|
|
|
target: properties
|
|
|
|
- - - - - - - - - - - - - - - - - -->
|
|
|
|
<target name="properties">
|
2011-04-01 18:55:46 +00:00
|
|
|
<!--<property name="deploy.properties.file" location="deploy.properties" /> -->
|
|
|
|
<fail unless="deploy.properties.file"
|
|
|
|
message="The ant property deploy.properties.file must be defined to indicate the vitro deploy to create a solr service for." />
|
|
|
|
|
|
|
|
<fail message="There is no accessable deploy.properties file at "${deploy.properties.file}".">
|
2011-04-01 16:42:03 +00:00
|
|
|
<condition>
|
|
|
|
<not>
|
|
|
|
<available file="${deploy.properties.file}" />
|
|
|
|
</not>
|
|
|
|
</condition>
|
|
|
|
</fail>
|
|
|
|
|
|
|
|
<property file="${deploy.properties.file}" />
|
|
|
|
|
|
|
|
<fail unless="tomcat.home"
|
|
|
|
message="${deploy.properties.file} must contain a value for tomcat.home" />
|
|
|
|
<fail unless="webapp.name"
|
|
|
|
message="${deploy.properties.file} must contain a value for webapp.name" />
|
2011-04-06 14:51:18 +00:00
|
|
|
<fail unless="vitro.home.directory"
|
|
|
|
message="${deploy.properties.file} must contain a value for vitro.home.directory"/>
|
2011-04-01 16:42:03 +00:00
|
|
|
|
|
|
|
</target>
|
|
|
|
|
2011-06-28 23:47:44 +00:00
|
|
|
<target name="makeSolrjClientJar" >
|
|
|
|
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
|
|
|
|
classpath="${ant.task.dir}/jarjar.jar"/>
|
|
|
|
|
|
|
|
<jarjar jarfile="./solrjClient.jar">
|
|
|
|
<zipfileset src="./solrjClientLibs/apache-solr-core-3.1.0.jar"/>
|
|
|
|
<zipfileset src="./solrjClientLibs/apache-solr-solrj-3.1.0.jar"/>
|
|
|
|
<zipfileset src="./solrjClientLibs/commons-codec-1.4.jar"/>
|
|
|
|
<zipfileset src="./solrjClientLibs/commons-httpclient-3.1.jar"/>
|
|
|
|
<zipfileset src="./solrjClientLibs/commons-io-1.4.jar"/>
|
|
|
|
<zipfileset src="./solrjClientLibs/geronimo-stax-api_1.0_spec-1.0.1.jar"/>
|
|
|
|
<zipfileset src="./solrjClientLibs/jcl-over-slf4j-1.5.5.jar"/>
|
|
|
|
<zipfileset src="./solrjClientLibs/wstx-asl-3.2.7.jar"/>
|
|
|
|
|
|
|
|
<!-- leave the slf4j stuff out because it is broken by design -->
|
|
|
|
<rule pattern="org.apache.**" result="isoloated.org.apache.@1"/>
|
|
|
|
<rule pattern="org.codehaus.**" result="isoloated.org.codehaus.@1"/>
|
|
|
|
<rule pattern="com.ctc.**" result="isoloated.com.ctc.@1"/>
|
|
|
|
|
|
|
|
</jarjar>
|
|
|
|
</target>
|
2011-04-01 16:42:03 +00:00
|
|
|
|
2011-04-06 14:51:18 +00:00
|
|
|
</project>
|