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

duanzhengqiang 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 f2ab4768fc3 Support spring namespace for sql-translator (#20129)
f2ab4768fc3 is described below

commit f2ab4768fc3dba9159292be0fa67f146470dd032
Author: zhaojinchao <[email protected]>
AuthorDate: Sat Aug 13 08:14:01 2022 +0800

    Support spring namespace for sql-translator (#20129)
---
 .../shardingsphere-sql-translator-spring/pom.xml   |  1 +
 .../pom.xml                                        | 34 +++++++++++++----
 .../handler/SQLTranslatorNamespaceHandler.java     | 33 ++++++++++++++++
 .../SQLTranslatorRuleBeanDefinitionParser.java     | 40 ++++++++++++++++++++
 .../tag/SQLTranslatorRuleBeanDefinitionTag.java    | 34 +++++++++++++++++
 .../META-INF/namespace/sql-translator.xsd}         | 29 +++++++-------
 .../src/main/resources/META-INF/spring.handlers    | 18 +++++++++
 .../src/main/resources/META-INF/spring.schemas     | 18 +++++++++
 .../SQLTranslatorSpringNamespaceTest.java          | 44 ++++++++++++++++++++++
 .../spring/sql-translator-application-context.xml} | 27 +++++--------
 .../src/test/resources/logback-test.xml}           | 32 ++++++++--------
 11 files changed, 253 insertions(+), 57 deletions(-)

diff --git 
a/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/pom.xml
 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/pom.xml
index 57ea48fe1c1..8d7790816a0 100644
--- 
a/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/pom.xml
+++ 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/pom.xml
@@ -30,6 +30,7 @@
     
     <modules>
         <module>shardingsphere-sql-translator-spring-boot-starter</module>
+        <module>shardingsphere-sql-translator-spring-namespace</module>
     </modules>
     
 </project>
diff --git 
a/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/pom.xml
 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/pom.xml
similarity index 54%
copy from 
shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/pom.xml
copy to 
shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/pom.xml
index 57ea48fe1c1..a125cbfe464 100644
--- 
a/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/pom.xml
+++ 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/pom.xml
@@ -21,15 +21,35 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.shardingsphere</groupId>
-        <artifactId>shardingsphere-sql-translator</artifactId>
+        <artifactId>shardingsphere-sql-translator-spring</artifactId>
         <version>5.1.3-SNAPSHOT</version>
     </parent>
-    <artifactId>shardingsphere-sql-translator-spring</artifactId>
-    <packaging>pom</packaging>
+    <artifactId>shardingsphere-sql-translator-spring-namespace</artifactId>
     <name>${project.artifactId}</name>
     
-    <modules>
-        <module>shardingsphere-sql-translator-spring-boot-starter</module>
-    </modules>
-    
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.shardingsphere</groupId>
+            <artifactId>shardingsphere-sql-translator-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.shardingsphere</groupId>
+            <artifactId>shardingsphere-jdbc-spring-namespace-infra</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context-support</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.annotation</groupId>
+            <artifactId>javax.annotation-api</artifactId>
+        </dependency>
+    </dependencies>
 </project>
diff --git 
a/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/main/java/org/apache/shardingsphere/sqltranslator/spring/namespace/handler/SQLTranslatorNamespaceHandler.java
 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/main/java/org/apache/shardingsphere/sqltranslator/spring/namespace/handler/SQLTranslator
 [...]
new file mode 100644
index 00000000000..52f380680d0
--- /dev/null
+++ 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/main/java/org/apache/shardingsphere/sqltranslator/spring/namespace/handler/SQLTranslatorNamespaceHandler.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sqltranslator.spring.namespace.handler;
+
+import 
org.apache.shardingsphere.sqltranslator.spring.namespace.parser.SQLTranslatorRuleBeanDefinitionParser;
+import 
org.apache.shardingsphere.sqltranslator.spring.namespace.tag.SQLTranslatorRuleBeanDefinitionTag;
+import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
+
+/**
+ * SQL translator rule namespace handler.
+ */
+public final class SQLTranslatorNamespaceHandler extends 
NamespaceHandlerSupport {
+    
+    @Override
+    public void init() {
+        
registerBeanDefinitionParser(SQLTranslatorRuleBeanDefinitionTag.ROOT_TAG, new 
SQLTranslatorRuleBeanDefinitionParser());
+    }
+}
diff --git 
a/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/main/java/org/apache/shardingsphere/sqltranslator/spring/namespace/parser/SQLTranslatorRuleBeanDefinitionParser.java
 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/main/java/org/apache/shardingsphere/sqltranslator/spring/namespace/parser/SQLTran
 [...]
