I have a library Eclipse project/workspace containing functionality that is occasionally delivered to a customer. We're all researchers so this is done very informally; I make a JAR and a Word file with documentation, and send it to them.
I prefer to send them a JAR file that only contains what they actually need, to simplify things. If they need classes X, Y, Z and W, then I send a JAR file containing X, Y, Z, and W, as well as all of the classes that those depend on.
Right now I am doing this in a hopelessly manual way (I create a new project, drag over X, Y, Z, and W, and then drag over anything I need to fix the compiler errors). What's the right way to automate it in Eclipse?
EDIT: Just to be clear, the Eclipse projects involved contain many more classes than are actually needed by the customer.
EDIT: Also, there is no reflection involved; I can be confident that the compiler knows what is going on. I'm the one who wrote the code, and I avoid reflection like the plague. The only place I used reflection is to imitate Collections.toArray(), and in that case the only class that could cause a problem is one that the user provided.