From 9a6f4fa891feeebb5587066989c00cf8f2287f51 Mon Sep 17 00:00:00 2001 From: Ahoo Wang Date: Mon, 19 Jun 2023 21:49:56 +0800 Subject: [PATCH] Adapt to sprig-boot-3 (#190) --- .github/workflows/benchmark-test.yml | 8 ++++---- .github/workflows/codecov.yml | 4 ++-- .github/workflows/docker-deploy.yml | 4 ++-- .github/workflows/integration-test.yml | 4 ++-- .github/workflows/package-deploy.yml | 8 ++++---- build.gradle.kts | 5 +---- cosky-config/src/main/resources/config_remove.lua | 4 ++-- cosky-config/src/main/resources/config_rollback.lua | 4 ++-- cosky-config/src/main/resources/config_set.lua | 4 ++-- cosky-dashboard/package.json | 2 +- cosky-dependencies/build.gradle.kts | 10 +++++----- .../src/main/resources/registry_remove_service.lua | 2 +- cosky-discovery/src/main/resources/registry_renew.lua | 2 +- .../src/main/resources/registry_set_metadata.lua | 4 ++-- .../src/main/resources/registry_set_service.lua | 3 ++- cosky-rest-api/build.gradle.kts | 8 ++++---- .../rest/configuration/GlobalRestExceptionHandler.kt | 2 +- .../me/ahoo/cosky/rest/security/SecurityProperties.kt | 3 --- .../rest/security/audit/AuditLogHandlerInterceptor.kt | 2 +- .../authentication/RefreshTokenAuthentication.kt | 2 +- cosky-spring-cloud-core/build.gradle.kts | 1 - .../build.gradle.kts | 0 .../spring/cloud/CoSkyConfigAutoConfiguration.kt | 0 .../spring/cloud/CoSkyConfigBootstrapConfiguration.kt | 0 .../cosky/config/spring/cloud/CoSkyConfigProperties.kt | 0 .../config/spring/cloud/CoSkyPropertySourceLocator.kt | 0 .../spring/cloud/ConditionalOnCoSkyConfigEnabled.kt | 0 .../spring/cloud/refresh/CoSkyConfigRefresher.kt | 0 .../src/main/resources/META-INF/spring.factories | 0 ...mework.boot.autoconfigure.AutoConfiguration.imports | 0 .../spring/cloud/CoSkyConfigAutoConfigurationTest.kt | 0 .../cloud/CoSkyConfigBootstrapConfigurationTest.kt | 0 .../spring/cloud/CoSkyPropertySourceLocatorTest.kt | 0 .../build.gradle.kts | 0 .../cloud/discovery/CoSkyDiscoveryAutoConfiguration.kt | 0 .../spring/cloud/discovery/CoSkyDiscoveryClient.kt | 0 .../discovery/CoSkyDiscoveryClientConfiguration.kt | 0 .../spring/cloud/discovery/CoSkyDiscoveryProperties.kt | 2 -- .../cloud/discovery/CoSkyReactiveDiscoveryClient.kt | 0 .../CoSkyReactiveDiscoveryClientConfiguration.kt | 0 .../spring/cloud/discovery/CoSkyServiceInstance.kt | 0 .../discovery/ConditionalOnCoSkyDiscoveryEnabled.kt | 0 .../cloud/registry/CoSkyAutoServiceRegistration.kt | 0 .../CoSkyAutoServiceRegistrationAutoConfiguration.kt | 0 .../registry/CoSkyAutoServiceRegistrationOfNoneWeb.kt | 2 +- .../spring/cloud/registry/CoSkyRegistration.kt | 0 .../spring/cloud/registry/CoSkyRegistryProperties.kt | 2 -- .../spring/cloud/registry/CoSkyServiceRegistry.kt | 0 .../registry/ConditionalOnAutoRegistrationEnabled.kt | 0 .../discovery/spring/cloud/support/StatusConstants.kt | 0 ...mework.boot.autoconfigure.AutoConfiguration.imports | 0 .../discovery/CoSkyDiscoveryAutoConfigurationTest.kt | 0 .../discovery/CoSkyDiscoveryClientConfigurationTest.kt | 0 .../spring/cloud/discovery/CoSkyDiscoveryClientTest.kt | 0 .../CoSkyReactiveDiscoveryClientConfigurationTest.kt | 0 ...oSkyAutoServiceRegistrationAutoConfigurationTest.kt | 0 .../spring/cloud/registry/CoSkyServiceRegistryTest.kt | 0 examples/cosky-service-consumer/build.gradle.kts | 6 +++--- examples/cosky-service-provider-api/build.gradle.kts | 2 +- examples/cosky-service-provider/build.gradle.kts | 6 +++--- gradle.properties | 3 ++- settings.gradle.kts | 4 ++-- 62 files changed, 52 insertions(+), 61 deletions(-) rename {spring-cloud-starter-cosky-config => cosky-spring-cloud-starter-config}/build.gradle.kts (100%) rename {spring-cloud-starter-cosky-config => cosky-spring-cloud-starter-config}/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigAutoConfiguration.kt (100%) rename {spring-cloud-starter-cosky-config => cosky-spring-cloud-starter-config}/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigBootstrapConfiguration.kt (100%) rename {spring-cloud-starter-cosky-config => cosky-spring-cloud-starter-config}/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigProperties.kt (100%) rename {spring-cloud-starter-cosky-config => cosky-spring-cloud-starter-config}/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyPropertySourceLocator.kt (100%) rename {spring-cloud-starter-cosky-config => cosky-spring-cloud-starter-config}/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/ConditionalOnCoSkyConfigEnabled.kt (100%) rename {spring-cloud-starter-cosky-config => cosky-spring-cloud-starter-config}/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/refresh/CoSkyConfigRefresher.kt (100%) rename {spring-cloud-starter-cosky-config => cosky-spring-cloud-starter-config}/src/main/resources/META-INF/spring.factories (100%) rename {spring-cloud-starter-cosky-config => cosky-spring-cloud-starter-config}/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports (100%) rename {spring-cloud-starter-cosky-config => cosky-spring-cloud-starter-config}/src/test/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigAutoConfigurationTest.kt (100%) rename {spring-cloud-starter-cosky-config => cosky-spring-cloud-starter-config}/src/test/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigBootstrapConfigurationTest.kt (100%) rename {spring-cloud-starter-cosky-config => cosky-spring-cloud-starter-config}/src/test/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyPropertySourceLocatorTest.kt (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/build.gradle.kts (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryAutoConfiguration.kt (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClient.kt (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClientConfiguration.kt (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryProperties.kt (93%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyReactiveDiscoveryClient.kt (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyReactiveDiscoveryClientConfiguration.kt (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyServiceInstance.kt (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/ConditionalOnCoSkyDiscoveryEnabled.kt (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistration.kt (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistrationAutoConfiguration.kt (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistrationOfNoneWeb.kt (98%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyRegistration.kt (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyRegistryProperties.kt (95%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyServiceRegistry.kt (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/ConditionalOnAutoRegistrationEnabled.kt (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/support/StatusConstants.kt (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryAutoConfigurationTest.kt (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClientConfigurationTest.kt (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClientTest.kt (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyReactiveDiscoveryClientConfigurationTest.kt (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistrationAutoConfigurationTest.kt (100%) rename {spring-cloud-starter-cosky-discovery => cosky-spring-cloud-starter-discovery}/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyServiceRegistryTest.kt (100%) diff --git a/.github/workflows/benchmark-test.yml b/.github/workflows/benchmark-test.yml index dd50d4b9..cb59b156 100644 --- a/.github/workflows/benchmark-test.yml +++ b/.github/workflows/benchmark-test.yml @@ -41,10 +41,10 @@ jobs: - name: Checkout uses: actions/checkout@master - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: '11' + java-version: '17' distribution: 'adopt' server-id: github settings-path: ${{ github.workspace }} @@ -69,10 +69,10 @@ jobs: - name: Checkout uses: actions/checkout@master - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: '11' + java-version: '17' distribution: 'adopt' server-id: github settings-path: ${{ github.workspace }} diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 1826c1db..401b827a 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -19,10 +19,10 @@ jobs: - name: Checkout uses: actions/checkout@master - - name: Set up JDK 8 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: '8' + java-version: '17' distribution: 'adopt' server-id: github settings-path: ${{ github.workspace }} diff --git a/.github/workflows/docker-deploy.yml b/.github/workflows/docker-deploy.yml index 3c7add76..651a5ba0 100644 --- a/.github/workflows/docker-deploy.yml +++ b/.github/workflows/docker-deploy.yml @@ -43,10 +43,10 @@ jobs: working-directory: cosky-dashboard run: npm install && npm install -g @angular/cli && ng build - - name: Set up JDK 8 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: '8' + java-version: '17' distribution: 'adopt' server-id: github settings-path: ${{ github.workspace }} diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 02df45f4..48b68a58 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -31,10 +31,10 @@ jobs: - name: Checkout uses: actions/checkout@master - - name: Set up JDK 8 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: '8' + java-version: '17' distribution: 'adopt' server-id: github settings-path: ${{ github.workspace }} diff --git a/.github/workflows/package-deploy.yml b/.github/workflows/package-deploy.yml index f6e9fa4d..fe01058c 100644 --- a/.github/workflows/package-deploy.yml +++ b/.github/workflows/package-deploy.yml @@ -26,10 +26,10 @@ jobs: - name: Checkout uses: actions/checkout@master - - name: Set up JDK 8 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: '8' + java-version: '17' distribution: 'adopt' server-id: github settings-path: ${{ github.workspace }} @@ -47,10 +47,10 @@ jobs: - name: Checkout uses: actions/checkout@master - - name: Set up JDK 8 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: '8' + java-version: '17' distribution: 'adopt' server-id: github settings-path: ${{ github.workspace }} diff --git a/build.gradle.kts b/build.gradle.kts index 12a2b760..44e84c94 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -36,9 +36,6 @@ val coreProjects = setOf( project(":cosky-discovery"), ) val restApiProject = project(":cosky-rest-api") -// TODO -// val mirrorProject = project(":cosky-mirror") -// val serverProjects = setOf(restApiProject, mirrorProject) val serverProjects = setOf(restApiProject) val exampleProjects = setOf( project(":cosky-service-provider"), @@ -86,7 +83,7 @@ configure(libraryProjects) { apply() configure() { jvmToolchain { - languageVersion.set(JavaLanguageVersion.of(8)) + languageVersion.set(JavaLanguageVersion.of(17)) } } tasks.withType { diff --git a/cosky-config/src/main/resources/config_remove.lua b/cosky-config/src/main/resources/config_remove.lua index 26305bc7..e402b996 100644 --- a/cosky-config/src/main/resources/config_remove.lua +++ b/cosky-config/src/main/resources/config_remove.lua @@ -27,9 +27,9 @@ end local currentVersion = redis.call("hget", configKey, versionField) if currentVersion then - local result = addHistory(currentVersion, configKey, op); + addHistory(currentVersion, configKey, op); redis.call("publish", configKey, op); - return result; + return 1; else return 0; end diff --git a/cosky-config/src/main/resources/config_rollback.lua b/cosky-config/src/main/resources/config_rollback.lua index 3f4e06aa..bee8843c 100644 --- a/cosky-config/src/main/resources/config_rollback.lua +++ b/cosky-config/src/main/resources/config_rollback.lua @@ -55,6 +55,6 @@ addHistory(currentVersion, configKey, op) local data = targetHistoryConfig["data"]; local createTime = redis.call('time')[1]; -local result = redis.call("hmset", configKey, "configId", configId, "data", data, hashField, targetHash, versionField, nextVersion, "createTime", createTime); +redis.call("hmset", configKey, "configId", configId, "data", data, hashField, targetHash, versionField, nextVersion, "createTime", createTime); redis.call("publish", configKey, op); -return result; +return 1; diff --git a/cosky-config/src/main/resources/config_set.lua b/cosky-config/src/main/resources/config_set.lua index 5149d0ef..b27780a7 100644 --- a/cosky-config/src/main/resources/config_set.lua +++ b/cosky-config/src/main/resources/config_set.lua @@ -43,6 +43,6 @@ else end local createTime = redis.call('time')[1]; -local result = redis.call("hmset", configKey, "configId", configId, "data", data, hashField, hash, versionField, nextVersion, "createTime", createTime); +redis.call("hmset", configKey, "configId", configId, "data", data, hashField, hash, versionField, nextVersion, "createTime", createTime); redis.call("publish", configKey, op); -return result; +return 1; diff --git a/cosky-dashboard/package.json b/cosky-dashboard/package.json index 8351fc09..23ad7d27 100644 --- a/cosky-dashboard/package.json +++ b/cosky-dashboard/package.json @@ -1,6 +1,6 @@ { "name": "cosky-dashboard", - "version": "3.4.0", + "version": "4.0.0", "scripts": { "ng": "ng", "start": "ng serve", diff --git a/cosky-dependencies/build.gradle.kts b/cosky-dependencies/build.gradle.kts index da4acb68..01c1e8a6 100644 --- a/cosky-dependencies/build.gradle.kts +++ b/cosky-dependencies/build.gradle.kts @@ -12,11 +12,11 @@ */ dependencies { - api(platform("org.springframework.boot:spring-boot-dependencies:2.7.12")) - api(platform("org.springframework.cloud:spring-cloud-dependencies:2021.0.7")) - api(platform("me.ahoo.cosid:cosid-bom:1.19.3")) - api(platform("me.ahoo.simba:simba-bom:0.6.6")) - api(platform("me.ahoo.cosec:cosec-bom:1.18.2")) + api(platform("org.springframework.boot:spring-boot-dependencies:3.1.0")) + api(platform("org.springframework.cloud:spring-cloud-dependencies:2022.0.3")) + api(platform("me.ahoo.cosid:cosid-bom:2.1.0")) + api(platform("me.ahoo.simba:simba-bom:2.0.0")) + api(platform("me.ahoo.cosec:cosec-bom:2.0.0-M1")) constraints { api("com.google.guava:guava:32.0.1-jre") api("commons-io:commons-io:2.13.0") diff --git a/cosky-discovery/src/main/resources/registry_remove_service.lua b/cosky-discovery/src/main/resources/registry_remove_service.lua index 562e295e..cad6c6c6 100644 --- a/cosky-discovery/src/main/resources/registry_remove_service.lua +++ b/cosky-discovery/src/main/resources/registry_remove_service.lua @@ -17,4 +17,4 @@ if affected > 0 then redis.call("hdel", serviceIdxStatKey, serviceId); end -return affected; +return 1; diff --git a/cosky-discovery/src/main/resources/registry_renew.lua b/cosky-discovery/src/main/resources/registry_renew.lua index 09555b37..7fde454a 100644 --- a/cosky-discovery/src/main/resources/registry_renew.lua +++ b/cosky-discovery/src/main/resources/registry_renew.lua @@ -37,5 +37,5 @@ if shouldPub then redis.call("publish", instanceKey, "renew"); end -return result; +return 1; diff --git a/cosky-discovery/src/main/resources/registry_set_metadata.lua b/cosky-discovery/src/main/resources/registry_set_metadata.lua index 7b2c8301..8ae2f16c 100644 --- a/cosky-discovery/src/main/resources/registry_set_metadata.lua +++ b/cosky-discovery/src/main/resources/registry_set_metadata.lua @@ -15,7 +15,7 @@ if #instanceKeys > 0 then end end -local result = redis.call("hmset", instanceKey, unpack(ARGV, 2, #ARGV)); +redis.call("hmset", instanceKey, unpack(ARGV, 2, #ARGV)); redis.call("publish", instanceKey, "set_metadata"); -return result; +return 1; diff --git a/cosky-discovery/src/main/resources/registry_set_service.lua b/cosky-discovery/src/main/resources/registry_set_service.lua index 79910c52..0cef5d05 100644 --- a/cosky-discovery/src/main/resources/registry_set_service.lua +++ b/cosky-discovery/src/main/resources/registry_set_service.lua @@ -9,6 +9,7 @@ local affected = redis.call("sadd", serviceIdxKey, serviceId); if affected > 0 then redis.call("publish", serviceIdxKey, "set"); redis.call("hset", serviceIdxStatKey, serviceId, 0); + return 1; end -return affected; +return 0; diff --git a/cosky-rest-api/build.gradle.kts b/cosky-rest-api/build.gradle.kts index 07d0fdbc..26324887 100644 --- a/cosky-rest-api/build.gradle.kts +++ b/cosky-rest-api/build.gradle.kts @@ -20,7 +20,7 @@ plugins { java { toolchain { - languageVersion.set(JavaLanguageVersion.of(8)) + languageVersion.set(JavaLanguageVersion.of(17)) } } tasks.jar.configure { @@ -52,7 +52,7 @@ application { "-XX:MaxDirectMemorySize=256M", "-Xss1m", "-server", - "-XX:+UseG1GC", + "-XX:+UseZGC", "-Xlog:gc*:file=logs/$applicationName-gc.log:time,tags:filecount=10,filesize=32M", "-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpPath=data", @@ -76,8 +76,8 @@ dependencies { implementation("org.springdoc:springdoc-openapi-kotlin") implementation("org.springdoc:springdoc-openapi-webflux-ui") implementation("org.springframework.boot:spring-boot-starter-actuator") - implementation(project(":spring-cloud-starter-cosky-config")) - implementation(project(":spring-cloud-starter-cosky-discovery")) + implementation(project(":cosky-spring-cloud-starter-config")) + implementation(project(":cosky-spring-cloud-starter-discovery")) implementation("com.google.guava:guava") implementation("me.ahoo.cosid:cosid-spring-redis") implementation("me.ahoo.cosid:cosid-spring-boot-starter") diff --git a/cosky-rest-api/src/main/kotlin/me/ahoo/cosky/rest/configuration/GlobalRestExceptionHandler.kt b/cosky-rest-api/src/main/kotlin/me/ahoo/cosky/rest/configuration/GlobalRestExceptionHandler.kt index 9ab789a9..924868f1 100644 --- a/cosky-rest-api/src/main/kotlin/me/ahoo/cosky/rest/configuration/GlobalRestExceptionHandler.kt +++ b/cosky-rest-api/src/main/kotlin/me/ahoo/cosky/rest/configuration/GlobalRestExceptionHandler.kt @@ -39,7 +39,7 @@ class GlobalRestExceptionHandler { } @ExceptionHandler - @ResponseStatus + @ResponseStatus(HttpStatus.BAD_REQUEST) fun handleAll(ex: Exception): ErrorResponse { if (log.isErrorEnabled) { log.error(ex.message, ex) diff --git a/cosky-rest-api/src/main/kotlin/me/ahoo/cosky/rest/security/SecurityProperties.kt b/cosky-rest-api/src/main/kotlin/me/ahoo/cosky/rest/security/SecurityProperties.kt index e513df80..7a925e3b 100644 --- a/cosky-rest-api/src/main/kotlin/me/ahoo/cosky/rest/security/SecurityProperties.kt +++ b/cosky-rest-api/src/main/kotlin/me/ahoo/cosky/rest/security/SecurityProperties.kt @@ -15,21 +15,18 @@ package me.ahoo.cosky.rest.security import me.ahoo.cosky.core.CoSky import me.ahoo.cosky.rest.security.rbac.Action import org.springframework.boot.context.properties.ConfigurationProperties -import org.springframework.boot.context.properties.ConstructorBinding /** * Security Properties. * * @author ahoo wang */ -@ConstructorBinding @ConfigurationProperties(SecurityProperties.PREFIX) class SecurityProperties( val enabled: Boolean = true, val enforceInitSuperUser: Boolean = false, val auditLog: AuditLog = AuditLog() ) { - @ConstructorBinding data class AuditLog( val action: Action = Action.WRITE ) diff --git a/cosky-rest-api/src/main/kotlin/me/ahoo/cosky/rest/security/audit/AuditLogHandlerInterceptor.kt b/cosky-rest-api/src/main/kotlin/me/ahoo/cosky/rest/security/audit/AuditLogHandlerInterceptor.kt index 998002ed..f3bedd1b 100644 --- a/cosky-rest-api/src/main/kotlin/me/ahoo/cosky/rest/security/audit/AuditLogHandlerInterceptor.kt +++ b/cosky-rest-api/src/main/kotlin/me/ahoo/cosky/rest/security/audit/AuditLogHandlerInterceptor.kt @@ -55,7 +55,7 @@ class AuditLogHandlerInterceptor( } else { exchange.getSecurityContext()?.principal?.id.orEmpty() } - val action = request.method!!.name + val action = request.method.name() val ip = requireNotNull(request.remoteAddress).hostString val status = requireNotNull(exchange.response.statusCode).value() val msg = if (throwable?.message != null) throwable.message!! else "" diff --git a/cosky-rest-api/src/main/kotlin/me/ahoo/cosky/rest/security/authentication/RefreshTokenAuthentication.kt b/cosky-rest-api/src/main/kotlin/me/ahoo/cosky/rest/security/authentication/RefreshTokenAuthentication.kt index ee9d4dec..3ef9ba53 100644 --- a/cosky-rest-api/src/main/kotlin/me/ahoo/cosky/rest/security/authentication/RefreshTokenAuthentication.kt +++ b/cosky-rest-api/src/main/kotlin/me/ahoo/cosky/rest/security/authentication/RefreshTokenAuthentication.kt @@ -8,7 +8,7 @@ import me.ahoo.cosec.token.TokenVerifier import org.springframework.stereotype.Service import reactor.core.publisher.Mono import reactor.kotlin.core.publisher.toMono -import javax.validation.constraints.NotBlank +import jakarta.validation.constraints.NotBlank @Service class RefreshTokenAuthentication( diff --git a/cosky-spring-cloud-core/build.gradle.kts b/cosky-spring-cloud-core/build.gradle.kts index bda72008..64579275 100644 --- a/cosky-spring-cloud-core/build.gradle.kts +++ b/cosky-spring-cloud-core/build.gradle.kts @@ -24,6 +24,5 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-data-redis") kapt("org.springframework.boot:spring-boot-configuration-processor") kapt("org.springframework.boot:spring-boot-autoconfigure-processor") - testImplementation("org.springframework.boot:spring-boot-starter-test") } diff --git a/spring-cloud-starter-cosky-config/build.gradle.kts b/cosky-spring-cloud-starter-config/build.gradle.kts similarity index 100% rename from spring-cloud-starter-cosky-config/build.gradle.kts rename to cosky-spring-cloud-starter-config/build.gradle.kts diff --git a/spring-cloud-starter-cosky-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigAutoConfiguration.kt b/cosky-spring-cloud-starter-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigAutoConfiguration.kt similarity index 100% rename from spring-cloud-starter-cosky-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigAutoConfiguration.kt rename to cosky-spring-cloud-starter-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigAutoConfiguration.kt diff --git a/spring-cloud-starter-cosky-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigBootstrapConfiguration.kt b/cosky-spring-cloud-starter-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigBootstrapConfiguration.kt similarity index 100% rename from spring-cloud-starter-cosky-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigBootstrapConfiguration.kt rename to cosky-spring-cloud-starter-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigBootstrapConfiguration.kt diff --git a/spring-cloud-starter-cosky-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigProperties.kt b/cosky-spring-cloud-starter-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigProperties.kt similarity index 100% rename from spring-cloud-starter-cosky-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigProperties.kt rename to cosky-spring-cloud-starter-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigProperties.kt diff --git a/spring-cloud-starter-cosky-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyPropertySourceLocator.kt b/cosky-spring-cloud-starter-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyPropertySourceLocator.kt similarity index 100% rename from spring-cloud-starter-cosky-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyPropertySourceLocator.kt rename to cosky-spring-cloud-starter-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyPropertySourceLocator.kt diff --git a/spring-cloud-starter-cosky-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/ConditionalOnCoSkyConfigEnabled.kt b/cosky-spring-cloud-starter-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/ConditionalOnCoSkyConfigEnabled.kt similarity index 100% rename from spring-cloud-starter-cosky-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/ConditionalOnCoSkyConfigEnabled.kt rename to cosky-spring-cloud-starter-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/ConditionalOnCoSkyConfigEnabled.kt diff --git a/spring-cloud-starter-cosky-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/refresh/CoSkyConfigRefresher.kt b/cosky-spring-cloud-starter-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/refresh/CoSkyConfigRefresher.kt similarity index 100% rename from spring-cloud-starter-cosky-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/refresh/CoSkyConfigRefresher.kt rename to cosky-spring-cloud-starter-config/src/main/kotlin/me/ahoo/cosky/config/spring/cloud/refresh/CoSkyConfigRefresher.kt diff --git a/spring-cloud-starter-cosky-config/src/main/resources/META-INF/spring.factories b/cosky-spring-cloud-starter-config/src/main/resources/META-INF/spring.factories similarity index 100% rename from spring-cloud-starter-cosky-config/src/main/resources/META-INF/spring.factories rename to cosky-spring-cloud-starter-config/src/main/resources/META-INF/spring.factories diff --git a/spring-cloud-starter-cosky-config/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/cosky-spring-cloud-starter-config/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports similarity index 100% rename from spring-cloud-starter-cosky-config/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename to cosky-spring-cloud-starter-config/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports diff --git a/spring-cloud-starter-cosky-config/src/test/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigAutoConfigurationTest.kt b/cosky-spring-cloud-starter-config/src/test/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigAutoConfigurationTest.kt similarity index 100% rename from spring-cloud-starter-cosky-config/src/test/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigAutoConfigurationTest.kt rename to cosky-spring-cloud-starter-config/src/test/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigAutoConfigurationTest.kt diff --git a/spring-cloud-starter-cosky-config/src/test/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigBootstrapConfigurationTest.kt b/cosky-spring-cloud-starter-config/src/test/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigBootstrapConfigurationTest.kt similarity index 100% rename from spring-cloud-starter-cosky-config/src/test/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigBootstrapConfigurationTest.kt rename to cosky-spring-cloud-starter-config/src/test/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyConfigBootstrapConfigurationTest.kt diff --git a/spring-cloud-starter-cosky-config/src/test/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyPropertySourceLocatorTest.kt b/cosky-spring-cloud-starter-config/src/test/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyPropertySourceLocatorTest.kt similarity index 100% rename from spring-cloud-starter-cosky-config/src/test/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyPropertySourceLocatorTest.kt rename to cosky-spring-cloud-starter-config/src/test/kotlin/me/ahoo/cosky/config/spring/cloud/CoSkyPropertySourceLocatorTest.kt diff --git a/spring-cloud-starter-cosky-discovery/build.gradle.kts b/cosky-spring-cloud-starter-discovery/build.gradle.kts similarity index 100% rename from spring-cloud-starter-cosky-discovery/build.gradle.kts rename to cosky-spring-cloud-starter-discovery/build.gradle.kts diff --git a/spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryAutoConfiguration.kt b/cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryAutoConfiguration.kt similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryAutoConfiguration.kt rename to cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryAutoConfiguration.kt diff --git a/spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClient.kt b/cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClient.kt similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClient.kt rename to cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClient.kt diff --git a/spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClientConfiguration.kt b/cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClientConfiguration.kt similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClientConfiguration.kt rename to cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClientConfiguration.kt diff --git a/spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryProperties.kt b/cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryProperties.kt similarity index 93% rename from spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryProperties.kt rename to cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryProperties.kt index 6bc6f8a7..f1bb7514 100644 --- a/spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryProperties.kt +++ b/cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryProperties.kt @@ -14,7 +14,6 @@ package me.ahoo.cosky.discovery.spring.cloud.discovery import me.ahoo.cosky.spring.cloud.CoSkyProperties import org.springframework.boot.context.properties.ConfigurationProperties -import org.springframework.boot.context.properties.ConstructorBinding import java.time.Duration /** @@ -22,7 +21,6 @@ import java.time.Duration * * @author ahoo wang */ -@ConstructorBinding @ConfigurationProperties(CoSkyDiscoveryProperties.PREFIX) data class CoSkyDiscoveryProperties( val enabled: Boolean = true, diff --git a/spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyReactiveDiscoveryClient.kt b/cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyReactiveDiscoveryClient.kt similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyReactiveDiscoveryClient.kt rename to cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyReactiveDiscoveryClient.kt diff --git a/spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyReactiveDiscoveryClientConfiguration.kt b/cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyReactiveDiscoveryClientConfiguration.kt similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyReactiveDiscoveryClientConfiguration.kt rename to cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyReactiveDiscoveryClientConfiguration.kt diff --git a/spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyServiceInstance.kt b/cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyServiceInstance.kt similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyServiceInstance.kt rename to cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyServiceInstance.kt diff --git a/spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/ConditionalOnCoSkyDiscoveryEnabled.kt b/cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/ConditionalOnCoSkyDiscoveryEnabled.kt similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/ConditionalOnCoSkyDiscoveryEnabled.kt rename to cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/ConditionalOnCoSkyDiscoveryEnabled.kt diff --git a/spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistration.kt b/cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistration.kt similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistration.kt rename to cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistration.kt diff --git a/spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistrationAutoConfiguration.kt b/cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistrationAutoConfiguration.kt similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistrationAutoConfiguration.kt rename to cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistrationAutoConfiguration.kt diff --git a/spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistrationOfNoneWeb.kt b/cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistrationOfNoneWeb.kt similarity index 98% rename from spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistrationOfNoneWeb.kt rename to cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistrationOfNoneWeb.kt index 8706e4f1..05b50fc2 100644 --- a/spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistrationOfNoneWeb.kt +++ b/cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistrationOfNoneWeb.kt @@ -12,6 +12,7 @@ */ package me.ahoo.cosky.discovery.spring.cloud.registry +import jakarta.annotation.PreDestroy import me.ahoo.cosky.core.util.ProcessId import me.ahoo.cosky.discovery.ServiceInstanceContext import org.slf4j.LoggerFactory @@ -21,7 +22,6 @@ import org.springframework.boot.web.context.WebServerApplicationContext import org.springframework.context.ApplicationContext import org.springframework.context.ApplicationContextAware import org.springframework.context.ApplicationListener -import javax.annotation.PreDestroy /** * CoSky Auto Service Registration Of None Web. diff --git a/spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyRegistration.kt b/cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyRegistration.kt similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyRegistration.kt rename to cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyRegistration.kt diff --git a/spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyRegistryProperties.kt b/cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyRegistryProperties.kt similarity index 95% rename from spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyRegistryProperties.kt rename to cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyRegistryProperties.kt index 12609cf5..c4d9081e 100644 --- a/spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyRegistryProperties.kt +++ b/cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyRegistryProperties.kt @@ -16,7 +16,6 @@ import me.ahoo.cosky.discovery.RenewProperties import me.ahoo.cosky.discovery.spring.cloud.discovery.CoSkyDiscoveryProperties import me.ahoo.cosky.discovery.spring.cloud.support.StatusConstants import org.springframework.boot.context.properties.ConfigurationProperties -import org.springframework.boot.context.properties.ConstructorBinding import java.time.Duration /** @@ -24,7 +23,6 @@ import java.time.Duration * * @author ahoo wang */ -@ConstructorBinding @ConfigurationProperties(CoSkyRegistryProperties.PREFIX) data class CoSkyRegistryProperties( var serviceId: String = "", diff --git a/spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyServiceRegistry.kt b/cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyServiceRegistry.kt similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyServiceRegistry.kt rename to cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyServiceRegistry.kt diff --git a/spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/ConditionalOnAutoRegistrationEnabled.kt b/cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/ConditionalOnAutoRegistrationEnabled.kt similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/ConditionalOnAutoRegistrationEnabled.kt rename to cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/ConditionalOnAutoRegistrationEnabled.kt diff --git a/spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/support/StatusConstants.kt b/cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/support/StatusConstants.kt similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/support/StatusConstants.kt rename to cosky-spring-cloud-starter-discovery/src/main/kotlin/me/ahoo/cosky/discovery/spring/cloud/support/StatusConstants.kt diff --git a/spring-cloud-starter-cosky-discovery/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/cosky-spring-cloud-starter-discovery/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename to cosky-spring-cloud-starter-discovery/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports diff --git a/spring-cloud-starter-cosky-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryAutoConfigurationTest.kt b/cosky-spring-cloud-starter-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryAutoConfigurationTest.kt similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryAutoConfigurationTest.kt rename to cosky-spring-cloud-starter-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryAutoConfigurationTest.kt diff --git a/spring-cloud-starter-cosky-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClientConfigurationTest.kt b/cosky-spring-cloud-starter-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClientConfigurationTest.kt similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClientConfigurationTest.kt rename to cosky-spring-cloud-starter-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClientConfigurationTest.kt diff --git a/spring-cloud-starter-cosky-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClientTest.kt b/cosky-spring-cloud-starter-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClientTest.kt similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClientTest.kt rename to cosky-spring-cloud-starter-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyDiscoveryClientTest.kt diff --git a/spring-cloud-starter-cosky-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyReactiveDiscoveryClientConfigurationTest.kt b/cosky-spring-cloud-starter-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyReactiveDiscoveryClientConfigurationTest.kt similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyReactiveDiscoveryClientConfigurationTest.kt rename to cosky-spring-cloud-starter-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/discovery/CoSkyReactiveDiscoveryClientConfigurationTest.kt diff --git a/spring-cloud-starter-cosky-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistrationAutoConfigurationTest.kt b/cosky-spring-cloud-starter-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistrationAutoConfigurationTest.kt similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistrationAutoConfigurationTest.kt rename to cosky-spring-cloud-starter-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyAutoServiceRegistrationAutoConfigurationTest.kt diff --git a/spring-cloud-starter-cosky-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyServiceRegistryTest.kt b/cosky-spring-cloud-starter-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyServiceRegistryTest.kt similarity index 100% rename from spring-cloud-starter-cosky-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyServiceRegistryTest.kt rename to cosky-spring-cloud-starter-discovery/src/test/kotlin/me/ahoo/cosky/discovery/spring/cloud/registry/CoSkyServiceRegistryTest.kt diff --git a/examples/cosky-service-consumer/build.gradle.kts b/examples/cosky-service-consumer/build.gradle.kts index ddf6d409..4b50c9c0 100644 --- a/examples/cosky-service-consumer/build.gradle.kts +++ b/examples/cosky-service-consumer/build.gradle.kts @@ -20,7 +20,7 @@ plugins { java { toolchain { - languageVersion.set(JavaLanguageVersion.of(8)) + languageVersion.set(JavaLanguageVersion.of(17)) } } @@ -30,8 +30,8 @@ dependencies { implementation(platform(project(":cosky-dependencies"))) // implementation("io.springfox:springfox-boot-starter") implementation("org.springframework.boot:spring-boot-starter-actuator") - implementation(project(":spring-cloud-starter-cosky-config")) - implementation(project(":spring-cloud-starter-cosky-discovery")) + implementation(project(":cosky-spring-cloud-starter-config")) + implementation(project(":cosky-spring-cloud-starter-discovery")) implementation("com.google.guava:guava") implementation("org.springframework.cloud:spring-cloud-starter-loadbalancer") implementation("org.springframework.cloud:spring-cloud-starter-openfeign") diff --git a/examples/cosky-service-provider-api/build.gradle.kts b/examples/cosky-service-provider-api/build.gradle.kts index 8fa6e9b1..b87860e7 100644 --- a/examples/cosky-service-provider-api/build.gradle.kts +++ b/examples/cosky-service-provider-api/build.gradle.kts @@ -19,7 +19,7 @@ plugins { java { toolchain { - languageVersion.set(JavaLanguageVersion.of(8)) + languageVersion.set(JavaLanguageVersion.of(17)) } } diff --git a/examples/cosky-service-provider/build.gradle.kts b/examples/cosky-service-provider/build.gradle.kts index a4071e14..d95188e0 100644 --- a/examples/cosky-service-provider/build.gradle.kts +++ b/examples/cosky-service-provider/build.gradle.kts @@ -20,7 +20,7 @@ plugins { java { toolchain { - languageVersion.set(JavaLanguageVersion.of(8)) + languageVersion.set(JavaLanguageVersion.of(17)) } } @@ -30,8 +30,8 @@ dependencies { implementation(platform(project(":cosky-dependencies"))) // implementation("io.springfox:springfox-boot-starter") implementation("org.springframework.boot:spring-boot-starter-actuator") - implementation(project(":spring-cloud-starter-cosky-config")) - implementation(project(":spring-cloud-starter-cosky-discovery")) + implementation(project(":cosky-spring-cloud-starter-config")) + implementation(project(":cosky-spring-cloud-starter-discovery")) implementation("com.google.guava:guava") implementation("org.springframework.boot:spring-boot-starter-web") implementation("org.springframework.cloud:spring-cloud-starter-openfeign") diff --git a/gradle.properties b/gradle.properties index f3ae37fe..08a96d6b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,11 +11,12 @@ # limitations under the License. # group=me.ahoo.cosky -version=3.3.15 +version=4.0.0-M1 description=High-performance, low-cost microservice governance platform. Service Discovery and Configuration Service. website=https://github.com/Ahoo-Wang/cosky issues=https://github.com/Ahoo-Wang/cosky/issues vcs=https://github.com/Ahoo-Wang/cosky.git + license_name=The Apache Software License, Version 2.0 license_url=https://www.apache.org/licenses/LICENSE-2.0.txt diff --git a/settings.gradle.kts b/settings.gradle.kts index 2ac486eb..1687e07e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -19,8 +19,8 @@ include(":cosky-discovery") include(":cosky-bom") include(":cosky-dependencies") include(":cosky-spring-cloud-core") -include(":spring-cloud-starter-cosky-config") -include(":spring-cloud-starter-cosky-discovery") +include(":cosky-spring-cloud-starter-config") +include(":cosky-spring-cloud-starter-discovery") include(":cosky-rest-api") // TODO // include(":cosky-mirror")