new file mode 100644
index 00000000000..3ee701dbb25
--- /dev/null
+++ 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/main/java/org/apache/shardingsphere/sqltranslator/spring/namespace/parser/SQLTranslatorRuleBeanDefinitionParser.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sqltranslator.spring.namespace.parser;
+
+import 
org.apache.shardingsphere.sqltranslator.api.config.SQLTranslatorRuleConfiguration;
+import 
org.apache.shardingsphere.sqltranslator.spring.namespace.tag.SQLTranslatorRuleBeanDefinitionTag;
+import org.springframework.beans.factory.support.AbstractBeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.w3c.dom.Element;
+
+/**
+ * SQL translator bean parser for spring namespace.
+ */
+public final class SQLTranslatorRuleBeanDefinitionParser extends 
AbstractBeanDefinitionParser {
+    
+    @Override
+    protected AbstractBeanDefinition parseInternal(final Element element, 
final ParserContext parserContext) {
+        BeanDefinitionBuilder factory = 
BeanDefinitionBuilder.rootBeanDefinition(SQLTranslatorRuleConfiguration.class);
+        
factory.addConstructorArgValue(element.getAttribute(SQLTranslatorRuleBeanDefinitionTag.SQL_TRANSLATOR_TYPE));
+        
factory.addConstructorArgValue(Boolean.parseBoolean(element.getAttribute(SQLTranslatorRuleBeanDefinitionTag.SQL_USE_ORIGINAL_SQL_WHEN_TRANSLATING_FAILED)));
+        return factory.getBeanDefinition();
+    }
+}
diff --git 
a/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/main/java/org/apache/shardingsphere/sqltranslator/spring/namespace/tag/SQLTranslatorRuleBeanDefinitionTag.java
 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/main/java/org/apache/shardingsphere/sqltranslator/spring/namespace/tag/SQLTranslatorRul
 [...]
