diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index 869f5315c..463ccc2a6 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -11,14 +11,16 @@ on:
jobs:
build:
- runs-on: ubuntu-16.04
-
+ runs-on: ubuntu-20.04
+ strategy:
+ matrix:
+ jdk: [8, 11]
steps:
- uses: actions/checkout@v2
- - name: Set up JDK 1.8
+ - name: Set up JDK
uses: actions/setup-java@v1
with:
- java-version: 1.8
+ java-version: ${{ matrix.jdk }}
- name: Install Zookeeper
run: echo "Install Zookeeper 3.5.6"
&& wget https://archive.apache.org/dist/zookeeper/zookeeper-3.5.6/apache-zookeeper-3.5.6-bin.tar.gz
diff --git a/sofa-boot-project/sofa-boot-core/isle-sofa-boot/src/test/java/com/alipay/sofa/isle/test/util/SeparateClassLoaderTestRunner.java b/sofa-boot-project/sofa-boot-core/isle-sofa-boot/src/test/java/com/alipay/sofa/isle/test/util/SeparateClassLoaderTestRunner.java
index 1c82a74da..fe7c7b46e 100644
--- a/sofa-boot-project/sofa-boot-core/isle-sofa-boot/src/test/java/com/alipay/sofa/isle/test/util/SeparateClassLoaderTestRunner.java
+++ b/sofa-boot-project/sofa-boot-core/isle-sofa-boot/src/test/java/com/alipay/sofa/isle/test/util/SeparateClassLoaderTestRunner.java
@@ -17,7 +17,9 @@
package com.alipay.sofa.isle.test.util;
import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.net.URL;
import java.net.URLClassLoader;
import org.junit.runner.notification.RunNotifier;
@@ -81,7 +83,19 @@ public static AddCustomJar getAddCustomJarAnnotationRecursively(Class> klass)
public static class SeparateClassLoader extends URLClassLoader {
public SeparateClassLoader() {
- super(((URLClassLoader) getSystemClassLoader()).getURLs(), null);
+ super(new URL[0], null);
+
+ try {
+ Field f = getSystemClassLoader().getClass().getDeclaredField("ucp");
+ f.setAccessible(true);
+ Object path = f.get(getSystemClassLoader());
+ Method m = path.getClass().getDeclaredMethod("getURLs");
+ for (URL url : (URL[]) m.invoke(path)) {
+ addURL(url);
+ }
+ } catch (Throwable e) {
+ // ignore
+ }
}
@Override
diff --git a/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/runtime/binding/RpcBinding.java b/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/runtime/binding/RpcBinding.java
index 6c877171d..7008a5d15 100644
--- a/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/runtime/binding/RpcBinding.java
+++ b/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/runtime/binding/RpcBinding.java
@@ -111,7 +111,7 @@ public HealthResult healthCheck() {
}
/**
- * Getter method for property appName.
+ * Getter method for property appName
.
*
* @return property value of appName
*/
@@ -120,7 +120,7 @@ public String getAppName() {
}
/**
- * Setter method for property appName.
+ * Setter method for property appName
.
*
* @param appName value to be assigned to property appName
*/
@@ -129,7 +129,7 @@ public void setAppName(String appName) {
}
/**
- * Getter method for property beanId.
+ * Getter method for property beanId
.
*
* @return property value of beanId
*/
@@ -138,7 +138,7 @@ public String getBeanId() {
}
/**
- * Setter method for property beanId.
+ * Setter method for property beanId
.
*
* @param beanId value to be assigned to property beanId
*/
@@ -147,7 +147,7 @@ public void setBeanId(String beanId) {
}
/**
- * Getter method for property rpcBindingParam.
+ * Getter method for property rpcBindingParam
.
*
* @return property value of rpcBindingParam
*/
@@ -156,7 +156,7 @@ public RpcBindingParam getRpcBindingParam() {
}
/**
- * Setter method for property rpcBindingParam.
+ * Setter method for property rpcBindingParam
.
*
* @param rpcBindingParam value to be assigned to property rpcBindingParam
*/
@@ -165,7 +165,7 @@ public void setRpcBindingParam(RpcBindingParam rpcBindingParam) {
}
/**
- * Getter method for property applicationContext.
+ * Getter method for property applicationContext
.
*
* @return property value of applicationContext
*/
@@ -174,7 +174,7 @@ public ApplicationContext getApplicationContext() {
}
/**
- * Setter method for property applicationContext.
+ * Setter method for property applicationContext
.
*
* @param applicationContext value to be assigned to property applicationContext
*/
@@ -183,7 +183,7 @@ public void setApplicationContext(ApplicationContext applicationContext) {
}
/**
- * Getter method for property inBinding.
+ * Getter method for property inBinding
.
*
* @return property value of inBinding
*/
@@ -192,7 +192,7 @@ public boolean isInBinding() {
}
/**
- * Setter method for property inBinding.
+ * Setter method for property inBinding
.
*
* @param inBinding value to be assigned to property inBinding
*/
@@ -201,7 +201,7 @@ public void setInBinding(boolean inBinding) {
}
/**
- * Getter method for property consumerConfig.
+ * Getter method for property consumerConfig
.
*
* @return property value of consumerConfig
*/
@@ -210,7 +210,7 @@ public ConsumerConfig getConsumerConfig() {
}
/**
- * Setter method for property consumerConfig.
+ * Setter method for property consumerConfig
.
*
* @param consumerConfig value to be assigned to property consumerConfig
*/
diff --git a/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/runtime/binding/RpcBindingMethodInfo.java b/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/runtime/binding/RpcBindingMethodInfo.java
index eef301535..7fd12c089 100644
--- a/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/runtime/binding/RpcBindingMethodInfo.java
+++ b/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/runtime/binding/RpcBindingMethodInfo.java
@@ -38,7 +38,7 @@ public class RpcBindingMethodInfo {
private Object callbackHandler;
/**
- * Getter method for property name.
+ * Getter method for property name
.
*
* @return property value of name
*/
@@ -47,7 +47,7 @@ public String getName() {
}
/**
- * Setter method for property name.
+ * Setter method for property name
.
*
* @param name value to be assigned to property name
*/
@@ -56,7 +56,7 @@ public void setName(String name) {
}
/**
- * Getter method for property type.
+ * Getter method for property type
.
*
* @return property value of type
*/
@@ -65,7 +65,7 @@ public String getType() {
}
/**
- * Setter method for property type.
+ * Setter method for property type
.
*
* @param type value to be assigned to property type
*/
@@ -74,7 +74,7 @@ public void setType(String type) {
}
/**
- * Getter method for property timeout.
+ * Getter method for property timeout
.
*
* @return property value of timeout
*/
@@ -83,7 +83,7 @@ public Integer getTimeout() {
}
/**
- * Setter method for property timeout.
+ * Setter method for property timeout
.
*
* @param timeout value to be assigned to property timeout
*/
@@ -92,7 +92,7 @@ public void setTimeout(Integer timeout) {
}
/**
- * Getter method for property retries.
+ * Getter method for property retries
.
*
* @return property value of retries
*/
@@ -101,7 +101,7 @@ public Integer getRetries() {
}
/**
- * Setter method for property retries.
+ * Setter method for property retries
.
*
* @param retries value to be assigned to property retries
*/
@@ -110,7 +110,7 @@ public void setRetries(Integer retries) {
}
/**
- * Getter method for property callbackClass.
+ * Getter method for property callbackClass
.
*
* @return property value of callbackClass
*/
@@ -119,7 +119,7 @@ public String getCallbackClass() {
}
/**
- * Setter method for property callbackClass.
+ * Setter method for property callbackClass
.
*
* @param callbackClass value to be assigned to property callbackClass
*/
@@ -128,7 +128,7 @@ public void setCallbackClass(String callbackClass) {
}
/**
- * Getter method for property callbackRef.
+ * Getter method for property callbackRef
.
*
* @return property value of callbackRef
*/
@@ -137,7 +137,7 @@ public String getCallbackRef() {
}
/**
- * Setter method for property callbackRef.
+ * Setter method for property callbackRef
.
*
* @param callbackRef value to be assigned to property callbackRef
*/
@@ -146,7 +146,7 @@ public void setCallbackRef(String callbackRef) {
}
/**
- * Getter method for property callbackHandler.
+ * Getter method for property callbackHandler
.
*
* @return property value of callbackHandler
*/
@@ -155,7 +155,7 @@ public Object getCallbackHandler() {
}
/**
- * Setter method for property callbackHandler.
+ * Setter method for property callbackHandler
.
*
* @param callbackHandler value to be assigned to property callbackHandler
*/
diff --git a/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/runtime/param/RpcBindingParam.java b/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/runtime/param/RpcBindingParam.java
index db846e644..1f7929366 100644
--- a/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/runtime/param/RpcBindingParam.java
+++ b/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/runtime/param/RpcBindingParam.java
@@ -91,7 +91,7 @@ public abstract class RpcBindingParam implements BindingParam {
protected String mockBean;
/**
- * Getter method for property timeout.
+ * Getter method for property timeout
.
*
* @return property value of timeout
*/
@@ -100,7 +100,7 @@ public Integer getTimeout() {
}
/**
- * Setter method for property timeout.
+ * Setter method for property timeout
.
*
* @param timeout value to be assigned to property timeout
*/
@@ -109,7 +109,7 @@ public void setTimeout(Integer timeout) {
}
/**
- * Getter method for property addressWaitTime.
+ * Getter method for property addressWaitTime
.
*
* @return property value of addressWaitTime
*/
@@ -118,7 +118,7 @@ public Integer getAddressWaitTime() {
}
/**
- * Setter method for property addressWaitTime.
+ * Setter method for property addressWaitTime
.
*
* @param addressWaitTime value to be assigned to property addressWaitTime
*/
@@ -127,7 +127,7 @@ public void setAddressWaitTime(Integer addressWaitTime) {
}
/**
- * Getter method for property connectTimeout.
+ * Getter method for property connectTimeout
.
*
* @return property value of connectTimeout
*/
@@ -136,7 +136,7 @@ public int getConnectTimeout() {
}
/**
- * Setter method for property connectTimeout.
+ * Setter method for property connectTimeout
.
*
* @param connectTimeout value to be assigned to property connectTimeout
*/
@@ -145,7 +145,7 @@ public void setConnectTimeout(Integer connectTimeout) {
}
/**
- * Getter method for property retries.
+ * Getter method for property retries
.
*
* @return property value of retries
*/
@@ -154,7 +154,7 @@ public Integer getRetries() {
}
/**
- * Setter method for property retries.
+ * Setter method for property retries
.
*
* @param retries value to be assigned to property retries
*/
@@ -163,7 +163,7 @@ public void setRetries(Integer retries) {
}
/**
- * Getter method for property type.
+ * Getter method for property type
.
*
* @return property value of type
*/
@@ -172,7 +172,7 @@ public String getType() {
}
/**
- * Setter method for property type.
+ * Setter method for property type
.
*
* @param type value to be assigned to property type
*/
@@ -181,7 +181,7 @@ public void setType(String type) {
}
/**
- * Getter method for property callbackClass.
+ * Getter method for property callbackClass
.
*
* @return property value of callbackClass
*/
@@ -190,7 +190,7 @@ public String getCallbackClass() {
}
/**
- * Setter method for property callbackClass.
+ * Setter method for property callbackClass
.
*
* @param callbackClass value to be assigned to property callbackClass
*/
@@ -199,7 +199,7 @@ public void setCallbackClass(String callbackClass) {
}
/**
- * Getter method for property callbackRef.
+ * Getter method for property callbackRef
.
*
* @return property value of callbackRef
*/
@@ -208,7 +208,7 @@ public String getCallbackRef() {
}
/**
- * Setter method for property callbackRef.
+ * Setter method for property callbackRef
.
*
* @param callbackRef value to be assigned to property callbackRef
*/
@@ -217,7 +217,7 @@ public void setCallbackRef(String callbackRef) {
}
/**
- * Getter method for property callbackHandler.
+ * Getter method for property callbackHandler
.
*
* @return property value of callbackHandler
*/
@@ -226,7 +226,7 @@ public Object getCallbackHandler() {
}
/**
- * Setter method for property callbackHandler.
+ * Setter method for property callbackHandler
.
*
* @param callbackHandler value to be assigned to property callbackHandler
*/
@@ -235,7 +235,7 @@ public void setCallbackHandler(Object callbackHandler) {
}
/**
- * Getter method for property weight.
+ * Getter method for property weight
.
*
* @return property value of weight
*/
@@ -244,7 +244,7 @@ public Integer getWeight() {
}
/**
- * Setter method for property weight.
+ * Setter method for property weight
.
*
* @param weight value to be assigned to property weight
*/
@@ -253,7 +253,7 @@ public void setWeight(Integer weight) {
}
/**
- * Getter method for property warmUpTime.
+ * Getter method for property warmUpTime
.
*
* @return property value of warmUpTime
*/
@@ -262,7 +262,7 @@ public Integer getWarmUpTime() {
}
/**
- * Setter method for property warmUpTime.
+ * Setter method for property warmUpTime
.
*
* @param warmUpTime value to be assigned to property warmUpTime
*/
@@ -271,7 +271,7 @@ public void setWarmUpTime(Integer warmUpTime) {
}
/**
- * Getter method for property warmUpWeight.
+ * Getter method for property warmUpWeight
.
*
* @return property value of warmUpWeight
*/
@@ -280,7 +280,7 @@ public Integer getWarmUpWeight() {
}
/**
- * Setter method for property warmUpWeight.
+ * Setter method for property warmUpWeight
.
*
* @param warmUpWeight value to be assigned to property warmUpWeight
*/
@@ -289,7 +289,7 @@ public void setWarmUpWeight(Integer warmUpWeight) {
}
/**
- * Getter method for property filters.
+ * Getter method for property filters
.
*
* @return property value of filters
*/
@@ -298,7 +298,7 @@ public List getFilters() {
}
/**
- * Setter method for property filters.
+ * Setter method for property filters
.
*
* @param filters value to be assigned to property filters
*/
@@ -307,7 +307,7 @@ public void setFilters(List filters) {
}
/**
- * Getter method for property methodInfos.
+ * Getter method for property methodInfos
.
*
* @return property value of methodInfos
*/
@@ -316,7 +316,7 @@ public List getMethodInfos() {
}
/**
- * Setter method for property methodInfos.
+ * Setter method for property methodInfos
.
*
* @param methodInfos value to be assigned to property methodInfos
*/
@@ -325,7 +325,7 @@ public void setMethodInfos(List methodInfos) {
}
/**
- * Getter method for property targetUrl.
+ * Getter method for property targetUrl
.
*
* @return property value of targetUrl
*/
@@ -334,7 +334,7 @@ public String getTargetUrl() {
}
/**
- * Setter method for property targetUrl.
+ * Setter method for property targetUrl
.
*
* @param targetUrl value to be assigned to property targetUrl
*/
@@ -343,7 +343,7 @@ public void setTargetUrl(String targetUrl) {
}
/**
- * Getter method for property userThreadPool.
+ * Getter method for property userThreadPool
.
*
* @return property value of userThreadPool
*/
@@ -352,7 +352,7 @@ public UserThreadPool getUserThreadPool() {
}
/**
- * Setter method for property userThreadPool.
+ * Setter method for property userThreadPool
.
*
* @param userThreadPool value to be assigned to property userThreadPool
*/
@@ -361,7 +361,7 @@ public void setUserThreadPool(UserThreadPool userThreadPool) {
}
/**
- * Getter method for property genericInterface.
+ * Getter method for property genericInterface
.
*
* @return property value of genericInterface
*/
@@ -370,7 +370,7 @@ public String getGenericInterface() {
}
/**
- * Setter method for property genericInterface.
+ * Setter method for property genericInterface
.
*
* @param genericInterface value to be assigned to property genericInterface
*/
@@ -379,7 +379,7 @@ public void setGenericInterface(String genericInterface) {
}
/**
- * Getter method for property loadBalancer.
+ * Getter method for property loadBalancer
.
*
* @return property value of loadBalancer
*/
@@ -388,7 +388,7 @@ public String getLoadBalancer() {
}
/**
- * Setter method for property loadBalancer.
+ * Setter method for property loadBalancer
.
*
* @param loadBalancer value to be assigned to property loadBalancer
*/
@@ -397,7 +397,7 @@ public void setLoadBalancer(String loadBalancer) {
}
/**
- * Getter method for property lazy.
+ * Getter method for property lazy
.
*
* @return property value of lazy
*/
@@ -406,7 +406,7 @@ public Boolean getLazy() {
}
/**
- * Setter method for property lazy.
+ * Setter method for property lazy
.
*
* @param lazy value to be assigned to property lazy
*/
@@ -415,7 +415,7 @@ public void setLazy(Boolean lazy) {
}
/**
- * Getter method for property check.
+ * Getter method for property check
.
*
* @return property value of check
*/
@@ -424,7 +424,7 @@ public Boolean getCheck() {
}
/**
- * Setter method for property check.
+ * Setter method for property check
.
*
* @param check value to be assigned to property check
*/
diff --git a/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/test/java/com/alipay/sofa/rpc/boot/test/SofaBootRpcAllTest.java b/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/test/java/com/alipay/sofa/rpc/boot/test/SofaBootRpcAllTest.java
index e3c2f3599..1aa5e24ab 100644
--- a/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/test/java/com/alipay/sofa/rpc/boot/test/SofaBootRpcAllTest.java
+++ b/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/test/java/com/alipay/sofa/rpc/boot/test/SofaBootRpcAllTest.java
@@ -230,7 +230,12 @@ public void testAnnotation() {
@Test
public void testAnnotationProtobuf() {
thrown.expect(SofaRpcException.class);
- thrown.expectMessage("com.alipay.remoting.exception.SerializationException: 0");
+ if (System.getProperty("java.version").startsWith("1.8")) {
+ thrown.expectMessage("com.alipay.remoting.exception.SerializationException: 0");
+ } else {
+ thrown
+ .expectMessage("com.alipay.remoting.exception.SerializationException: Index 0 out of bounds for length 0");
+ }
annotationServicePb.hello();
}
diff --git a/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/test/java/com/alipay/sofa/rpc/boot/test/bean/generic/GenericParamModel.java b/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/test/java/com/alipay/sofa/rpc/boot/test/bean/generic/GenericParamModel.java
index cd43380a3..f0be858db 100644
--- a/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/test/java/com/alipay/sofa/rpc/boot/test/bean/generic/GenericParamModel.java
+++ b/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/test/java/com/alipay/sofa/rpc/boot/test/bean/generic/GenericParamModel.java
@@ -24,7 +24,7 @@ public class GenericParamModel {
private String name;
/**
- * Getter method for property name.
+ * Getter method for property name
.
*
* @return property value of name
*/
@@ -33,7 +33,7 @@ public String getName() {
}
/**
- * Setter method for property name.
+ * Setter method for property name
.
*
* @param name value to be assigned to property name
*/
diff --git a/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/test/java/com/alipay/sofa/rpc/boot/test/bean/generic/GenericResultModel.java b/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/test/java/com/alipay/sofa/rpc/boot/test/bean/generic/GenericResultModel.java
index b3270a00f..5ca873658 100644
--- a/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/test/java/com/alipay/sofa/rpc/boot/test/bean/generic/GenericResultModel.java
+++ b/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/test/java/com/alipay/sofa/rpc/boot/test/bean/generic/GenericResultModel.java
@@ -26,7 +26,7 @@ public class GenericResultModel {
private String value;
/**
- * Getter method for property name.
+ * Getter method for property name
.
*
* @return property value of name
*/
@@ -35,7 +35,7 @@ public String getName() {
}
/**
- * Setter method for property name.
+ * Setter method for property name
.
*
* @param name value to be assigned to property name
*/
@@ -44,7 +44,7 @@ public void setName(String name) {
}
/**
- * Getter method for property value.
+ * Getter method for property value
.
*
* @return property value of value
*/
@@ -53,7 +53,7 @@ public String getValue() {
}
/**
- * Setter method for property value.
+ * Setter method for property value
.
*
* @param value value to be assigned to property value
*/
diff --git a/sofa-boot-project/sofa-boot-parent/pom.xml b/sofa-boot-project/sofa-boot-parent/pom.xml
index cb786f346..84f700452 100644
--- a/sofa-boot-project/sofa-boot-parent/pom.xml
+++ b/sofa-boot-project/sofa-boot-parent/pom.xml
@@ -26,8 +26,8 @@
3.1
3.0.0
2.9.1
- 0.7.9
- 2.21.0
+ 0.8.7
+ 2.22.2
2.1.0.RELEASE
@@ -338,7 +338,6 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 2.10.1
attach-javadocs
@@ -423,9 +422,24 @@
false
- -Djdk.attach.allowAttachSelf --add-opens java.base/jdk.internal.loader=ALL-UNNAMED
+ @{argLine} -Djdk.attach.allowAttachSelf --add-opens java.base/jdk.internal.loader=ALL-UNNAMED
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+
+
+ attach-javadocs
+
+ jar
+
+
+ -source 8
+
+
+
+
diff --git a/sofa-boot-project/sofa-boot-tools/sofa-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/SofaBootPlugin.java b/sofa-boot-project/sofa-boot-tools/sofa-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/SofaBootPlugin.java
index 5f9e77924..f6eb309f1 100644
--- a/sofa-boot-project/sofa-boot-tools/sofa-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/SofaBootPlugin.java
+++ b/sofa-boot-project/sofa-boot-tools/sofa-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/SofaBootPlugin.java
@@ -74,9 +74,13 @@ public void apply(Project project) {
}
private void verifyGradleVersion() {
- if (GradleVersion.current().compareTo(GradleVersion.version("4.4")) < 0) {
- throw new GradleException("SOFA Boot plugin requires Gradle 4.4 or later."
- + " The current version is " + GradleVersion.current());
+ GradleVersion currentVersion = GradleVersion.current();
+ if (currentVersion.compareTo(GradleVersion.version("5.6")) < 0
+ || (currentVersion.getBaseVersion().compareTo(GradleVersion.version("6.0")) >= 0 && currentVersion
+ .compareTo(GradleVersion.version("6.3")) < 0)) {
+ throw new GradleException(
+ "SOFABoot plugin requires Gradle 5 (5.6.x only) or Gradle 6 (6.3 or later). "
+ + "The current version is " + currentVersion);
}
}
diff --git a/sofa-boot-project/sofa-boot-tools/sofa-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilitySuite.java b/sofa-boot-project/sofa-boot-tools/sofa-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilitySuite.java
index 1c86fa8d9..af38bcf4b 100644
--- a/sofa-boot-project/sofa-boot-tools/sofa-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilitySuite.java
+++ b/sofa-boot-project/sofa-boot-tools/sofa-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilitySuite.java
@@ -18,9 +18,9 @@
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collections;
import java.util.List;
+import org.gradle.api.JavaVersion;
import org.gradle.api.Rule;
import org.junit.runner.Runner;
import org.junit.runners.BlockJUnit4ClassRunner;
@@ -44,10 +44,12 @@ public static void main(String[] args) {
private static List GRADLE_VERSIONS;
static {
- if (System.getProperty("java.version").startsWith("11")) {
- GRADLE_VERSIONS = Collections.singletonList("5.0");
+ JavaVersion javaVersion = JavaVersion.current();
+ if (javaVersion.isCompatibleWith(JavaVersion.VERSION_14)
+ || javaVersion.isCompatibleWith(JavaVersion.VERSION_13)) {
+ GRADLE_VERSIONS = Arrays.asList("6.3", "6.4.1", "6.5.1", "6.6.1", "6.7.1");
} else {
- GRADLE_VERSIONS = Arrays.asList("5.6.4", "6.3", "6.4.1", "6.5.1", "default");
+ GRADLE_VERSIONS = Arrays.asList("5.6.4", "6.3", "6.4.1", "6.5.1", "6.6.1", "6.7.1");
}
}