You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2021/09/19 05:07:41 UTC

[shardingsphere] branch master updated: Support to build with JDK 11 (#12579)

This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 713e6d8  Support to build with JDK 11 (#12579)
713e6d8 is described below

commit 713e6d89a9d048bf5477a4cbf43c04cfe846e963
Author: Amos Feng <zh...@gmail.com>
AuthorDate: Sun Sep 19 13:06:59 2021 +0800

    Support to build with JDK 11 (#12579)
    
    * Support to build with JDK 11
    
    * fix indent
---
 pom.xml                                            | 26 +++++++++++++++++++++-
 .../yaml/schema/swapper/SchemaYamlSwapper.java     |  3 ++-
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index b2acc0c..73731baf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -107,6 +107,9 @@
         <calcite.version>1.27.0</calcite.version>
         <embedded-mysql.version>4.6.1</embedded-mysql.version>
         <embedded-postgresql.version>2.10</embedded-postgresql.version>
+
+        <jaxb.version>2.3.0</jaxb.version>
+        <annotation-api.version>1.3.2</annotation-api.version>
         
         <!-- Plugin versions -->
         <apache-rat-plugin.version>0.12</apache-rat-plugin.version>
@@ -886,7 +889,28 @@
             </plugin>
         </plugins>
     </build>
-    
+
+    <profiles>
+        <profile>
+            <id>jdk11+</id>
+            <activation>
+                <jdk>[11,)</jdk>
+            </activation>
+            <dependencies>
+                <dependency>
+                    <groupId>javax.xml.bind</groupId>
+                    <artifactId>jaxb-api</artifactId>
+                    <version>${jaxb.version}</version>
+                </dependency>
+                <dependency>
+                    <groupId>javax.annotation</groupId>
+                    <artifactId>javax.annotation-api</artifactId>
+                    <version>${annotation-api.version}</version>
+                </dependency>
+            </dependencies>
+        </profile>
+    </profiles>
+
     <reporting>
         <plugins>
             <plugin>
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/schema/swapper/SchemaYamlSwapper.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/schema/swapper/SchemaYamlSwapper.java
index 8e1353f..b77bc28 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/schema/swapper/SchemaYamlSwapper.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/schema/swapper/SchemaYamlSwapper.java
@@ -45,7 +45,8 @@ public final class SchemaYamlSwapper implements YamlConfigurationSwapper<YamlSch
     @Override
     public YamlSchema swapToYamlConfiguration(final ShardingSphereSchema schema) {
         Map<String, YamlTableMetaData> tables = schema.getAllTableNames().stream()
-                .collect(Collectors.<String, String, YamlTableMetaData, Map>toMap(each -> each, each -> swapYamlTable(schema.get(each)), (oldValue, currentValue) -> oldValue, LinkedHashMap::new));
+                .collect(Collectors.<String, String, YamlTableMetaData, Map<String, YamlTableMetaData>>toMap(
+                    each -> each, each -> swapYamlTable(schema.get(each)), (oldValue, currentValue) -> oldValue, LinkedHashMap::new));
         YamlSchema result = new YamlSchema();
         result.setTables(tables);
         return result;