new file mode 100644
index 00000000000..715deae895b
--- /dev/null
+++ 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/main/java/org/apache/shardingsphere/sqltranslator/spring/namespace/tag/SQLTranslatorRuleBeanDefinitionTag.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sqltranslator.spring.namespace.tag;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+
+/**
+ * SQL translator rule bean definition tag constants.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class SQLTranslatorRuleBeanDefinitionTag {
+    
+    public static final String ROOT_TAG = "rule";
+    
+    public static final String SQL_TRANSLATOR_TYPE = "type";
+    
+    public static final String SQL_USE_ORIGINAL_SQL_WHEN_TRANSLATING_FAILED = 
"use-original-sql-when-translating-failed";
+}
diff --git 
a/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/pom.xml
 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/main/resources/META-INF/namespace/sql-translator.xsd
similarity index 51%
copy from 
shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/pom.xml
copy to 
shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/main/resources/META-INF/namespace/sql-translator.xsd
index 57ea48fe1c1..38373d53924 100644
--- 
a/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/pom.xml
+++ 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/main/resources/META-INF/namespace/sql-translator.xsd
@@ -16,20 +16,17 @@
   ~ limitations under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.shardingsphere</groupId>
-        <artifactId>shardingsphere-sql-translator</artifactId>
-        <version>5.1.3-SNAPSHOT</version>
-    </parent>
-    <artifactId>shardingsphere-sql-translator-spring</artifactId>
-    <packaging>pom</packaging>
-    <name>${project.artifactId}</name>
+<xsd:schema 
xmlns="http://shardingsphere.apache.org/schema/shardingsphere/sql-translator";
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+            
targetNamespace="http://shardingsphere.apache.org/schema/shardingsphere/sql-translator";
+            elementFormDefault="qualified">
+    <xsd:import namespace="http://www.springframework.org/schema/beans"; 
schemaLocation="http://www.springframework.org/schema/beans/spring-beans.xsd"; />
     
-    <modules>
-        <module>shardingsphere-sql-translator-spring-boot-starter</module>
-    </modules>
-    
-</project>
+    <xsd:element name="rule">
+        <xsd:complexType>
+            <xsd:attribute name="id" type="xsd:string" use="required" />
+            <xsd:attribute name="type" type="xsd:string" use="required" />
+            <xsd:attribute name="use-original-sql-when-translating-failed" 
type="xsd:boolean" default="true" />
+        </xsd:complexType>
+    </xsd:element>
+</xsd:schema>
diff --git 
a/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/main/resources/META-INF/spring.handlers
 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/main/resources/META-INF/spring.handlers
new file mode 100644
index 00000000000..7dac47a3e81
--- /dev/null
+++ 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/main/resources/META-INF/spring.handlers
@@ -0,0 +1,18 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+http\://shardingsphere.apache.org/schema/shardingsphere/sql-translator=org.apache.shardingsphere.sqltranslator.spring.namespace.handler.SQLTranslatorNamespaceHandler
diff --git 
a/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/main/resources/META-INF/spring.schemas
 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/main/resources/META-INF/spring.schemas
new file mode 100644
index 00000000000..0d473b2ee82
--- /dev/null
+++ 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/main/resources/META-INF/spring.schemas
@@ -0,0 +1,18 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+http\://shardingsphere.apache.org/schema/shardingsphere/sql-translator/sql-translator.xsd=META-INF/namespace/sql-translator.xsd
diff --git 
a/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/test/java/org/apache/shardingsphere/sqltranslator/spring/namespace/SQLTranslatorSpringNamespaceTest.java
 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/test/java/org/apache/shardingsphere/sqltranslator/spring/namespace/SQLTranslatorSpringNamespa
 [...]
new file mode 100644
index 00000000000..cc48c5cfce0
--- /dev/null
+++ 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/test/java/org/apache/shardingsphere/sqltranslator/spring/namespace/SQLTranslatorSpringNamespaceTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sqltranslator.spring.namespace;
+
+import 
org.apache.shardingsphere.sqltranslator.api.config.SQLTranslatorRuleConfiguration;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.springframework.test.context.ContextConfiguration;
+import 
org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
+
+import javax.annotation.Resource;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertFalse;
+
+@Ignore
+@ContextConfiguration(locations = 
"classpath:META-INF/spring/sql-translator-application-context.xml")
+public final class SQLTranslatorSpringNamespaceTest extends 
AbstractJUnit4SpringContextTests {
+    
+    @Resource
+    private SQLTranslatorRuleConfiguration sqlTranslatorRuleConfiguration;
+    
+    @Test
+    public void assertSQLTranslatorRule() {
+        
assertFalse(sqlTranslatorRuleConfiguration.isUseOriginalSQLWhenTranslatingFailed());
+        assertThat(sqlTranslatorRuleConfiguration.getType(), is("MySQL"));
+    }
+}
diff --git 
a/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/pom.xml
 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/test/resources/META-INF/spring/sql-translator-application-context.xml
similarity index 53%
copy from 
shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/pom.xml
copy to 
shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/test/resources/META-INF/spring/sql-translator-application-context.xml
index 57ea48fe1c1..5734da7580d 100644
--- 
a/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/pom.xml
+++ 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/test/resources/META-INF/spring/sql-translator-application-context.xml
@@ -16,20 +16,13 @@
   ~ limitations under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.shardingsphere</groupId>
-        <artifactId>shardingsphere-sql-translator</artifactId>
-        <version>5.1.3-SNAPSHOT</version>
-    </parent>
-    <artifactId>shardingsphere-sql-translator-spring</artifactId>
-    <packaging>pom</packaging>
-    <name>${project.artifactId}</name>
-    
-    <modules>
-        <module>shardingsphere-sql-translator-spring-boot-starter</module>
-    </modules>
-    
-</project>
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       
xmlns:sql-translator="http://shardingsphere.apache.org/schema/shardingsphere/sql-translator";
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                           
http://www.springframework.org/schema/beans/spring-beans.xsd
+                           
http://shardingsphere.apache.org/schema/shardingsphere/sql-translator
+                           
http://shardingsphere.apache.org/schema/shardingsphere/sql-translator/sql-translator.xsd
+                           ">
+    <sql-translator:rule id="sqlTranslatorRule" type="MySQL" 
use-original-sql-when-translating-failed="false" />
+</beans>
diff --git 
a/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/pom.xml
 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/test/resources/logback-test.xml
similarity index 52%
copy from 
shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/pom.xml
copy to 
shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/test/resources/logback-test.xml
index 57ea48fe1c1..d90fc4a7156 100644
--- 
a/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/pom.xml
+++ 
b/shardingsphere-kernel/shardingsphere-sql-translator/shardingsphere-sql-translator-spring/shardingsphere-sql-translator-spring-namespace/src/test/resources/logback-test.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0"?>
 <!--
   ~ Licensed to the Apache Software Foundation (ASF) under one or more
   ~ contributor license agreements.  See the NOTICE file distributed with
@@ -16,20 +16,18 @@
   ~ limitations under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.shardingsphere</groupId>
-        <artifactId>shardingsphere-sql-translator</artifactId>
-        <version>5.1.3-SNAPSHOT</version>
-    </parent>
-    <artifactId>shardingsphere-sql-translator-spring</artifactId>
-    <packaging>pom</packaging>
-    <name>${project.artifactId}</name>
+<configuration>
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] 
%logger{36} - %msg%n</pattern>
+        </encoder>
+    </appender>
+    <logger name="org.apache.shardingsphere" level="warn" additivity="false">
+        <appender-ref ref="console" />
+    </logger>
     
-    <modules>
-        <module>shardingsphere-sql-translator-spring-boot-starter</module>
-    </modules>
-    
-</project>
+    <root>
+        <level value="error" />
+        <appender-ref ref="console" />
+    </root>
+</configuration> 

Reply via email to