From fc2b9361d4f8d2f59a62e56573448bfa72e6d23e Mon Sep 17 00:00:00 2001 From: Brian Sam-Bodden Date: Fri, 5 Sep 2025 09:00:06 -0700 Subject: [PATCH] fix: make azure-identity an optional dependency to reduce dependency footprint - Changed azure-identity from 'api' to 'compileOnly' in redis-om-spring module - Added gson as 'compileOnly' since it was previously included transitively - Added azure-identity as 'compileOnly' to redis-om-spring-ai module - Updated roms-amr-entraid demo to explicitly include required Azure dependencies This reduces the dependency footprint for non-Azure users and prevents potential version conflicts with nimbus-jose-jwt when using maven-enforcer-plugin. Users requiring Azure Entra ID support need to explicitly add: - com.azure:azure-identity - com.google.code.gson:gson Fixes #652 --- demos/roms-amr-entraid/build.gradle | 4 ++++ redis-om-spring-ai/build.gradle | 1 + redis-om-spring/build.gradle | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/demos/roms-amr-entraid/build.gradle b/demos/roms-amr-entraid/build.gradle index 336db45a..f8d5c64e 100644 --- a/demos/roms-amr-entraid/build.gradle +++ b/demos/roms-amr-entraid/build.gradle @@ -31,6 +31,10 @@ repositories { dependencies { implementation project(':redis-om-spring') + // Azure Identity for Entra ID authentication + implementation "com.azure:azure-identity:${azureIdentityVersion}" + implementation "com.google.code.gson:gson" + // Important for RedisOM annotation processing! annotationProcessor project(':redis-om-spring') testAnnotationProcessor project(':redis-om-spring') diff --git a/redis-om-spring-ai/build.gradle b/redis-om-spring-ai/build.gradle index a84c3b9c..4b73aaa3 100644 --- a/redis-om-spring-ai/build.gradle +++ b/redis-om-spring-ai/build.gradle @@ -8,6 +8,7 @@ dependencies { compileOnly "jakarta.websocket:jakarta.websocket-client-api" implementation "org.springframework.ai:spring-ai-ollama:${springAiVersion}" implementation "org.springframework.ai:spring-ai-azure-openai:${springAiVersion}" + compileOnly "com.azure:azure-identity:${azureIdentityVersion}" implementation "org.springframework.ai:spring-ai-vertex-ai-embedding:${springAiVersion}" implementation "org.springframework.ai:spring-ai-bedrock:${springAiVersion}" implementation "org.springframework.ai:spring-ai-transformers:${springAiVersion}" diff --git a/redis-om-spring/build.gradle b/redis-om-spring/build.gradle index db58f3bf..23b02dee 100644 --- a/redis-om-spring/build.gradle +++ b/redis-om-spring/build.gradle @@ -10,7 +10,8 @@ dependencies { api "jakarta.persistence:jakarta.persistence-api" api "com.fasterxml.jackson.core:jackson-databind" api "redis.clients:jedis" - api "com.azure:azure-identity:${azureIdentityVersion}" + compileOnly "com.azure:azure-identity:${azureIdentityVersion}" + compileOnly "com.google.code.gson:gson" api "com.google.guava:guava:${guavaVersion}" api "com.github.f4b6a3:ulid-creator:${ulidVersion}" api "org.apache.commons:commons-lang3"