Dependency Management

[DISCUSS] thread on the dev@cassandra.apache.org mailing list. software license requirements. build.xml file to separate POM template files that are processed by Ant. In both pre-5.0 and post-5.0 Cassandra, there are several POMs that dependencies can be included in:

  • parent-pom

  • Contains all dependencies with the respective version. All other poms will refer to the artifacts with specified versions listed here.

  • parent-pom template is .build/parent-pom-template.xml.
  • build-deps-pom(-sources) + coverage-deps-pom

  • ant build target. Listed dependencies will be resolved and copied to build/lib/{jar,sources} by executing the maven-ant-tasks-retrieve-build target. This should contain libraries that are required for build tools (grammar, docs, instrumentation), but are not shipped as part of the Cassandra distribution.

  • coverage-deps-pom has been removed and the build-deps-pom template is .build/cassandra-build-deps-template.xml.
  • all-pom

  • cassandra-all.jar. See release process docs.

  • all-pom template is .build/cassandra-deps-template.xml.
  • test-deps-pom

  • maven-ant-tasks-retrieve-test to retrieve and save dependencies to build/test/lib. Exclusively used during JUnit test execution.

  • test-deps-pom has been removed. ant write-poms target produces valid POM files in the build/ directory. lib/ directory are built into the release artifacts by the ant artifacts target (see target resolver-dist-lib). Libraries distributed this way must meet the ASF distribution policy.

    Dependency management before Cassandra 5.0

    build.xml. The parent POM should include the dependency tag with groupId, artifactId, version, and optional scope fields. The child POM(s) should include the dependency tag with groupId and artifactId. See the Maven docs for a complete reference on how to reference dependencies across parent and child POMs. an example of a commit that changes dependency versions pre-5.0.

    Dependency management in Cassandra 5.0 and later

    .build/*-template.xml. These templates are processed into valid Maven POMs and copied to build/\*.pom by the ant write-poms task. parent-pom-template and cassandra-deps-template, and optionally cassandra-build-deps-template if the dependency is required for build only. See the Maven docs on how to reference dependencies in the parent POM from the child POMs. build.xml and parent-pom-template, specify the version as a property in build.xml, add it to the ant write-poms target, then add the property to parent-pom-template with the value of the template substitution. an example of a commit that changes dependency versions since 5.0.

    Troubleshooting and conflict resolution

    Here are some useful commands that may help you out resolving conflicts.
  • ant realclean - gets rid of the build directory, including build artifacts.
  • mvn dependency:tree -f build/apache-cassandra-\*-SNAPSHOT.pom -Dverbose -Dincludes=org.slf4j

  • ant mvn-install.

  • rm ~/.m2/repository/org/apache/cassandra/apache-cassandra/ - removes cached local Cassandra maven artifacts