I'm writing a client and server application. Right now I've just been developing it on my own, so I have written it as one Eclipse project, organized into Java packages (org.myorg.server, org.myorg.client, org.myorg.networksystem, etc.). The project deploys to a single jar file. Then, the client is an applet, so I simply point the applet code parameter at org.myorg.client.ClientApplet inside the jar file, whereas when I run the server, it's a command line application and I just run:
java -jar MyJar.jar org.myorg.server.ServerApplication
Well, I need to clean up its structure and improve the build process. I also want to separate the jar files, so that an user does not have access to a copy of the server built right into the jar file as it is now.
I want to use a continuous integration server such as CruiseControl. It would be really cool if I only needed to check my code into the SVN repository; then the CruiseControl server would grab the code, compile it and package it into separate jars, then deploy the server jar onto my dedicated server and run it, and also deploy the client jar onto my web server so that the applet is updated.
I can figure out CruiseControl. My current issue is how to separate the code. It's nicely separated into client and server packages, but then there are some shared packages such as the network protocol. Should I separate my project into 3 projects for client, server, and common? Should I do something else? I was considering writing Ant build files by hand, but I would really like to stay in Eclipse.
How can I best organize my code to meet these goals?
(by the way, sorry if this question is confusing, I think I'm having a hard time putting into words all of the different questions swirling around my head)