Skip to content

Apache Lucene open-source search software

SOLR-2487: Do not include slf4j-jdk14 jar in WAR

Jan Høydahl49d36059461c
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 9f51497403f..84ddd449a44 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -477,6 +477,10 @@ Other Changes
AppendedSolrParams into factory methods.
(David Smiley via hossman)
+Build
+----------------------
+* SOLR-2487: Add build target to package war without slf4j jars (janhoy)
+
================== 3.5.0 ==================
New Features
diff --git a/solr/build.xml b/solr/build.xml
index d3f57c0d9c6..8b76d1cfc6c 100644
--- a/solr/build.xml
+++ b/solr/build.xml
@@ -291,7 +291,16 @@
</ant>
</target>
- <target name="prepare-release"
+ <target name="dist-war-excl-slf4j"
+ description="Creates a Solr WAR Distribution file, excluding slf4j bindings.">
+ <ant dir="webapp" target="dist" inheritall="false">
+ <propertyset refid="uptodate.and.compiled.properties"/>
+ <property name="exclude.from.war" value="*over-slf4j*,slf4j-jdk14*" />
+ <property name="solr.war.suffix" value="-excl-slf4j" />
+ </ant>
+ </target>
+
+ <target name="prepare-release"
depends="clean, package, generate-maven-artifacts, sign-artifacts"/>
<!-- make a distribution -->
diff --git a/solr/webapp/build.xml b/solr/webapp/build.xml
index 91682cda4a3..ec5e7e8b17f 100644
--- a/solr/webapp/build.xml
+++ b/solr/webapp/build.xml
@@ -20,6 +20,9 @@
<import file="../common-build.xml"/>
+ <property name="exclude.from.war" value="" />
+ <property name="solr.war.suffix" value="" />
+
<!-- Checks that all JSP files in the webapp compile successfully using Jetty's Jasper -->
<target name="test" depends="compile-test-solr-core">
<property name="jsp.target" location="${dest}/jsp-temp" />
@@ -47,24 +50,24 @@
implementation.title="org.apache.solr"
spec.version="${solr.spec.version}"/>
<ant dir="${common-solr.dir}" inheritall="false" target="contribs-add-to-war"/>
- <war destfile="${dist}/apache-solr-${version}.war"
+ <war destfile="${dist}/apache-solr-${version}${solr.war.suffix}.war"
webxml="web/WEB-INF/web.xml"
manifest="${dest}/META-INF/MANIFEST.MF">
- <lib dir="${common-solr.dir}/lib">
+ <lib dir="${common-solr.dir}/lib" excludes="${exclude.from.war}">
<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}">
+ <lib dir="${lucene-libs}" excludes="${exclude.from.war}"/>
+ <lib dir="${dist}" excludes="${exclude.from.war}">
<include name="apache-solr-solrj-${version}.jar" />
<include name="apache-solr-core-${version}.jar" />
</lib>
- <fileset dir="${dest}/web"/> <!-- contribs' additions -->
- <fileset dir="web" />
- <metainf dir="${common-solr.dir}" includes="LICENSE.txt,NOTICE.txt"/>
+ <fileset dir="${dest}/web" excludes="${exclude.from.war}"/> <!-- contribs' additions -->
+ <fileset dir="web" excludes="${exclude.from.war}"/>
+ <metainf dir="${common-solr.dir}" includes="LICENSE.txt,NOTICE.txt" excludes="${exclude.from.war}"/>
</war>
</target>