In my Java project (using Maven) I have Gate 8.0 as basis for doing some natural language processing and it loads the Stemmer_Snowball plugin (see plugin list). As the documentation states the Stemmers are processing resource wrappers over the Snowball stemmers (http://snowball.tartarus.org).
Gate plus the stemmers worked well until I added Hibernate Search ORM 5.9 (thus Lucene) dependency to the project:
mvn test-compile dependency:tree
...
...
[INFO] +- org.hibernate:hibernate-search-orm:jar:5.9.0.Final:compile
[INFO] | \- org.hibernate:hibernate-search-engine:jar:5.9.0.Final:compile
[INFO] | +- org.apache.lucene:lucene-core:jar:5.5.5:compile
[INFO] | +- org.apache.lucene:lucene-misc:jar:5.5.5:compile
[INFO] | +- org.apache.lucene:lucene-analyzers-common:jar:5.5.5:compile
[INFO] | +- org.apache.lucene:lucene-facet:jar:5.5.5:compile
[INFO] | | \- org.apache.lucene:lucene-queries:jar:5.5.5:compile
It turns out the lucene-analyzers-common
package overrides some old version of the org.tartarus.snowball
packages (see the package summary for more info) and now the custom Lucene Snowball package and the original Snowball package are incompatible:
- Original Snowball version: https://github.com/snowballstem/snowball/tree/master/java/org/tartarus/snowball
- Lucene Snowball version: https://github.com/apache/lucene-solr/tree/master/lucene/analysis/common/src/java/org/tartarus/snowball
Note that even that Lucene overrides the Snowball package classes it keeps the original package name which makes the libraries incompatible.
I want to use both Gate (with original Snowball stemmers) and Hibernate Search (with custom Lucene Snowball stemmers) in my project. Maven gracefully stops us from loading multiple versions of the same package so what should I do in that case?
Update: I added an issue on Lucene's issue tracker.