diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
new file mode 100644
index 000000000..e57268b8a
--- /dev/null
+++ b/.github/workflows/maven.yml
@@ -0,0 +1,23 @@
+name: Java CI
+
+on: [push]
+
+jobs:
+ test:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [ubuntu-18.04]
+ java: [8, 8.0.192, 11, 11.0.9]
+ fail-fast: false
+ max-parallel: 2
+ name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
+
+ steps:
+ - uses: actions/checkout@v1
+ - name: Set up JDK
+ uses: actions/setup-java@v1
+ with:
+ java-version: ${{ matrix.java }}
+ - name: Test with Maven
+ run: mvn test -B --file pom.xml
diff --git a/.travis.yml b/.travis.yml
index fc6fa7748..b0213452a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -28,9 +28,13 @@ before_install:
script:
- mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true
+ - mvn clean -Premove-test-data
- mvn -Prelease-nacos -Dmaven.test.skip=true clean install -U
+ - mvn clean -Premove-test-data
- mvn clean install -Pcit-test
+ - mvn clean -Premove-test-data
- mvn clean package -Pit-test
+ - mvn clean -Premove-test-data
after_success:
- mvn clean package -Pit-test
- mvn sonar:sonar -Psonar-apache
diff --git a/address/pom.xml b/address/pom.xml
index 20b8fb477..0baed3132 100644
--- a/address/pom.xml
+++ b/address/pom.xml
@@ -19,7 +19,7 @@
+ * serviceName = "@@"; the length = 0; illegal + * serviceName = "group@@"; the length = 1; illegal + * serviceName = "@@serviceName"; the length = 2; legal + * serviceName = "group@@serviceName"; the length = 2; legal + *+ * + * @param combineServiceName such as: groupName@@serviceName + */ + public static void checkServiceNameFormat(String combineServiceName) { + String[] split = combineServiceName.split(Constants.SERVICE_INFO_SPLITER); + if (split.length <= 1) { + throw new IllegalArgumentException( + "Param 'serviceName' is illegal, it should be format as 'groupName@@serviceName'"); + } + } } diff --git a/api/src/main/java/com/alibaba/nacos/api/selector/AbstractSelector.java b/api/src/main/java/com/alibaba/nacos/api/selector/AbstractSelector.java index 6b152c320..8acd41ac4 100644 --- a/api/src/main/java/com/alibaba/nacos/api/selector/AbstractSelector.java +++ b/api/src/main/java/com/alibaba/nacos/api/selector/AbstractSelector.java @@ -20,6 +20,8 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; +import java.io.Serializable; + /** * Abstract selector that only contains a type. * @@ -27,7 +29,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; * @since 0.7.0 */ @JsonTypeInfo(use = Id.NAME, property = "type", defaultImpl = NoneSelector.class) -public abstract class AbstractSelector { +public abstract class AbstractSelector implements Serializable { + + private static final long serialVersionUID = 4530233098102379229L; /** * The type of this selector, each child class should announce its own unique type. diff --git a/auth/pom.xml b/auth/pom.xml index afd43988b..b9e5b4892 100644 --- a/auth/pom.xml +++ b/auth/pom.xml @@ -21,7 +21,7 @@