diff --git a/dinky-admin/src/main/java/org/dinky/url/RsURLStreamHandlerFactory.java b/dinky-admin/src/main/java/org/dinky/url/RsURLStreamHandlerFactory.java index 81e3b10d16..c996d6dc97 100644 --- a/dinky-admin/src/main/java/org/dinky/url/RsURLStreamHandlerFactory.java +++ b/dinky-admin/src/main/java/org/dinky/url/RsURLStreamHandlerFactory.java @@ -23,27 +23,30 @@ import java.net.URLStreamHandler; import java.net.URLStreamHandlerFactory; -import java.util.Arrays; -import java.util.List; import org.springframework.context.annotation.Profile; import cn.hutool.core.lang.Singleton; -import cn.hutool.core.util.StrUtil; @Profile("!test") public class RsURLStreamHandlerFactory implements URLStreamHandlerFactory { - private final List notContains = Arrays.asList("jar", "file", "http", "https"); + private static final String PREFIX = "sun.net.www.protocol"; @Override public URLStreamHandler createURLStreamHandler(String protocol) { - if ("rs".equals(protocol)) { + if ("rs".equalsIgnoreCase(protocol)) { return new RsURLStreamHandler(); } - for (String tempProtocol : notContains) { - if (tempProtocol.equals(StrUtil.sub(protocol, 0, tempProtocol.length()))) { - return null; - } + String name = PREFIX + "." + protocol + ".Handler"; + try { + @SuppressWarnings("deprecation") + Object o = Class.forName(name).newInstance(); + return (URLStreamHandler) o; + } catch (ClassNotFoundException x) { + // ignore + } catch (Exception e) { + // For compatibility, all Exceptions are ignored. + // any number of exceptions can get thrown here } try { diff --git a/dinky-app/dinky-app-1.14/pom.xml b/dinky-app/dinky-app-1.14/pom.xml index 7203f9783d..09679c952b 100644 --- a/dinky-app/dinky-app-1.14/pom.xml +++ b/dinky-app/dinky-app-1.14/pom.xml @@ -64,25 +64,56 @@ org.apache.maven.plugins - maven-assembly-plugin - 2.6 + maven-shade-plugin - - jar-with-dependencies - - - - - org.dinky.app.MainApp - - + ${project.build.finalName}-jar-with-dependencies ${project.parent.parent.basedir}/build/extends + true + false + + + org.dinky:* + + org/dinky/** + org/apache/flink/** + org/apache/calcite/** + META-INF/** + + + + *:* + + tpch/** + tpcds/** + support/** + springfox/** + org/slf4j/** + org/springframework/** + javax/** + javassist/** + Class50/** + lombok/** + freemarker/** + META-INF/resources/** + META-INF/spring/** + META-INF/services/javax** + META-INF/services/lombok** + META-INF/services/org.apache.logging** + + + + + + + + org.dinky.app.MainApp + + - make-assembly - single + shade package diff --git a/dinky-app/dinky-app-1.15/pom.xml b/dinky-app/dinky-app-1.15/pom.xml index 948bc7e8b2..f20db97a70 100644 --- a/dinky-app/dinky-app-1.15/pom.xml +++ b/dinky-app/dinky-app-1.15/pom.xml @@ -74,6 +74,8 @@ org.dinky:* org/dinky/** + org/apache/flink/** + org/apache/calcite/** META-INF/** @@ -91,8 +93,11 @@ Class50/** lombok/** freemarker/** - com.sun/** META-INF/resources/** + META-INF/spring/** + META-INF/services/javax** + META-INF/services/lombok** + META-INF/services/org.apache.logging** diff --git a/dinky-app/dinky-app-1.16/pom.xml b/dinky-app/dinky-app-1.16/pom.xml index 6be6856c88..b66832fc87 100644 --- a/dinky-app/dinky-app-1.16/pom.xml +++ b/dinky-app/dinky-app-1.16/pom.xml @@ -58,6 +58,8 @@ org.dinky:* org/dinky/** + org/apache/flink/** + org/apache/calcite/** META-INF/** @@ -75,8 +77,11 @@ Class50/** lombok/** freemarker/** - com.sun/** META-INF/resources/** + META-INF/spring/** + META-INF/services/javax** + META-INF/services/lombok** + META-INF/services/org.apache.logging** diff --git a/dinky-app/dinky-app-1.17/pom.xml b/dinky-app/dinky-app-1.17/pom.xml index 391ef7abb3..ddaf4d3a24 100644 --- a/dinky-app/dinky-app-1.17/pom.xml +++ b/dinky-app/dinky-app-1.17/pom.xml @@ -58,6 +58,8 @@ org.dinky:* org/dinky/** + org/apache/flink/** + org/apache/calcite/** META-INF/** @@ -75,8 +77,11 @@ Class50/** lombok/** freemarker/** - com.sun/** META-INF/resources/** + META-INF/spring/** + META-INF/services/javax** + META-INF/services/lombok** + META-INF/services/org.apache.logging** diff --git a/dinky-app/dinky-app-1.18/pom.xml b/dinky-app/dinky-app-1.18/pom.xml index c24aa73f87..2516336720 100644 --- a/dinky-app/dinky-app-1.18/pom.xml +++ b/dinky-app/dinky-app-1.18/pom.xml @@ -58,6 +58,8 @@ org.dinky:* org/dinky/** + org/apache/flink/** + org/apache/calcite/** META-INF/** @@ -75,8 +77,11 @@ Class50/** lombok/** freemarker/** - com.sun/** META-INF/resources/** + META-INF/spring/** + META-INF/services/javax** + META-INF/services/lombok** + META-INF/services/org.apache.logging** diff --git a/dinky-app/dinky-app-1.19/pom.xml b/dinky-app/dinky-app-1.19/pom.xml index 248fba0f5d..cf75c56bd9 100644 --- a/dinky-app/dinky-app-1.19/pom.xml +++ b/dinky-app/dinky-app-1.19/pom.xml @@ -58,6 +58,8 @@ org.dinky:* org/dinky/** + org/apache/flink/** + org/apache/calcite/** META-INF/** @@ -75,8 +77,11 @@ Class50/** lombok/** freemarker/** - com.sun/** META-INF/resources/** + META-INF/spring/** + META-INF/services/javax** + META-INF/services/lombok** + META-INF/services/org.apache.logging** diff --git a/dinky-app/dinky-app-1.20/pom.xml b/dinky-app/dinky-app-1.20/pom.xml index 0de8c5ad21..a9dd099378 100644 --- a/dinky-app/dinky-app-1.20/pom.xml +++ b/dinky-app/dinky-app-1.20/pom.xml @@ -58,6 +58,8 @@ org.dinky:* org/dinky/** + org/apache/flink/** + org/apache/calcite/** META-INF/** @@ -75,8 +77,11 @@ Class50/** lombok/** freemarker/** - com.sun/** META-INF/resources/** + META-INF/spring/** + META-INF/services/javax** + META-INF/services/lombok** + META-INF/services/org.apache.logging** diff --git a/dinky-app/dinky-app-base/src/main/java/org/dinky/app/flinksql/Submitter.java b/dinky-app/dinky-app-base/src/main/java/org/dinky/app/flinksql/Submitter.java index 79c22d7c78..b37ba9afc7 100644 --- a/dinky-app/dinky-app-base/src/main/java/org/dinky/app/flinksql/Submitter.java +++ b/dinky-app/dinky-app-base/src/main/java/org/dinky/app/flinksql/Submitter.java @@ -259,7 +259,7 @@ public static Optional executeJarJob(String type, Executor executor, ReadableConfig configuration = executor.getStreamExecutionEnvironment().getConfiguration(); List jars = configuration.get(PipelineOptions.JARS); - List jarsUrl = jars.stream().map(URLUtil::getURL).collect(Collectors.toList()); + List jarsUrl = jars.stream().map(URLUtil::url).collect(Collectors.toList()); Pipeline pipeline = executeJarOperation.getStreamGraph(executor.getCustomTableEnvironment(), jarsUrl); if (pipeline instanceof StreamGraph) { // stream job diff --git a/dinky-client/dinky-client-base/src/main/java/org/dinky/url/RsURLStreamHandlerFactory.java b/dinky-client/dinky-client-base/src/main/java/org/dinky/url/RsURLStreamHandlerFactory.java index 7a7dc3c6c2..9bb607f544 100644 --- a/dinky-client/dinky-client-base/src/main/java/org/dinky/url/RsURLStreamHandlerFactory.java +++ b/dinky-client/dinky-client-base/src/main/java/org/dinky/url/RsURLStreamHandlerFactory.java @@ -21,22 +21,24 @@ import java.net.URLStreamHandler; import java.net.URLStreamHandlerFactory; -import java.util.Arrays; -import java.util.List; - -import cn.hutool.core.util.StrUtil; public class RsURLStreamHandlerFactory implements URLStreamHandlerFactory { private static final String PREFIX = "sun.net.www.protocol"; - private final List notContains = Arrays.asList("jar", "file", "http", "https"); @Override public URLStreamHandler createURLStreamHandler(String protocol) { - for (String tempProtocol : notContains) { - if (tempProtocol.equals(StrUtil.sub(protocol, 0, tempProtocol.length()))) { - return null; - } + String name = PREFIX + "." + protocol + ".Handler"; + try { + @SuppressWarnings("deprecation") + Object o = Class.forName(name).newInstance(); + return (URLStreamHandler) o; + } catch (ClassNotFoundException x) { + // ignore + } catch (Exception e) { + // For compatibility, all Exceptions are ignored. + // any number of exceptions can get thrown here } + if (ResourceFileSystem.URI_SCHEMA.getScheme().equals(protocol)) { return new RsURLStreamHandler(); } @@ -45,7 +47,6 @@ public URLStreamHandler createURLStreamHandler(String protocol) { } catch (Throwable e) { return null; } - String name = PREFIX + "." + protocol + ".Handler"; try { @SuppressWarnings("deprecation") Object o = Class.forName(name).newInstance(); diff --git a/dinky-metadata/dinky-metadata-paimon/pom.xml b/dinky-metadata/dinky-metadata-paimon/pom.xml index afa612b728..25596c82cf 100644 --- a/dinky-metadata/dinky-metadata-paimon/pom.xml +++ b/dinky-metadata/dinky-metadata-paimon/pom.xml @@ -39,7 +39,7 @@ org.apache.paimon paimon-bundle - 0.8.1 + 0.9.0 ${scope.runtime}