18
18
public class AzureSpringBootVersionVerifier {
19
19
private static final Logger LOGGER = LoggerFactory .getLogger (AzureSpringBootVersionVerifier .class );
20
20
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" ;
22
23
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" ;
24
29
25
- static final String SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_2_7 = "org.springframework.boot.autoconfigure.amqp.RabbitStreamTemplateConfigurer" ;
26
30
/**
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.
28
32
*/
29
33
private final Map <String , String > supportedVersions = new HashMap <>();
30
34
@@ -71,20 +75,20 @@ public VerificationResult verify() {
71
75
private String errorDescription () {
72
76
String versionFromManifest = this .getVersionFromManifest ();
73
77
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. " ;
76
80
}
77
81
78
82
private String action () {
79
83
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"
81
85
+ "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]. " ,
85
89
this .acceptedVersions ,
86
90
"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 " );
88
92
}
89
93
90
94
String getVersionFromManifest () {
@@ -95,14 +99,16 @@ private boolean springBootVersionMatches() {
95
99
for (String acceptedVersion : acceptedVersions ) {
96
100
try {
97
101
if (this .matchSpringBootVersionFromManifest (acceptedVersion )) {
102
+ LOGGER .debug ("The current Spring Boot version matches Spring Cloud Azure accepted version [{}]." ,
103
+ acceptedVersion );
98
104
return true ;
99
105
}
100
106
} catch (FileNotFoundException e ) {
101
107
String versionString = stripWildCardFromVersion (acceptedVersion );
102
108
String fullyQualifiedClassName = this .supportedVersions .get (versionString );
103
109
104
110
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 );
106
112
return true ;
107
113
}
108
114
}
@@ -113,9 +119,9 @@ private boolean springBootVersionMatches() {
113
119
114
120
private boolean matchSpringBootVersionFromManifest (String acceptedVersion ) throws FileNotFoundException {
115
121
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 );
117
124
if (!StringUtils .hasText (version )) {
118
- LOGGER .info ("Cannot check Boot version from manifest" );
119
125
throw new FileNotFoundException ("Spring Boot version not found" );
120
126
} else {
121
127
return version .startsWith (stripWildCardFromVersion (acceptedVersion ));
0 commit comments