Jar packaging issue

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Jar packaging issue

karl.wright
Hello anyone,

We recently ran into something people might not be fully aware of.  Specifically, because codec jars require META-INF/services files in order to be discovered, and each codec  has the same files, it's not a straightforward operation to glom all the Lucene jars of interest into one uber-jar, because some of this info is lost.  Putting all the dependencies together in one jar is one of the few things Maven is really good at, so this is a shame. ;-)

This can be worked around by essentially creating a new org.apache.lucene.codecs.PostingFormat file, but that's not an easy operation with the build tools people use.

Any suggestions?

Karl

Reply | Threaded
Open this post in threaded view
|

Re: Jar packaging issue

Nick Burch-2
On Mon, 4 Feb 2013, [hidden email] wrote:
> We recently ran into something people might not be fully aware of.
> Specifically, because codec jars require META-INF/services files in
> order to be discovered, and each codec has the same files, it's not a
> straightforward operation to glom all the Lucene jars of interest into
> one uber-jar, because some of this info is lost.  Putting all the
> dependencies together in one jar is one of the few things Maven is
> really good at, so this is a shame. ;-)

Apache Tika has the same issue. The trick is to use a different plugin
when rolling up into a single jar, you need one that correctly handles
service files. IIRC, the maven-shade-plugin can handle it properly

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]