The following template is structured as a multi-project build using gradle as a build tool. By the way, gradle is the only tool supporting multi-project builds. The main project idistrsys specifies all included subprojects in the settings.gradle file. client and server are dependent on the shared project since all the model classes are included in this project.
- Within the idistrsys folder start a CMD.
- Build the project via gradle clean build --console 'verbose': the verbose option enables printing of all executed tasks.
- Refresh your gradle project within your IDE (e.g. Eclipse)
- Implement client and server interfaces
- Within the idistrsys folder start a CMD.
- Run the server via java -jar server\build\libs\server-1.0.jar
The shared project is automatically build before the server is started. Look at the dependencies block in the server/build.gradle.
- Within the idistrsys folder start a CMD.
- Run the server via gradle client:run
The shared project is automatically included in the dependencies of the client and server.
If you are interested inspect the idistrsys/build.gradle
to see all the relevant settings, configurations and tasks.