Skip to content

Latest commit

 

History

History
55 lines (37 loc) · 1.81 KB

File metadata and controls

55 lines (37 loc) · 1.81 KB

JDK Requirements

The Dongting project outputs two jars for users: dongting-client.jar requires Java 8, and dongting-server.jar requires Java 11. However, compiling the entire project requires Java 17 because the benchmark module requires Java 17.

The dongting-dist module requires Java 11.

Build and Test

Unit tests

mvn clean test -Dtick=5

Build package, output in the target directory under the root

mvn clean package -DskipUTs

Note: To skip unit tests in this project, use -DskipUTs instead of -DskipTests. This is because sometimes I want to run only integration tests, but -DskipTests would skip all tests including integration tests, so I changed it.

If you want to install the artifact:

mvn clean install -Dmaven.test.skip=true

IDE Setup

Although the mvn command build succeeds in the command line, importing the entire project into the IDE may lead to compilation errors.

First, the test code depends on some files generated by the protobuf compiler. Run the following command to generate the source files (you can also run the test or package command above):

mvn clean compile test-compile

Then add the source file path generated by the plugin to the sources in the IDE (The IntelliJ IDEA may set it automatically). Like below: IDEA configuration

Second, the client module defines multiple compilation profiles in pom.xml (supports from Java 8 to Java 25), but the IDE may not handle it well. Setup in IntelliJ IDEA like below (the --add-exports/--add-reads should automatically be added after maven sync projects):

IDEA configuration

Now you can build and run the project in the IDE.

Run Demos in IDE

The demos module contains some examples of using dongting, they require no configuration and can be run directly by the main method.