azure-spring-apps-training icon indicating copy to clipboard operation
azure-spring-apps-training copied to clipboard

Update Spring Boot Version and Adjust Dependencies

Open tacu90 opened this issue 7 months ago • 0 comments

Summary

This pull request addresses issues related to outdated Spring Boot version and incorrect dependencies in the Spring initializer commands.

Changes Made

  1. Update Spring Boot Version:

    • The commands previously used Spring Boot version 3.1.3, which is no longer available on start.spring.io.
    • Updated the Spring Boot version to 3.3.2.
    curl https://start.spring.io/starter.tgz -d type=maven-project -d dependencies=web -d baseDir=simple-microservice -d bootVersion=3.3.2 -d javaVersion=17 | tar -xzvf -
    
  2. Adjust Dependency for Cloud Gateway:

    • Changed the dependency from cloud-gateway to cloud-gateway-reactive.
    • The cloud-gateway dependency was incorrectly loading spring-cloud-starter-gateway-mvc instead of spring-cloud-starter-gateway, causing mismatches in application.yml and gateway malfunctions.
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-gateway</artifactId>
    </dependency>
    

Reason for Changes

  • Spring Boot Version Error: Running the command with version 3.1.3 results in a Bad Request error due to the version being outside the compatibility range. Below is the error message encountered:

    {
        "timestamp":"2024-07-24T07:15:12.386+00:00",
        "status":400,
        "error":"Bad Request",
        "message":"Invalid Spring Boot version '3.1.3', Spring Boot compatibility range is >=3.2.0",
        "path":"/starter.tgz"
    }
    
  • Dependency Issue: The incorrect cloud-gateway dependency was leading to the inclusion of spring-cloud-starter-gateway-mvc instead of spring-cloud-starter-gateway, causing configuration issues and non-functional gateway setup.

Please review these changes and let me know if any further adjustments are needed. Thank you!

tacu90 avatar Jul 24 '24 07:07 tacu90