microsoft / azure-spring-boot

Spring Boot Starters for Azure services
MIT License
374 stars 460 forks source link

Could not find com.azure:azure-storage-blob-batch in azure-spring-boot-bom #949

Closed vcarluer closed 2 years ago

vcarluer commented 2 years ago

Since version 3.13.0 we have a compilation error on azure-storage-blob-batch. Here our gradle build:

/ Copyright (c) Cosmo Tech.
// Licensed under the MIT license.

val azureSpringBootBomVersion = "3.13.0"

dependencies {
  api(projects.cosmotechApiCommonParent.cosmotechApiCommon)

  api(platform("com.azure.spring:azure-spring-boot-bom:$azureSpringBootBomVersion"))
  implementation(platform("com.azure.spring:azure-spring-boot-bom:$azureSpringBootBomVersion"))

  api("com.azure.spring:azure-spring-boot-starter-cosmos")
  implementation("com.azure.spring:azure-spring-boot-starter-storage")
  api("com.azure:azure-storage-blob-batch")
  implementation("com.azure.spring:azure-spring-boot-starter-active-directory")
  implementation("com.microsoft.azure.kusto:kusto-ingest:3.0.0") {
    exclude(group = "org.slf4j", module = "slf4j-api")
    because(
        "this depends on org.slf4j:slf4j-api 1.8.0-beta4 (pre 2.x)," +
            "which is not backward-compatible with 1.7.x." +
            "See http://www.slf4j.org/faq.html#changesInVersion200")
  }
}

Here the error we have:

> Task :cosmotech-api-common-parent:cosmotech-api-common-azure:compileKotlin FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':cosmotech-api-common-parent:cosmotech-api-common-azure:compileKotlin'.
> Error while evaluating property 'filteredArgumentsMap' of task ':cosmotech-api-common-parent:cosmotech-api-common-azure:compileKotlin'
   > Could not resolve all files for configuration ':cosmotech-api-common-parent:cosmotech-api-common-azure:compileClasspath'.
      > Could not find com.azure:azure-storage-blob-batch:.
        Required by:
            project :cosmotech-api-common-parent:cosmotech-api-common-azure

We can solve this with forcing azure-storage-blob-batch to 12.11.3 with: api("com.azure:azure-storage-blob-batch:12.11.3")

But the goal of the boot-bom is to avoid this.

Is there an issue with the bom package or in the way we use it?

Thanks.

chenrujun commented 2 years ago

Hi, @vcarluer. Thanks for reaching out. It's caused by this PR: https://github.com/Azure/azure-sdk-for-java/pull/26208 I think you can fix this issue by importing azure-sdk-bom:${version} in your pom. ${version} can be decided by this table: https://github.com/Azure/azure-sdk-for-java/pull/26891

Hi, @saragluna , @yiliuTo . Could you please explain why we delete azure-sdk-bom in azure-spring-boot-bom?

saragluna commented 2 years ago

@chenrujun this is why https://github.com/Azure/azure-sdk-for-java/issues/26136#issuecomment-1007230550.

vcarluer commented 2 years ago

Adding azure-sdk-bom removed from azure-spring-boot-boot solved the issue. Thanks.