Skip to content

Working with the Code

Chris Bono edited this page Aug 13, 2022 · 11 revisions

See the CONTRIBUTING file in the repository for information on how to contribute issues and code changes to the project.

Building from Source

Spring Pulsar source can be built from the command line using Gradle. We include Gradle’s wrapper scripts (./gradlew or gradlew.bat) that you can run rather than needing to install Gradle locally.

The source on the main branch should be built with JDK 17 or later.

The project can be built from the root directory using the standard Gradle command:

./gradlew build

Tests Requiring Docker

Some integration tests that run as part of the Spring Pulsar build rely on a Docker daemon to test against live services using Testcontainers. These tests will fail if a local Docker daemon is not available.

Updating the Reference Documentation

The reference documentation is stored in this repository, see spring-pulsar-docs/src/docs/asciidoc. We use Asciidoc and you can build the documentation locally using this command:

./gradlew spring-pulsar-docs:asciidocs
Note
The generated HTML documentation is available from spring-pulsar-docs/build/docs/asciidocMultipage/.

Using an IDE

Importing into IntelliJ IDEA

If you have performed a checkout of this repository already, use “File” → “Open” and then select the root build.gradle file to import the code.

Install the Spring Formatter plugin

If you haven’t done so, install the formatter plugin so that proper formatting rules are applied automatically when you reformat code in the IDE.

  • Download the latest IntelliJ IDEA plugin.

  • Select “IntelliJ IDEA” → “Preferences”.

  • Select “Plugins”.

  • Select the wheel and “Install Plugin from Disk…​”.

  • Select the jar file you’ve downloaded.

Import additional code style

The formatter does not cover all rules (such as order of imports) and an additional file needs to be added.

  • Select “IntelliJ IDEA” → “Preferences”.

  • Select “Editor” → “Code Style”.

  • Select the wheel and “Import Scheme” → “IntelliJ IDEA code style XML”.

  • Select idea/codeStyleConfig.xml from this repository.

Importing into Eclipse

TODO

Importing into Other IDEs

Gradle is well supported by most Java IDEs. Refer to your vendor documentation.

Cloning the git repository on Windows

Some files in the git repository may exceed the Windows maximum file path (260 characters), depending on where you clone the repository. If you get Filename too long errors, set the core.longPaths=true git option:

git clone -c core.longPaths=true https://github.com/spring-projects-experimental/spring-pulsar
Clone this wiki locally