1818public class AzureSpringBootVersionVerifier {
1919 private static final Logger LOGGER = LoggerFactory .getLogger (AzureSpringBootVersionVerifier .class );
2020
21- static final String SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_2_5 = "org.springframework.boot.context.properties.bind.Bindable.BindRestriction" ;
21+ static final String SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_2_5 = "org.springframework.boot.context.properties.bind"
22+ + ".Bindable.BindRestriction" ;
2223
23- static final String SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_2_6 = "org.springframework.boot.autoconfigure.data.redis.ClientResourcesBuilderCustomizer" ;
24+ static final String SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_2_6 = "org.springframework.boot.autoconfigure.data.redis"
25+ + ".ClientResourcesBuilderCustomizer" ;
26+
27+ static final String SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_2_7 = "org.springframework.boot.autoconfigure.amqp"
28+ + ".RabbitStreamTemplateConfigurer" ;
2429
25- static final String SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_2_7 = "org.springframework.boot.autoconfigure.amqp.RabbitStreamTemplateConfigurer" ;
2630 /**
27- * Versions supported by Spring Cloud Azure, for present is [2.5, 2.6]. Update this value if needed.
31+ * Versions supported by Spring Cloud Azure, for present is [2.5, 2.6, 2.7 ]. Update this value if needed.
2832 */
2933 private final Map <String , String > supportedVersions = new HashMap <>();
3034
@@ -71,20 +75,20 @@ public VerificationResult verify() {
7175 private String errorDescription () {
7276 String versionFromManifest = this .getVersionFromManifest ();
7377 return StringUtils .hasText (versionFromManifest ) ? String .format ("Spring Boot [%s] is not compatible with this"
74- + " Spring Cloud Azure release " , versionFromManifest ) : "Spring Boot is not compatible with this "
75- + "Spring Cloud Azure release " ;
78+ + " Spring Cloud Azure version. " , versionFromManifest ) : "Spring Boot is not compatible with this "
79+ + "Spring Cloud Azure version. " ;
7680 }
7781
7882 private String action () {
7983 return String .format ("Change Spring Boot version to one of the following versions %s.%n"
80- + "You can find the latest Spring Boot versions here [%s]. %n"
84+ + "You can find the latest Spring Boot versions here [%s].%n"
8185 + "If you want to learn more about the Spring Cloud Azure compatibility, "
82- + "you can visit this page [%s] and check the [Which Version of Spring Cloud Azure Should I Use] section.%n "
83- + "If you want to disable this check, "
84- + "just set the property [spring.cloud.azure.compatibility-verifier.enabled=false]" ,
86+ + "you can visit this page [%s] and check the [Which Version of Spring Cloud Azure Should I Use] "
87+ + "section.%n If you want to disable this check, "
88+ + "just set the property [spring.cloud.azure.compatibility-verifier.enabled=false]. " ,
8589 this .acceptedVersions ,
8690 "https://spring.io/projects/spring-boot#learn" ,
87- "https://github.com/Azure/azure-sdk-for-java/wiki/Spring-Versions-Mapping " );
91+ "https://aka.ms/spring/versions " );
8892 }
8993
9094 String getVersionFromManifest () {
@@ -95,14 +99,16 @@ private boolean springBootVersionMatches() {
9599 for (String acceptedVersion : acceptedVersions ) {
96100 try {
97101 if (this .matchSpringBootVersionFromManifest (acceptedVersion )) {
102+ LOGGER .debug ("The current Spring Boot version matches Spring Cloud Azure accepted version [{}]." ,
103+ acceptedVersion );
98104 return true ;
99105 }
100106 } catch (FileNotFoundException e ) {
101107 String versionString = stripWildCardFromVersion (acceptedVersion );
102108 String fullyQualifiedClassName = this .supportedVersions .get (versionString );
103109
104110 if (classNameResolver .resolve (fullyQualifiedClassName )) {
105- LOGGER .debug ("Predicate for Spring Boot Version of [{}] was matched" , versionString );
111+ LOGGER .debug ("Predicate for Spring Boot Version of [{}] was matched. " , versionString );
106112 return true ;
107113 }
108114 }
@@ -113,9 +119,9 @@ private boolean springBootVersionMatches() {
113119
114120 private boolean matchSpringBootVersionFromManifest (String acceptedVersion ) throws FileNotFoundException {
115121 String version = this .getVersionFromManifest ();
116- LOGGER .debug ("Version found in Boot manifest [{}]" , version );
122+ LOGGER .debug ("Currently running on Spring Boot version [{}], trying to match it with Spring Cloud Azure "
123+ + "accepted version [{}]." , version , acceptedVersion );
117124 if (!StringUtils .hasText (version )) {
118- LOGGER .info ("Cannot check Boot version from manifest" );
119125 throw new FileNotFoundException ("Spring Boot version not found" );
120126 } else {
121127 return version .startsWith (stripWildCardFromVersion (acceptedVersion ));
0 commit comments