javaeclipselucene

Need Lucene 4.1.0 source jars or javadoc jars (to make developing with Lucene 4.1.0 in Eclipse usable)


How/where do I obtain the source jars (or javadoc jars) for Lucene 4.1.0?

I've just downloaded and untarred the latest version of Lucene from one of the mirrors listed at http://www.apache.org/dyn/closer.cgi/lucene/java/4.1.0, both lucene-4.1.0-src.tgz and lucene-4.1.0.tgz. I could easily add the 42 jars found in the latter to my Eclipse project.

Adding javadoc or sources is proving more vexing.

In the past, I somehow got a hold of source jars (each of which could be attached in Eclipse to the corresponding byte-compiled jar via Project.right.click/Properties/Java_Build_Path/Libraries). Since the sources already contain javadoc, that's all I needed to get hints from Eclipse upon hovering over types and method calls and life was good. (Plus I could always step into the source when needed).

Now, I poked my nose into lucene-4.1.0-src, just to see. No jars (src or otherwise), of course. But trying to compile requires me first to set up "ivy" (excuse me?) Since I'm on Fedora, after doing the prescribed ant ivy-bootstrap I followed some extra instructions to make ivy sort of work (essentially it boils down to echo rpm_mode=false >> ~/.ant/ant.conf). Still, ant jar-src at the top level fails ("/src/java doesn't exist"). ant clean compile does a bit better, but ant jar fails (invalid manifest).

Alternatively, lucene-4.1.0.tgz comes with 95MB of docs; How do I connect the 42 Lucene jars in Eclipse with these 5458 files totaling 95MB?


Solution

  • I would strongly recommend using Maven build tool with Eclipse integration because it not only adds all necessary libraries automatically, but also can automatically download all sources and javadocs of libraries being used.

    Small lifehack: personally me and my team use maven's pom.xml even in projects, where we use other build's capabilities (ant or IDE's specific).

    If you don't want to bother with maven, I'd like to introduce very helpful resources: http://search.maven.org/

    Here you can search (and find) almost any maven's libraries, with sources and javadocs.

    F.e. you can search for lucene-core and see what happen: http://search.maven.org/#search|ga|1|lucene-core

    On the Download tab you'll see sources.jar and javadoc.jar which you can download and add to your project.