Client / server project structure, folder structure, assembly files, etc.

I am writing a client and server application. Now I only developed it myself, so I wrote it as one Eclipse project organized in Java packages (org.myorg.server, org.myorg.client, org.myorg.networksystem, etc.). The project is deployed in a single jar file. Then the client is an applet, so I just point the applet code parameter to org.myorg.client.ClientApplet inside the jar file, whereas when starting the server this is a command line application, and I just run:

java -jar MyJar.jar org.myorg.server.ServerApplication

Well, I need to clean its structure and improve the build process. I also want to separate jar files so that the user does not have access to a copy of the server embedded directly in the jar file, as of now.

I want to use a continuous integration server such as CruiseControl . It would be great if I needed to check my code in the SVN repository; then the CruiseControl server will capture the code, compile it and pack it into separate banks, then deploy the server bank to my dedicated server and launch it, and also deploy the client bank on my web server so that the applet is updated.

I can find out CruiseControl. My current problem is how to split the code. It is perfectly divided into client and server packages, but then there are several common packages, such as the network protocol. Should I separate my project from 3 projects for client, server and general? Should I do something else? I considered writing Ant build files manually, but I would really like to stay in Eclipse.

?

(, , , , , )

+3
4

, , , , , CruiseControl , , Ant Maven, Gradle - , , . , Eclipse .

, Ant, Ant . , Maven Gradle, , , Maven , , . Gradle .

, , , , , , . Eclipse, , . JARS JARS.

+2

, 3 - 1 , 1 1 .

Eclipse - , , "configure build path".

ANT , CruiseControl .

+3

, .
maven. , , . maven, .
Eclipse ant, ant / - Eclipse.
Eclipse. : , , , , 't .

0

Eclipse , .

However, in my opinion, it will be too difficult for a small project: in this case, I would save it as one Eclipse project, but write custom Ant targets (all in the same build.xml file) to handle client and server jar packaging. A common code will simply appear in both banks.

But yes, you will need to do Ant manual work, but it's a good skill to have anyway.

0
source

Source: https://habr.com/ru/post/1726024/


All Articles