diff --git a/start-site/src/main/java/io/spring/start/site/extension/dependency/cassandra/CassandraProjectGenerationConfiguration.java b/start-site/src/main/java/io/spring/start/site/extension/dependency/cassandra/CassandraProjectGenerationConfiguration.java index e4f3d4a8182..08a1d8388a7 100644 --- a/start-site/src/main/java/io/spring/start/site/extension/dependency/cassandra/CassandraProjectGenerationConfiguration.java +++ b/start-site/src/main/java/io/spring/start/site/extension/dependency/cassandra/CassandraProjectGenerationConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ * * @author Moritz Halbritter * @author Stephane Nicoll + * @author Eddú Meléndez */ @Configuration(proxyBeanMethods = false) class CassandraProjectGenerationConfiguration { @@ -63,7 +64,8 @@ ComposeFileCustomizer cassandraComposeFileCustomizer(Build build, DockerServiceR } private boolean isCassandraEnabled(Build build) { - return build.dependencies().has("data-cassandra") || build.dependencies().has("data-cassandra-reactive"); + return build.dependencies().has("data-cassandra") || build.dependencies().has("data-cassandra-reactive") + || build.dependencies().has("spring-ai-vectordb-cassandra"); } } diff --git a/start-site/src/main/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersModuleRegistry.java b/start-site/src/main/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersModuleRegistry.java index 3859b0415d4..3622622c972 100644 --- a/start-site/src/main/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersModuleRegistry.java +++ b/start-site/src/main/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersModuleRegistry.java @@ -58,7 +58,8 @@ static Iterable create(Version platformVersion) { .customizeHelpDocument(addReferenceLink("Consul Module", "consul/"))); builders.add(onDependencies("cloud-starter-vault-config").customizeBuild(addModule("vault")) .customizeHelpDocument(addReferenceLink("Vault Module", "vault/"))); - builders.add(onDependencies("data-cassandra", "data-cassandra-reactive").customizeBuild(addModule("cassandra")) + builders.add(onDependencies("data-cassandra", "data-cassandra-reactive", "spring-ai-vectordb-cassandra") + .customizeBuild(addModule("cassandra")) .customizeHelpDocument(addReferenceLink("Cassandra Module", "databases/cassandra/"))); builders.add(onDependencies("data-couchbase", "data-couchbase-reactive").customizeBuild(addModule("couchbase")) .customizeHelpDocument(addReferenceLink("Couchbase Module", "databases/couchbase/"))); diff --git a/start-site/src/main/resources/application.yml b/start-site/src/main/resources/application.yml index 6ed44af5dba..0458fa48a42 100644 --- a/start-site/src/main/resources/application.yml +++ b/start-site/src/main/resources/application.yml @@ -1448,6 +1448,21 @@ initializr: links: - rel: reference href: https://docs.spring.io/spring-ai/reference/api/bedrock-chat.html + - name: Apache Cassandra Vector Database + id: spring-ai-vectordb-cassandra + group-id: org.springframework.ai + artifact-id: spring-ai-cassandra-store-spring-boot-starter + # spring-ai-cassandra-store-spring-boot-starter is not managed in the BOM + # See https://github.com/spring-projects/spring-ai/pull/1312 + mappings: + - compatibilityRange: "[3.2.0,3.4.0-M1)" + version: 1.0.0-M2 + repository: spring-milestones + description: Spring AI vector database support for Apache Cassandra. + starter: true + links: + - rel: reference + href: https://docs.spring.io/spring-ai/reference/api/vectordbs/apache-cassandra.html - name: Chroma Vector Database id: spring-ai-vectordb-chroma group-id: org.springframework.ai diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/cassandra/CassandraProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/cassandra/CassandraProjectGenerationConfigurationTests.java index f60b6374c3b..88ca962b604 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/cassandra/CassandraProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/cassandra/CassandraProjectGenerationConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ * Tests for {@link CassandraProjectGenerationConfiguration}. * * @author Moritz Halbritter + * @author Eddú Meléndez */ class CassandraProjectGenerationConfigurationTests extends AbstractExtensionTests { @@ -51,6 +52,12 @@ void createsCassandraServiceWhenReactive() { assertThat(composeFile(request)).hasSameContentAs(new ClassPathResource("compose/cassandra.yaml")); } + @Test + void createsCassandraServiceWhenSpringAiIsSelected() { + ProjectRequest request = createProjectRequest("docker-compose", "spring-ai-vectordb-cassandra"); + assertThat(composeFile(request)).hasSameContentAs(new ClassPathResource("compose/cassandra.yaml")); + } + @Test void doesNotFailWhenBothCassandraAndReactiveCassandraAreSelected() { ProjectRequest request = createProjectRequest("docker-compose", "data-cassandra", "data-cassandra-reactive"); diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersProjectGenerationConfigurationTests.java index f9421a31b09..6d547b55abb 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersProjectGenerationConfigurationTests.java @@ -97,6 +97,7 @@ static Stream supportedEntriesBuild320() { Arguments.arguments("mysql", "mysql"), Arguments.arguments("postgresql", "postgresql"), Arguments.arguments("oracle", "oracle-free"), Arguments.arguments("pulsar", "pulsar"), Arguments.arguments("pulsar-reactive", "pulsar"), Arguments.arguments("solace", "solace"), + Arguments.arguments("spring-ai-vectordb-cassandra", "cassandra"), Arguments.arguments("spring-ai-vectordb-elasticsearch", "elasticsearch"), Arguments.arguments("spring-ai-vectordb-neo4j", "neo4j"), Arguments.arguments("spring-ai-vectordb-oracle", "oracle-free"),