java/dev.md
We use Spotless to format Java code:
mvn spotless:apply
Refer to Flink's Guild to Set Up IDE.
Install necessary plugins:
Set up Checkstyle plugin
Set up google-java-format plugin
Import checkstyle configuration to java code formatter
If you are using macOS and encounter the following error:
[ERROR] /.../risingwave/java/proto/../../proto/ddl_service.proto [0:0]: /.../risingwave/java/proto/target/protoc-plugins/protoc-gen-grpc-java-1.74.0-osx-aarch_64.exe: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--grpc-java_out: protoc-gen-grpc-java: Plugin failed with status code 1.
You need to install Apple Rosetta to run x86_64 binaries on Apple Silicon Macs.
Install extension Checkstyle for Java
Config with the following. It may work.
{
"java.checkstyle.configuration": "${workspaceFolder}/tools/maven/checkstyle.xml",
"java.checkstyle.version": "8.14",
"java.checkstyle.properties": {
"checkstyle.suppressions.file": "${workspaceFolder}/tools/maven/suppressions.xml"
},
"java.format.settings.url": "https://raw.githubusercontent.com/aosp-mirror/platform_development/master/ide/eclipse/android-formatting.xml",
"java.format.settings.profile": "Android"
}