I have a command line application which I need to reference from another jar file and what I don't want to do is copy and paste the existing code into the project that contains the source files for the other application, since this approach will result in maintainability issues.
I have thought about doing the following:
deploying 2 jar files; running the command line app as a Process (the problem with this approach is that I don't want to deal with orphan processes).
deploying 2 jar files; calling the main method of the command line app using reflection. (I'm not sure this is a good idea).
Somehow referencing the project that contains the source code for the command line application, and write an ant file that copies the class files into the jar file for the other application.
Which of this approach makes most sense? if the answer is #3, how exactly do I need to set up the eclipse project and/or write the ant file such that the class files I need are included in the new jar file?