Our build system at work is a little archaic, but there just isn't any time to rewrite it with anything more modern. As a result, I have to do some elbow twisting to get eclipse running smoothly with it. One of these contortions has to do with organizing the third party libraries we depend on.I start off with a directory called ThirdParty, under which I have a top level directory for each third party lib we use, e.g. commons-logging. Each third party directory will then have a sub-directory for each version we use, under which will be the jars for that lib plus a src.zip and docs.zip which contain the src and javadocs for use in eclipse. I find it better to keep them as archive files as it makes checkouts from source control a lot quicker, and I only ever browse their contents from within eclipse, which has no problem doing so. The nice thing about using the version number directories is that then the ThirdParty tree can be excluded from tagging/branching/etc. Since we never delete from ThirdParty, and the build files which are versioned have the right version number directory they depend on, the sytem as whole ends up acting versioned.e.g.
  • ThirdParty
    • commons-logging
      • 1.0.0
        • commons-logging.jar
        • commons-logging-api.jar
        • src.zip
        • docs.zip
      • 1.0.4
        • commons-logging.jar
        • commons-logging-api.jar
        • src.zip
        • docs.zip
    • commons-lang
      • 2.1
        • commons-lang-2.1.jar
        • src.zip
        • docs.zip
    • foo-bar
      • 3.4
        • foo-bar.jar
        • src.zip
        • docs.zip
        • deps
          • commons-logging.jar
If a lib has dependecies on other third parties, I simply stick those dependent libs in a subdir of the version called "deps". I really should do some dependency checking like Ivy or Maven, but no current need as this system is more for my eclipse browsing needs than it is for our build system. Ideally, I would prefer to use Ivy and/or Maven for something like this, but they didn't seem to have a way to specify the src/docs attachments. Someone please correct me if I'm wrong.Once this directory tree is all setup, then I run a bash script (genlibs.sh) in root of ThirdParty directory) to generate the xml files used by eclipse for defining User libraries, and attach this library to my project so that I can easily browse the src/javadoc for all our thirdparty libs. Since these files are generated, anyone in the team can also use them - we can't check them in because eclipse has no way of abstracting out paths in the user lib file, so unless everyone has the same path to ThirdParty, it won't work.Within eclipse preferences, Java -> Build Path -> User Libraries, import any of the xml files the script generated. The all.xml file has everything, and after importing one can delete and/or move items around to match the reality of how the libs are used in your project. Othewrise, an individual library file is also generated for each lib, so feel free to use those instead.Hope this helps others out, let me know if you make any improvements.