I'm not using Embedded Solr directly, I've seen several projects depending on Lucene as a Maven artifact and include also a dependency on some solr module as a general utility, for example to use some solr analysers. Let's say you had Lucene 2.4.1, when adding solr-analysers version 1.3.0 in the mix it appears to work well in testing, until the classloading order changes in an application server and you'll find out that maven will have added the solr-lucene-core artifact too, which looks like fine unless you know what's in there. The poor developer could have a hard time to find out that he is having two artifacts with different identifiers and different jar names containing same code at different versions, after noticing some undefined field or method.
I've learnt the lesson so I don't speak to help myself, but I think it would be an improvement and make life easier for others; Maven should take care of this but it's actually giving a false feeling of confidence in this case. Regards, Sanne 2009/12/9 Shalin Shekhar Mangar <shalinman...@gmail.com>: > On Wed, Dec 9, 2009 at 3:33 PM, Sanne Grinovero > <sanne.grinov...@gmail.com>wrote: > >> Why is Solr not depending directly on Lucene but repackaging the same >> classes? >> >> > Solr does depend on Lucene jars. We strive to package officially released > Lucene artifacts but sometimes the release schedule of Lucene and Solr are > different enough to build and package Lucene jars ourselves. The CHANGES.txt > in the Solr distribution has the version of Lucene used in that > distribution. For example, Solr 1.4 released with Lucene 2.9.1 > > Solr 1.4 has already released and we are free to upgrade Lucene jars in > trunk to any version we desire for further development. > > >> Sorry I've probably missed some important discussion. Whatever the >> reason for this decision, is it still a good reason? >> >> This gets new users in a hell of trouble sometimes, as some >> applications introduce Solr after having Lucene already on the >> classpath and it's not immediately obvious that differently named jars >> contain same named classes. >> > > Are you using Embedded Solr? Otherwise the Lucene jars are in the solr.war's > WEB-INF/lib directory and there is no chance of a conflict. > > -- > Regards, > Shalin Shekhar Mangar. >