The sections below describe how to import the Fluss project into an IDE for the development of Fluss itself.
:::note Whenever something is not working in your IDE, try with the Maven command line first (mvn clean package -DskipTests) as it might be your IDE that has a bug or is not properly set up. :::
:::tip Using the included Maven Wrapper by replacing mvn with ./mvnw ensures that the correct Maven version is used. :::
Fluss uses git for version control. The Git repository is mirrored to GitHub.
The common way to merge code changes on GitHub is to fork the repository (creating a copy of the repository to your personal GitHub account so you can modify the source code) and issue a pull request.
[Fork] button on the upper right of the Fluss repository.# Clone using HTTPs git clone https://github.com/<your-user-name>/fluss.git
# Clone using SSH git clone git@github.com:<your-user-name>/fluss.git
The following guide has been written for IntelliJ IDEA 2024.3. Some details might differ in other versions. Please make sure to follow all steps
mvn clean package -DskipTests.Every file needs to include the Apache license as a header. This can be automated in IntelliJ by adding a Copyright profile:
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Go to “Settings” → “Plugins” and select the “Marketplace” tab. Search for the following plugins, install them, and restart the IDE if prompted:
You will also need to install the google-java-format plugin. However, a specific version of this plugin is required. Download google-java-format v1.7.0.6 and install it as follows. Make sure to never update this plugin.
Fluss uses Spotless together with google-java-format to format the Java code.
It is recommended to automatically format your code by applying the following settings:
For earlier IntelliJ IDEA versions:
.*\.java to avoid formatting other file types.You can also format the whole project via Maven by using mvn spotless:apply.
Checkstyle is used to enforce static coding guidelines.
tools/maven/checkstyle.xml located within your cloned repository.checkstyle.suppressions.file with the value suppressions.xml and click “Next”.You can now import the Checkstyle configuration for the Java code formatter.
tools/maven/checkstyle.xml located within your cloned repository.To verify the setup, click “View” → “Tool Windows” → “Checkstyle” and find the “Check Module” button in the opened tool window. It should report no violations.
Verify that the Git commit username is set to your preferred name using
git config user.name
The set username will be shown in the contributor list in Fluss release notes.
To change the username use
git config user.name "<Your username>"
You are free to choose any username you want. In particular, the username does not have to correspond to your GitHub username. A common choice is simply your full name.
Also verify that the Git commit email address is set to your preferred email address using
git config user.email
Make sure that the set email address is an email address that is linked to your GitHub account. If the email address is not linked to your GitHub account, commits in the contribution graph will not be associated with your account.
To change the email address use
git config user.email "<email address>"
If you do not want to expose your email address in Git commits, you can activate GitHub's email privacy setting and set the Git commit email address to the anonymized noreply @users.noreply.github.com email address.
:::important
git config commands above only set the username and email address for the current Git repository. If you want to apply the same settings to all Git repositories on a device, execute the commands with the --global option. :::This section lists issues that developers have run into in the past when working with IntelliJ.
invalid flag: --add-exports=java.base/sun.net.util=ALL-UNNAMEDThis happens if the “java11” Maven profile is active, but an older JDK version is used. Go to “View” → “Tool Windows” → “Maven” and uncheck the “java11” profile. Afterwards, reimport the project.
package sun.misc does not existThis happens if you are using JDK 11 and compile to Java 8 with the --release option. This option is currently incompatible with our build setup. Go to “Settings” → “Build, Execution, Deployment” → “Compiler” → “Java Compiler” and uncheck the “Use ‘--release’ option for cross-compilation (Java 9 and later)”.
NoClassDefFoundError for Fluss classes.This happens if Fluss dependencies are set to “provided”, resulting in them not being available on the classpath. You can either check “Include dependencies with ‘Provided’ scope” in your run configuration, or create a test that calls the main() method of the example.