Skip to content

Apache Lucene open-source search software

LUCENE-5465: Solr Contrib map-reduce breaks Manifest of all other JAR files by adding a broken Main-Class attribute

Steven Rowe114ce52b03b1
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index aeb8b286c85..10ec410d1d1 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -228,6 +228,10 @@ Build
* LUCENE-5411: Upgrade to released JFlex 1.5.0; stop requiring
a locally built JFlex snapshot jar. (Steve Rowe)
+* LUCENE-5465: Solr Contrib "map-reduce" breaks Manifest of all other
+ JAR files by adding a broken Main-Class attribute.
+ (Uwe Schindler, Steve Rowe)
+
Bug fixes
* LUCENE-5285: Improved highlighting of multi-valued fields with
diff --git a/lucene/common-build.xml b/lucene/common-build.xml
index d64139a2066..ee3a3dd0585 100644
--- a/lucene/common-build.xml
+++ b/lucene/common-build.xml
@@ -56,7 +56,7 @@
<property name="dev.version" value="${dev.version.base}-${dev.version.suffix}"/>
<property name="version" value="${dev.version}"/>
<property name="spec.version" value="${version}"/>
-
+
<property name="year" value="2000-${current.year}"/>
<!-- Lucene modules unfortunately don't have the "lucene-" prefix, so we add it if no prefix is given in $name: -->
@@ -576,6 +576,7 @@
<attribute name="implementation.title"/>
<attribute name="spec.version"/>
<attribute name="manifest.file" default="${manifest.file}"/>
+ <element name="additional-manifest-attributes" optional="true"/>
<sequential>
<!-- If possible, include the svnversion -->
<exec dir="." executable="${svnversion.exe}" outputproperty="svnversion" failifexecutionfails="false"/>
@@ -615,7 +616,7 @@
value="The Apache Software Foundation"/>
<attribute name="X-Compile-Source-JDK" value="${javac.source}"/>
<attribute name="X-Compile-Target-JDK" value="${javac.target}"/>
- <attribute name="Main-Class" value="${main.class}"/>
+ <additional-manifest-attributes />
</manifest>
</sequential>
</macrodef>
@@ -629,19 +630,24 @@
<attribute name="implementation.title" default="org.apache.lucene"/>
<attribute name="spec.version" default="${spec.version}"/>
<attribute name="manifest.file" default="${manifest.file}"/>
- <element name="nested" optional="true" implicit="true"/>
+ <element name="filesets" optional="true"/>
+ <element name="jarify-additional-manifest-attributes" optional="true"/>
<sequential>
<build-manifest title="@{title}"
implementation.title="@{implementation.title}"
spec.version="@{spec.version}"
- manifest.file="@{manifest.file}"/>
+ manifest.file="@{manifest.file}">
+ <additional-manifest-attributes>
+ <jarify-additional-manifest-attributes />
+ </additional-manifest-attributes>
+ </build-manifest>
<jar destfile="@{destfile}"
basedir="@{basedir}"
manifest="@{manifest.file}"
excludes="@{excludes}">
<metainf dir="@{metainf.source.dir}" includes="LICENSE.txt,NOTICE.txt"/>
- <nested />
+ <filesets />
</jar>
</sequential>
</macrodef>
@@ -1400,7 +1406,9 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
<sequential>
<mkdir dir="${build.dir}" />
<jarify basedir="${src.dir}" destfile="${build.dir}/${final.name}-src.jar">
- <fileset dir="${resources.dir}" erroronmissingdir="no"/>
+ <filesets>
+ <fileset dir="${resources.dir}" erroronmissingdir="no"/>
+ </filesets>
</jarify>
</sequential>
</target>
diff --git a/solr/common-build.xml b/solr/common-build.xml
index 5d0d8d04aea..e2924f66ce8 100644
--- a/solr/common-build.xml
+++ b/solr/common-build.xml
@@ -202,7 +202,8 @@
<attribute name="implementation.title" default="org.apache.solr"/>
<attribute name="spec.version" default="${spec.version}"/>
<attribute name="manifest.file" default="${manifest.file}"/>
- <element name="nested" optional="true" implicit="true"/>
+ <element name="solr-jarify-filesets" optional="true"/>
+ <element name="solr-jarify-additional-manifest-attributes" optional="true"/>
<sequential>
<jarify basedir="@{basedir}" destfile="@{destfile}"
title="@{title}" excludes="@{excludes}"
@@ -210,7 +211,12 @@
implementation.title="@{implementation.title}"
spec.version="@{spec.version}"
manifest.file="@{manifest.file}">
- <nested/>
+ <filesets>
+ <solr-jarify-filesets />
+ </filesets>
+ <jarify-additional-manifest-attributes>
+ <solr-jarify-additional-manifest-attributes />
+ </jarify-additional-manifest-attributes>
</jarify>
</sequential>
</macrodef>
@@ -331,7 +337,9 @@
<sequential>
<mkdir dir="${build.dir}"/>
<solr-jarify basedir="${src.dir}" destfile="${build.dir}/${final.name}-src.jar">
- <fileset dir="${resources.dir}" erroronmissingdir="no"/>
+ <solr-jarify-filesets>
+ <fileset dir="${resources.dir}" erroronmissingdir="no"/>
+ </solr-jarify-filesets>
</solr-jarify>
</sequential>
</target>
diff --git a/solr/contrib/map-reduce/build.xml b/solr/contrib/map-reduce/build.xml
index ea2646b15fe..069b3aafff2 100644
--- a/solr/contrib/map-reduce/build.xml
+++ b/solr/contrib/map-reduce/build.xml
@@ -27,9 +27,7 @@
<import file="../contrib-build.xml"/>
- <property name="main.class" value="org.apache.solr.hadoop.MapReduceIndexerTool" />
-
- <solr-contrib-uptodate name="extraction"
+ <solr-contrib-uptodate name="extraction"
property="solr-extraction.uptodate"
classpath.property="solr-cell.jar"/>
@@ -143,6 +141,16 @@
</target>
<target name="compile-core" depends="resolve-extraction-libs, resolve-morphlines-core-libs, resolve-morphlines-cell-libs, compile-solr-extraction, compile-morphlines-core, compile-morphlines-cell, solr-contrib-build.compile-core"/>
+
+ <property name="main.class" value="org.apache.solr.hadoop.MapReduceIndexerTool" />
+ <target name="jar-core" depends="compile-core">
+ <solr-jarify>
+ <solr-jarify-additional-manifest-attributes>
+ <attribute name="Main-Class" value="${main.class}"/>
+ </solr-jarify-additional-manifest-attributes>
+ </solr-jarify>
+ </target>
+
<target name="dist" depends="common-solr.dist"/>
</project>