[
https://issues.apache.org/jira/browse/LUCENE-5465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Steve Rowe updated LUCENE-5465:
-------------------------------
Attachment: LUCENE-5465.patch
bq. The correct way to fix this is: As the manifest creator is already a ANT
macro, we can use its feature to pass sub-elements (the attributes). Every
module that wants to define something like the main-class manifest attribute
can pass this directly as subelement to the macro.
The attached patch does this; as a result, only the Solr map-reduce contrib
gets the {{Main-Class}} manifest entry in its jar's {{META-INF/MANIFEST.MF}}.
I found that in order to pass nested elements through multiple layers of
macros, I had to un- and re-wrap the nested elements, using different element
names at each level - otherwise the final element gets placed at the wrong
level and Ant bitches that it doesn't expect the final element. So it's
kludgy, but it works.
> Solr Contrib "map-reduce" breaks Manifest of all other JAR files by adding a
> broken Main-Class attribute
> --------------------------------------------------------------------------------------------------------
>
> Key: LUCENE-5465
> URL: https://issues.apache.org/jira/browse/LUCENE-5465
> Project: Lucene - Core
> Issue Type: Bug
> Affects Versions: 4.7
> Reporter: Uwe Schindler
> Assignee: Uwe Schindler
> Attachments: LUCENE-5465.patch, LUCENE-5465.patch
>
>
> The addition of the Solr map-reduce contrib created a new "main.class"
> property, which is used by the jarify task. Currently only the map-reduce
> plugin actually set this property, soall other generated JAR files contain
> the following line:
> {{Main-Class: $\{main.class\}}}
> This happens because the ANT property "main.class" is undefined for most
> modules. Maybe this was added for one of the modules (I assume that the
> Solr-Morphline JARs use this attribute?). We should add some if/then/else
> structure to the {{<jarify/>}} task that only sets this property, if it is
> actually defined. Otherwise remove it (I think ANT does this automatically if
> its empty, means string-empty, have to try out)
> This leads to an error if the file is double-clicked or started via {{java
> -jar}}:
> {noformat}
> C:\Users\Uwe Schindler\Desktop>java -jar lucene-core-4.7.0.jar
> Fehler: Hauptklasse ${main.class} konnte nicht gefunden oder geladen werden
> {noformat}
> I opened this issue in LUCENE, because jar files from LUCENE and SOLR are
> affected.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]