Browse Source

Adds boot 2.3 compatiblity

pull/680/merge
Spencer Gibb 5 years ago
parent
commit
62a1233154
No known key found for this signature in database
GPG Key ID: 7788A47380690861
  1. 25
      spring-cloud-commons/src/main/java/org/springframework/cloud/configuration/SpringBootVersionVerifier.java
  2. 2
      spring-cloud-commons/src/test/java/org/springframework/cloud/configuration/SpringBootDependencyTests.java
  3. 4
      spring-cloud-loadbalancer/pom.xml

25
spring-cloud-commons/src/main/java/org/springframework/cloud/configuration/SpringBootVersionVerifier.java

@ -40,6 +40,7 @@ class SpringBootVersionVerifier implements CompatibilityVerifier { @@ -40,6 +40,7 @@ class SpringBootVersionVerifier implements CompatibilityVerifier {
this.put("2.0", is2_0());
this.put("2.1", is2_1());
this.put("2.2", is2_2());
this.put("2.3", is2_3());
}
};
@ -162,6 +163,30 @@ class SpringBootVersionVerifier implements CompatibilityVerifier { @@ -162,6 +163,30 @@ class SpringBootVersionVerifier implements CompatibilityVerifier {
};
}
CompatibilityPredicate is2_3() {
return new CompatibilityPredicate() {
@Override
public String toString() {
return "Predicate for Boot 2.3";
}
@Override
public boolean isCompatible() {
try {
// since 2.3
Class.forName(
"org.springframework.boot.context.propertie.BoundConfigurationProperties");
return true;
}
catch (ClassNotFoundException e) {
return false;
}
}
};
}
private String errorDescription() {
String versionFromManifest = getVersionFromManifest();
if (StringUtils.hasText(versionFromManifest)) {

2
spring-cloud-commons/src/test/java/org/springframework/cloud/configuration/SpringBootDependencyTests.java

@ -144,7 +144,7 @@ public class SpringBootDependencyTests { @@ -144,7 +144,7 @@ public class SpringBootDependencyTests {
@Test
public void should_match_against_current_manifest() {
List<String> acceptedVersions = Collections.singletonList("2.2");
List<String> acceptedVersions = Collections.singletonList("2.3");
SpringBootVersionVerifier versionVerifier = new SpringBootVersionVerifier(
acceptedVersions);
versionVerifier.ACCEPTED_VERSIONS.clear();

4
spring-cloud-loadbalancer/pom.xml

@ -22,6 +22,10 @@ @@ -22,6 +22,10 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>

Loading…
Cancel
Save