languagetool-org / languagetool

Style and Grammar Checker for 25+ Languages
https://languagetool.org
GNU Lesser General Public License v2.1
11.87k stars 1.37k forks source link

Included lucene-gosen-ipadic not compatible with Lucene 5 #376

Open amake opened 8 years ago

amake commented 8 years ago

I use LanguageTool and some additional Lucene analysis components together in an app. While LanguageTool 3.2 bundles lucene-core 5.2.1, it also bundles lucene-gosen-ipadic 1.2.1 which is only compatible with Lucene 4 and earlier.

It appears that in LanguageTool you do not use the conflicting classes so it may not be a problem for you, but it causes issues in any project that wants to use LanguageTool as well as lucene-analysis-kuromoji (the Lucene Japanese analysis package).

Specifically, lucene-gosen-ipadic 1.2.1 includes old (pre-Lucene 5.0) versions of org.apache.lucene.analysis.ja.* classes. Including your version of lucene-gosen-ipadic as well as lucene-analysis-kuromoji puts conflicting versions on the classpath and (in our situation) causes NoSuchMethodErrors due to changes in signatures.

Maven does not appear to have a newer version of lucene-gosen-ipadic but the main project has already been updated for Lucene 5 if you build it yourself.

danielnaber commented 8 years ago

Thanks for your report. I've requested a new release at https://github.com/lucene-gosen/lucene-gosen/issues/5.

amake commented 7 years ago

Since upstream has even responded to the issue, we (the OmegaT project) have published it ourselves:

danielnaber commented 7 years ago

It seems LT cannot use it, or am I missing something? As LT is published on the central repo itself, it can only use dependencies also published there. Maybe you're aware of this and use the new artifact only for yourself?

amake commented 7 years ago

Sorry, I always use JCenter, which mirrors all of Maven Central, so I hadn't really paid much attention to where you were hosted or the restrictions entailed therein.

We use the artifact ourselves, and as it is available on JCenter (as opposed to just our Maven bucket on Bintray), we invite anyone else to use it if they are interested.

Since I doubt you would want to move future versions to JCenter just to gain access to this artifact, I understand if you pass.

danielnaber commented 7 years ago

I've upgraded to the recently updated version (6.2.1) of lucene-gosen - does this solve the problem so we can close this issue?

amake commented 7 years ago

No, I don't think so. My understanding is that lucene-gosen targets a particular version of Lucene, in this case 6.2.1, while you are still using Lucene 5.5.3. I'm surprised this works for you at all, but maybe you are only exercising a subset of lucene-gosen's functionality that uses APIs that haven't changed between Lucene 5.5 and 6.2.

The conflict between lucene-gosen 1.2 and Lucene 5.2 was very apparent because the former bundled some outdated Lucene classes; this is no longer the case with lucene-gosen 5.x and later, so I'm not able to immediately point out where a conflict is happening in the current configuration. But I'm fairly certain that this will blow up for anyone who happens to use the wrong parts of lucene-gosen.