Dependency Management

Apache Cassandra manages dependencies through two mechanisms: git submodules for tightly coupled projects, and the lib/ directory for third-party libraries.

Git Submodules

Cassandra uses git submodules for dependencies where cross-cutting changes are common. The primary submodule is Accord, the consensus protocol implementation.

Initializing Submodules

After cloning the repository:

git submodule update --init --recursive

Development Branches

When starting work on a JIRA ticket, create matching branches across submodules:

.build/sh/development-switch.sh --jira CASSANDRA-<number>

Updating Submodule References

After making changes to a submodule:

(cd modules/accord ; git commit -am 'Description of change')
.build/sh/bump-accord.sh

See Contributing Code Changes for the full submodule merge workflow.

Third-Party Libraries

Third-party dependencies are stored in the lib/ directory. All libraries must be compatible with the Apache License.

License information for each dependency is maintained in lib/licenses/. When adding or updating a third-party library:

  1. Place the JAR in lib/

  2. Add or update the corresponding license file in lib/licenses/

  3. Ensure the license is Apache-compatible (Category A or B per ASF policy)

The build enforces license compliance using the Apache RAT tool. See Code Style for details on license header requirements.