Currently, Spring Boot’s CassandraAutoConfiguration activates automatically as soon as the class com.datastax.oss.driver.api.core.CqlSession is present on the classpath. See org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration

This behavior causes unintended activation in cases where: - The Cassandra driver is included as a runtime dependency (e.g. implementation or runtimeOnly), - But Cassandra is not actually configured or intended to be used in the running application.

This can lead to unexpected auto-configuration and sometimes startup failures. While it is possible to disable the configuration via application properties, I believe this should not be the default behavior.

For example, it would be beneficial to require an explicit property (e.g., spring.data.cassandra.enabled=true) in addition to the presence of CqlSession to activate the auto-configuration.

If desired, I can help prepare a pull request or refine this further.

Comment From: wilkinsona

Thanks for the suggestion. This has been addressed in Spring Boot 4 by the modularisation of Spring Boot's auto-configuration and the creation of the spring-boot-cassandra module. If you have Cassandra's driver on the classpath but not spring-boot-cassandra, nothing will happen.