Solace-spring-boot is not building (missing artifacts)

Hi!
Using Java and Spring Boot and trying to get up & running with an Oauth2 authenticated producer.
Found the solacle-spring-boot project/repo: GitHub - SolaceProducts/solace-spring-boot: An umbrella project containing all Solace projects for Spring Boot

Following the instructions but it has problem finding Maven artifacts.
My expectation is that the project should work “out of the box”.
Please assist on how to resolve.

mats@computer ~ % git clone https://github.com/SolaceProducts/solace-spring-boot.git
Cloning into 'solace-spring-boot'...
remote: Enumerating objects: 3025, done.
remote: Counting objects: 100% (738/738), done.
remote: Compressing objects: 100% (195/195), done.
remote: Total 3025 (delta 626), reused 541 (delta 541), pack-reused 2287 (from 2)
Receiving objects: 100% (3025/3025), 843.17 KiB | 8.78 MiB/s, done.
Resolving deltas: 100% (1367/1367), done.
mats@computer ~ % cd solace-spring-boot
mats@computer solace-spring-boot % mvn install
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/com/solace/test/integration/solace-integration-test-support-bom/1.1.2/solace-integration-test-support-bom-1.1.2.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Non-resolvable import POM: The following artifacts could not be resolved: com.solace.test.integration:solace-integration-test-support-bom:pom:1.1.2 (absent): Could not find artifact com.solace.test.integration:solace-integration-test-support-bom:pom:1.1.2 in central (https://repo.maven.apache.org/maven2) @ line 92, column 25

Hi there, I’m Solly AI, I generate responses to your questions using the power of the Solace Agent Mesh:

Please remember that AI technology can make mistakes so ensure that you read our Disclaimer.

AI Generated responses are a work in progress, your help in evaluating my response would be awesome! If my response makes sense, please mark it as a solution or give a :+1:. If my response doesn’t make sense for your topic, please react to it with a :shaking_face:.

Based on the provided documentation, I can help explain the Maven dependency issues with the solace-spring-boot project. Let me break down the key points:

  1. Version Compatibility Issue:
    The error appears to be related to incompatible Spring framework versions, specifically with Spring Cloud Stream and Spring Boot versions. The error indicates a missing method: MessageBuilder.removeHeader().

  2. Root Cause:

  • Spring Boot 3.4.1 is not compatible with certain Spring Cloud Stream components
  • The version mismatch is causing method signature conflicts between different Spring components
  1. Solution:
    The recommended approach is to:

  2. Use an earlier compatible version combination:

    • Spring Boot 3.3.7
    • Spring Cloud Function Context 4.1.4
  3. Implement proper dependency management using BOMs (Bill of Materials):

    • Use Spring Boot BOM (through spring-boot-starter-parent or spring-boot-dependencies)
    • Use Spring Cloud BOM (spring-cloud-dependencies)

Here’s the recommended Maven configuration approach:

<dependencyManagement>
    <dependencies>
        <!-- Spring Boot BOM -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>3.3.7</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        
        <!-- Spring Cloud BOM -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>2023.0.x</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

This configuration will help manage Spring dependencies consistently and avoid version conflicts.

Sources:

Hi @Mats,

Thanks for sharing this. Sorry for the error! I get the same error as you and will get this in front of the right people :slight_smile:

Hi @Mats, this is failing because Maven needs to be configured to be able to pull solace-integration-test-support-bom from Github Packages. We’ve just updated the build docs with the instructions. Please take a look: GitHub - SolaceProducts/solace-spring-boot: An umbrella project containing all Solace projects for Spring Boot

Thank you @Jeff, after following the updated instructions it now works locally :+1: .

1 Like