From 3fe99b73966284e0201218ad5650dae266d22fa4 Mon Sep 17 00:00:00 2001 From: benjobs Date: Fri, 4 Aug 2023 15:03:39 +0800 Subject: [PATCH] dependency minor improvement --- pom.xml | 32 +++++ streampark-common/pom.xml | 9 +- .../apache/streampark/common/zio/ZIOExt.scala | 2 +- .../{LoggerBackend.scala => ZIOLogger.scala} | 5 +- .../streampark-console-service/pom.xml | 113 +++++++++--------- .../streampark-flink-client-api/pom.xml | 1 - .../streampark-flink-connector-base/pom.xml | 1 - .../streampark-flink-core/pom.xml | 1 - .../pom.xml | 20 +++- .../streampark-flink-kubernetes/pom.xml | 1 - .../streampark-flink-packer/pom.xml | 1 - .../streampark-flink-proxy/pom.xml | 1 - .../streampark-flink-shims-base/pom.xml | 1 - streampark-flink/streampark-flink-udf/pom.xml | 1 - 14 files changed, 114 insertions(+), 75 deletions(-) rename streampark-common/src/main/scala/org/apache/streampark/common/zio/{LoggerBackend.scala => ZIOLogger.scala} (96%) diff --git a/pom.xml b/pom.xml index 953d4569a6..2706cabc13 100644 --- a/pom.xml +++ b/pom.xml @@ -217,6 +217,12 @@ + + org.apache.streampark + streampark-common_${scala.binary.version} + ${project.version} + + com.github.ben-manes.caffeine caffeine @@ -436,6 +442,32 @@ test + + + dev.zio + zio-logging_${scala.binary.version} + ${zio-logging.version} + + + + dev.zio + zio-streams_${scala.binary.version} + ${zio.version} + + + + dev.zio + zio-concurrent_${scala.binary.version} + ${zio.version} + + + + + com.lihaoyi + pprint_${scala.binary.version} + ${pprint.version} + + diff --git a/streampark-common/pom.xml b/streampark-common/pom.xml index b936b82ca7..64694d9424 100644 --- a/streampark-common/pom.xml +++ b/streampark-common/pom.xml @@ -132,26 +132,26 @@ dev.zio zio-logging_${scala.binary.version} - ${zio-logging.version} + true dev.zio zio-streams_${scala.binary.version} - ${zio.version} + true dev.zio zio-concurrent_${scala.binary.version} - ${zio.version} + true com.lihaoyi pprint_${scala.binary.version} - ${pprint.version} + true @@ -184,6 +184,7 @@ com.beachape:* + com.lihaoyi:* io.netty:netty-resolver diff --git a/streampark-common/src/main/scala/org/apache/streampark/common/zio/ZIOExt.scala b/streampark-common/src/main/scala/org/apache/streampark/common/zio/ZIOExt.scala index 0a6ad0646d..6fb546c65e 100644 --- a/streampark-common/src/main/scala/org/apache/streampark/common/zio/ZIOExt.scala +++ b/streampark-common/src/main/scala/org/apache/streampark/common/zio/ZIOExt.scala @@ -28,7 +28,7 @@ object ZIOExt { @inline def unsafeRun[E, A](zio: IO[E, A]): A = Unsafe.unsafe { implicit u => Runtime.default.unsafe - .run(zio.provideLayer(Runtime.removeDefaultLoggers >>> LoggerBackend.default)) + .run(zio.provideLayer(Runtime.removeDefaultLoggers >>> ZIOLogger.default)) .getOrThrowFiberFailure() } diff --git a/streampark-common/src/main/scala/org/apache/streampark/common/zio/LoggerBackend.scala b/streampark-common/src/main/scala/org/apache/streampark/common/zio/ZIOLogger.scala similarity index 96% rename from streampark-common/src/main/scala/org/apache/streampark/common/zio/LoggerBackend.scala rename to streampark-common/src/main/scala/org/apache/streampark/common/zio/ZIOLogger.scala index 4ad4979cf2..29a6232f64 100644 --- a/streampark-common/src/main/scala/org/apache/streampark/common/zio/LoggerBackend.scala +++ b/streampark-common/src/main/scala/org/apache/streampark/common/zio/ZIOLogger.scala @@ -25,7 +25,7 @@ import zio.logging.LoggerNameExtractor import scala.collection.concurrent.TrieMap /** ZIO logging Backend that bridging to [[org.apache.streampark.common.util.Logger]] */ -object LoggerBackend { +object ZIOLogger { lazy val default: ZLayer[Any, Nothing, Unit] = Runtime.addLogger(provideLogger()) @@ -46,7 +46,7 @@ object LoggerBackend { def debug(msg: String): Unit = super.logDebug(msg) } - private def provideLogger(): ZLogger[String, Unit] = ( + private[this] def provideLogger(): ZLogger[String, Unit] = ( trace: Trace, fiberId: FiberId, logLevel: LogLevel, @@ -73,6 +73,7 @@ object LoggerBackend { case LogLevel.Warning => logger.warn(msg) case LogLevel.Error => logger.error(msg) case LogLevel.Fatal => logger.error(msg) + case _ => logger.error(msg) } } diff --git a/streampark-console/streampark-console-service/pom.xml b/streampark-console/streampark-console-service/pom.xml index 3b1b242a3b..9d1099271e 100644 --- a/streampark-console/streampark-console-service/pom.xml +++ b/streampark-console/streampark-console-service/pom.xml @@ -127,17 +127,6 @@ - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-logging - - - - org.springframework.boot spring-boot-starter-web @@ -160,24 +149,45 @@ org.springframework.boot - spring-boot-starter-actuator + spring-boot-starter-websocket + + + + org.springframework.ldap + spring-ldap-core org.springframework.boot - spring-boot-starter-websocket + spring-boot-starter-aop org.springframework.boot - spring-boot-starter-validation + spring-boot-starter-quartz + + + com.mchange + mchange-commons-java + + - org.springframework.ldap - spring-ldap-core + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.jupiter + junit-jupiter + + + + + org.apache.shiro @@ -192,62 +202,43 @@ - - io.buji - buji-pac4j - ${bujiVersion} - org.pac4j pac4j-core ${pac4jVersion} - - org.pac4j - pac4j-springboot - ${pac4jVersion} - - - commons-collections - commons-collections - - - + org.pac4j pac4j-oauth ${pac4jVersion} + org.pac4j pac4j-oidc ${pac4jVersion} - - org.springframework.boot - spring-boot-starter-cache - - - - - org.springframework.boot - spring-boot-starter-aop + io.buji + buji-pac4j + ${bujiVersion} - - org.springframework.boot - spring-boot-starter-quartz + org.pac4j + pac4j-springboot + ${pac4jVersion} - com.mchange - mchange-commons-java + commons-collections + commons-collections + com.baomidou @@ -282,6 +273,7 @@ ${postgresql.version} true + org.freemarker freemarker @@ -344,7 +336,6 @@ org.apache.streampark streampark-common_${scala.binary.version} - ${project.version} @@ -414,18 +405,6 @@ - - org.springframework.boot - spring-boot-starter-test - test - - - org.junit.jupiter - junit-jupiter - - - - org.assertj assertj-core @@ -456,6 +435,22 @@ force-shading provided + + + dev.zio + zio-logging_${scala.binary.version} + + + + dev.zio + zio-streams_${scala.binary.version} + + + + dev.zio + zio-concurrent_${scala.binary.version} + + diff --git a/streampark-flink/streampark-flink-client/streampark-flink-client-api/pom.xml b/streampark-flink/streampark-flink-client/streampark-flink-client-api/pom.xml index 175d39bcfb..b7a9e18583 100644 --- a/streampark-flink/streampark-flink-client/streampark-flink-client-api/pom.xml +++ b/streampark-flink/streampark-flink-client/streampark-flink-client-api/pom.xml @@ -31,7 +31,6 @@ org.apache.streampark streampark-common_${scala.binary.version} - ${project.version} diff --git a/streampark-flink/streampark-flink-connector/streampark-flink-connector-base/pom.xml b/streampark-flink/streampark-flink-connector/streampark-flink-connector-base/pom.xml index 9cc53cdaa5..de2f50aa70 100644 --- a/streampark-flink/streampark-flink-connector/streampark-flink-connector-base/pom.xml +++ b/streampark-flink/streampark-flink-connector/streampark-flink-connector-base/pom.xml @@ -39,7 +39,6 @@ org.apache.streampark streampark-common_${scala.binary.version} - ${project.version} diff --git a/streampark-flink/streampark-flink-core/pom.xml b/streampark-flink/streampark-flink-core/pom.xml index 969ffac2f2..f06782d6a4 100644 --- a/streampark-flink/streampark-flink-core/pom.xml +++ b/streampark-flink/streampark-flink-core/pom.xml @@ -31,7 +31,6 @@ org.apache.streampark streampark-common_${scala.binary.version} - ${project.version} diff --git a/streampark-flink/streampark-flink-kubernetes-v2/streampark-flink-kubernetes-engine/pom.xml b/streampark-flink/streampark-flink-kubernetes-v2/streampark-flink-kubernetes-engine/pom.xml index e582bdaad0..3c830f6879 100644 --- a/streampark-flink/streampark-flink-kubernetes-v2/streampark-flink-kubernetes-engine/pom.xml +++ b/streampark-flink/streampark-flink-kubernetes-v2/streampark-flink-kubernetes-engine/pom.xml @@ -42,7 +42,24 @@ org.apache.streampark streampark-common_${scala.binary.version} - ${project.version} + provided + + + + dev.zio + zio-logging_${scala.binary.version} + provided + + + + dev.zio + zio-streams_${scala.binary.version} + provided + + + + dev.zio + zio-concurrent_${scala.binary.version} provided @@ -58,6 +75,7 @@ kubernetes-client ${fabric8.version} + io.fabric8 generator-annotations diff --git a/streampark-flink/streampark-flink-kubernetes/pom.xml b/streampark-flink/streampark-flink-kubernetes/pom.xml index 0ee290313a..b69aae145a 100644 --- a/streampark-flink/streampark-flink-kubernetes/pom.xml +++ b/streampark-flink/streampark-flink-kubernetes/pom.xml @@ -90,7 +90,6 @@ org.apache.streampark streampark-common_${scala.binary.version} - ${project.version} provided diff --git a/streampark-flink/streampark-flink-packer/pom.xml b/streampark-flink/streampark-flink-packer/pom.xml index 61b78f30ce..f1f6ceacd7 100644 --- a/streampark-flink/streampark-flink-packer/pom.xml +++ b/streampark-flink/streampark-flink-packer/pom.xml @@ -39,7 +39,6 @@ org.apache.streampark streampark-common_${scala.binary.version} - ${project.version} diff --git a/streampark-flink/streampark-flink-proxy/pom.xml b/streampark-flink/streampark-flink-proxy/pom.xml index fae3d94e72..0021038e6d 100644 --- a/streampark-flink/streampark-flink-proxy/pom.xml +++ b/streampark-flink/streampark-flink-proxy/pom.xml @@ -31,7 +31,6 @@ org.apache.streampark streampark-common_${scala.binary.version} - ${project.version} provided diff --git a/streampark-flink/streampark-flink-shims/streampark-flink-shims-base/pom.xml b/streampark-flink/streampark-flink-shims/streampark-flink-shims-base/pom.xml index 0358d858b0..a5cb8a88f7 100644 --- a/streampark-flink/streampark-flink-shims/streampark-flink-shims-base/pom.xml +++ b/streampark-flink/streampark-flink-shims/streampark-flink-shims-base/pom.xml @@ -33,7 +33,6 @@ org.apache.streampark streampark-common_${scala.binary.version} - ${project.version} diff --git a/streampark-flink/streampark-flink-udf/pom.xml b/streampark-flink/streampark-flink-udf/pom.xml index 5cad3de17f..af6b58c099 100644 --- a/streampark-flink/streampark-flink-udf/pom.xml +++ b/streampark-flink/streampark-flink-udf/pom.xml @@ -30,7 +30,6 @@ org.apache.streampark streampark-common_${scala.binary.version} - ${project.version} commons-cli