Merge pull request #82 from KomachiSion/dev

Use sharding-transaction-spring-boot-starter
diff --git a/pom.xml b/pom.xml
index dbc2ef5..33095f6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -99,6 +99,11 @@
             </dependency>
             <dependency>
                 <groupId>io.shardingsphere</groupId>
+                <artifactId>sharding-transaction-spring-boot-starter</artifactId>
+                <version>${project.parent.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>io.shardingsphere</groupId>
                 <artifactId>sharding-orchestration-reg-zookeeper-curator</artifactId>
                 <version>${sharding-sphere.version}</version>
             </dependency>
diff --git a/sharding-jdbc-example/spring-boot-nodep-example/pom.xml b/sharding-jdbc-example/spring-boot-nodep-example/pom.xml
index 44f1ea8..648d23e 100644
--- a/sharding-jdbc-example/spring-boot-nodep-example/pom.xml
+++ b/sharding-jdbc-example/spring-boot-nodep-example/pom.xml
@@ -26,8 +26,8 @@
             <artifactId>sharding-transaction-2pc-xa</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-aop</artifactId>
+            <groupId>io.shardingsphere</groupId>
+            <artifactId>sharding-transaction-spring-boot-starter</artifactId>
         </dependency>
     </dependencies>
 </project>
diff --git a/sharding-jdbc-example/spring-boot-nodep-example/spring-boot-nodep-jpa-example/src/main/java/io/shardingsphere/example/spring/boot/jpa/nodep/SpringBootStarterTransactionExample.java b/sharding-jdbc-example/spring-boot-nodep-example/spring-boot-nodep-jpa-example/src/main/java/io/shardingsphere/example/spring/boot/jpa/nodep/SpringBootStarterTransactionExample.java
index d467717..5ad1011 100644
--- a/sharding-jdbc-example/spring-boot-nodep-example/spring-boot-nodep-jpa-example/src/main/java/io/shardingsphere/example/spring/boot/jpa/nodep/SpringBootStarterTransactionExample.java
+++ b/sharding-jdbc-example/spring-boot-nodep-example/spring-boot-nodep-jpa-example/src/main/java/io/shardingsphere/example/spring/boot/jpa/nodep/SpringBootStarterTransactionExample.java
@@ -23,17 +23,12 @@
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.domain.EntityScan;
-import org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration;
 import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.ComponentScans;
 
-@ComponentScans({
-    @ComponentScan("io.shardingsphere.example.repository.jpa"),
-    @ComponentScan("io.shardingsphere.transaction.aspect")
-})
+@ComponentScan("io.shardingsphere.example.repository.jpa")
 @EntityScan(basePackages = "io.shardingsphere.example.repository.jpa.entity")
-@SpringBootApplication(exclude = JtaAutoConfiguration.class)
+@SpringBootApplication
 public class SpringBootStarterTransactionExample {
     
     public static void main(final String[] args) {
diff --git a/sharding-jdbc-example/spring-boot-nodep-example/spring-boot-nodep-mybatis-example/src/main/java/io/shardingsphere/example/spring/boot/mybatis/nodep/SpringBootStarterTransactionExample.java b/sharding-jdbc-example/spring-boot-nodep-example/spring-boot-nodep-mybatis-example/src/main/java/io/shardingsphere/example/spring/boot/mybatis/nodep/SpringBootStarterTransactionExample.java
index ff16158..fb9ae0a 100644
--- a/sharding-jdbc-example/spring-boot-nodep-example/spring-boot-nodep-mybatis-example/src/main/java/io/shardingsphere/example/spring/boot/mybatis/nodep/SpringBootStarterTransactionExample.java
+++ b/sharding-jdbc-example/spring-boot-nodep-example/spring-boot-nodep-mybatis-example/src/main/java/io/shardingsphere/example/spring/boot/mybatis/nodep/SpringBootStarterTransactionExample.java
@@ -23,17 +23,12 @@
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration;
 import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.ComponentScans;
 
-@ComponentScans({
-    @ComponentScan("io.shardingsphere.example.repository.mybatis"),
-    @ComponentScan("io.shardingsphere.transaction.aspect")
-})
+@ComponentScan("io.shardingsphere.example.repository.mybatis")
 @MapperScan(basePackages = "io.shardingsphere.example.repository.mybatis.repository")
-@SpringBootApplication(exclude = JtaAutoConfiguration.class)
+@SpringBootApplication
 public class SpringBootStarterTransactionExample {
     
     public static void main(final String[] args) {
diff --git a/sharding-jdbc-example/spring-boot-orche-example/pom.xml b/sharding-jdbc-example/spring-boot-orche-example/pom.xml
index f81a4c5..5cc8b7e 100644
--- a/sharding-jdbc-example/spring-boot-orche-example/pom.xml
+++ b/sharding-jdbc-example/spring-boot-orche-example/pom.xml
@@ -34,8 +34,8 @@
             <artifactId>sharding-transaction-2pc-xa</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-aop</artifactId>
+            <groupId>io.shardingsphere</groupId>
+            <artifactId>sharding-transaction-spring-boot-starter</artifactId>
         </dependency>
     </dependencies>
 </project>
diff --git a/sharding-jdbc-example/spring-boot-orche-example/spring-boot-orche-jpa-example/src/main/java/io/shardingsphere/example/spring/boot/jpa/orche/SpringBootStarterTransactionExample.java b/sharding-jdbc-example/spring-boot-orche-example/spring-boot-orche-jpa-example/src/main/java/io/shardingsphere/example/spring/boot/jpa/orche/SpringBootStarterTransactionExample.java
index f40e591..aa81ab0 100644
--- a/sharding-jdbc-example/spring-boot-orche-example/spring-boot-orche-jpa-example/src/main/java/io/shardingsphere/example/spring/boot/jpa/orche/SpringBootStarterTransactionExample.java
+++ b/sharding-jdbc-example/spring-boot-orche-example/spring-boot-orche-jpa-example/src/main/java/io/shardingsphere/example/spring/boot/jpa/orche/SpringBootStarterTransactionExample.java
@@ -23,21 +23,16 @@
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.domain.EntityScan;
-import org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration;
 import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.ComponentScans;
 
 /*
  * 1. Please make sure sharding-orchestration-reg-zookeeper-curator in your pom if registryCenterType = RegistryCenterType.ZOOKEEPER.
  * 2. Please make sure sharding-orchestration-reg-etcd in your pom if registryCenterType = RegistryCenterType.ETCD.
  */
-@ComponentScans({
-    @ComponentScan("io.shardingsphere.example.repository.jpa"),
-    @ComponentScan("io.shardingsphere.transaction.aspect")
-})
+@ComponentScan("io.shardingsphere.example.repository.jpa")
 @EntityScan(basePackages = "io.shardingsphere.example.repository.jpa.entity")
-@SpringBootApplication(exclude = JtaAutoConfiguration.class)
+@SpringBootApplication
 public class SpringBootStarterTransactionExample {
     
     public static void main(final String[] args) {
diff --git a/sharding-jdbc-example/spring-boot-orche-example/spring-boot-orche-mybatis-example/src/main/java/io/shardingsphere/example/spring/boot/mybatis/orche/SpringBootStarterTransactionExample.java b/sharding-jdbc-example/spring-boot-orche-example/spring-boot-orche-mybatis-example/src/main/java/io/shardingsphere/example/spring/boot/mybatis/orche/SpringBootStarterTransactionExample.java
index c0fbcb2..da5176a 100644
--- a/sharding-jdbc-example/spring-boot-orche-example/spring-boot-orche-mybatis-example/src/main/java/io/shardingsphere/example/spring/boot/mybatis/orche/SpringBootStarterTransactionExample.java
+++ b/sharding-jdbc-example/spring-boot-orche-example/spring-boot-orche-mybatis-example/src/main/java/io/shardingsphere/example/spring/boot/mybatis/orche/SpringBootStarterTransactionExample.java
@@ -23,21 +23,16 @@
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration;
 import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.ComponentScans;
 
 /*
  * 1. Please make sure sharding-orchestration-reg-zookeeper-curator in your pom if registryCenterType = RegistryCenterType.ZOOKEEPER.
  * 2. Please make sure sharding-orchestration-reg-etcd in your pom if registryCenterType = RegistryCenterType.ETCD.
  */
-@ComponentScans({
-    @ComponentScan("io.shardingsphere.example.repository.mybatis"),
-    @ComponentScan("io.shardingsphere.transaction.aspect")
-})
+@ComponentScan("io.shardingsphere.example.repository.mybatis")
 @MapperScan(basePackages = "io.shardingsphere.example.repository.mybatis.repository")
-@SpringBootApplication(exclude = JtaAutoConfiguration.class)
+@SpringBootApplication
 public class SpringBootStarterTransactionExample {
     
     public static void main(final String[] args) {
diff --git a/sharding-proxy-example/pom.xml b/sharding-proxy-example/pom.xml
index 0a9cdfe..b423b07 100644
--- a/sharding-proxy-example/pom.xml
+++ b/sharding-proxy-example/pom.xml
@@ -15,4 +15,11 @@
         <module>sharding-proxy-boot-jpa-example</module>
         <module>sharding-proxy-boot-mybatis-example</module>
     </modules>
+    
+    <dependencies>
+        <dependency>
+            <groupId>io.shardingsphere</groupId>
+            <artifactId>sharding-transaction-spring-boot-starter</artifactId>
+        </dependency>
+    </dependencies>
 </project>
diff --git a/sharding-proxy-example/sharding-proxy-boot-jpa-example/src/main/java/io/shardingsphere/example/proxy/spring/boot/jpa/SpringBootStarterTransactionExample.java b/sharding-proxy-example/sharding-proxy-boot-jpa-example/src/main/java/io/shardingsphere/example/proxy/spring/boot/jpa/SpringBootStarterTransactionExample.java
index 9cc0931..21cd53e 100644
--- a/sharding-proxy-example/sharding-proxy-boot-jpa-example/src/main/java/io/shardingsphere/example/proxy/spring/boot/jpa/SpringBootStarterTransactionExample.java
+++ b/sharding-proxy-example/sharding-proxy-boot-jpa-example/src/main/java/io/shardingsphere/example/proxy/spring/boot/jpa/SpringBootStarterTransactionExample.java
@@ -23,17 +23,12 @@
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.domain.EntityScan;
-import org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration;
 import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.ComponentScans;
 
-@ComponentScans({
-    @ComponentScan("io.shardingsphere.example.repository.jpa"),
-    @ComponentScan("io.shardingsphere.transaction.aspect")
-})
+@ComponentScan("io.shardingsphere.example.repository.jpa")
 @EntityScan(basePackages = "io.shardingsphere.example.repository.jpa.entity")
-@SpringBootApplication(exclude = JtaAutoConfiguration.class)
+@SpringBootApplication
 public class SpringBootStarterTransactionExample {
     
     public static void main(final String[] args) {
diff --git a/sharding-proxy-example/sharding-proxy-boot-jpa-example/src/main/resources/conf/config-master_slave.yaml b/sharding-proxy-example/sharding-proxy-boot-jpa-example/src/main/resources/conf/config-master_slave.yaml
index 678669d..1497c8f 100644
--- a/sharding-proxy-example/sharding-proxy-boot-jpa-example/src/main/resources/conf/config-master_slave.yaml
+++ b/sharding-proxy-example/sharding-proxy-boot-jpa-example/src/main/resources/conf/config-master_slave.yaml
@@ -15,7 +15,6 @@
     url: jdbc:mysql://127.0.0.1:3306/master_ds?serverTimezone=UTC&useSSL=false
     username: root
     password:
-    autoCommit: true
     connectionTimeoutMilliseconds: 30000
     idleTimeoutMilliseconds: 60000
     maxLifetimeMilliseconds: 1800000
@@ -24,7 +23,6 @@
     url: jdbc:mysql://127.0.0.1:3306/slave_ds_0?serverTimezone=UTC&useSSL=false
     username: root
     password:
-    autoCommit: true
     connectionTimeoutMilliseconds: 30000
     idleTimeoutMilliseconds: 60000
     maxLifetimeMilliseconds: 1800000
@@ -33,7 +31,6 @@
     url: jdbc:mysql://127.0.0.1:3306/slave_ds_1?serverTimezone=UTC&useSSL=false
     username: root
     password:
-    autoCommit: true
     connectionTimeoutMilliseconds: 30000
     idleTimeoutMilliseconds: 60000
     maxLifetimeMilliseconds: 1800000
diff --git a/sharding-proxy-example/sharding-proxy-boot-jpa-example/src/main/resources/conf/config-sharding.yaml b/sharding-proxy-example/sharding-proxy-boot-jpa-example/src/main/resources/conf/config-sharding.yaml
index f9b3d1e..9314ed5 100644
--- a/sharding-proxy-example/sharding-proxy-boot-jpa-example/src/main/resources/conf/config-sharding.yaml
+++ b/sharding-proxy-example/sharding-proxy-boot-jpa-example/src/main/resources/conf/config-sharding.yaml
@@ -15,7 +15,6 @@
     url: jdbc:mysql://127.0.0.1:3306/ds_0?serverTimezone=UTC&useSSL=false
     username: root
     password:
-    autoCommit: true
     connectionTimeoutMilliseconds: 30000
     idleTimeoutMilliseconds: 60000
     maxLifetimeMilliseconds: 1800000
@@ -24,7 +23,6 @@
     url: jdbc:mysql://127.0.0.1:3306/ds_1?serverTimezone=UTC&useSSL=false
     username: root
     password:
-    autoCommit: true
     connectionTimeoutMilliseconds: 30000
     idleTimeoutMilliseconds: 60000
     maxLifetimeMilliseconds: 1800000
diff --git a/sharding-proxy-example/sharding-proxy-boot-mybatis-example/src/main/java/io/shardingsphere/example/proxy/spring/boot/mybatis/SpringBootStarterTransactionExample.java b/sharding-proxy-example/sharding-proxy-boot-mybatis-example/src/main/java/io/shardingsphere/example/proxy/spring/boot/mybatis/SpringBootStarterTransactionExample.java
index 060ae52..f03e8ee 100644
--- a/sharding-proxy-example/sharding-proxy-boot-mybatis-example/src/main/java/io/shardingsphere/example/proxy/spring/boot/mybatis/SpringBootStarterTransactionExample.java
+++ b/sharding-proxy-example/sharding-proxy-boot-mybatis-example/src/main/java/io/shardingsphere/example/proxy/spring/boot/mybatis/SpringBootStarterTransactionExample.java
@@ -23,17 +23,12 @@
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration;
 import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.ComponentScans;
 
-@ComponentScans({
-    @ComponentScan("io.shardingsphere.example.repository.mybatis"),
-    @ComponentScan("io.shardingsphere.transaction.aspect")
-})
+@ComponentScan("io.shardingsphere.example.repository.mybatis")
 @MapperScan(basePackages = "io.shardingsphere.example.repository.mybatis.repository")
-@SpringBootApplication(exclude = JtaAutoConfiguration.class)
+@SpringBootApplication
 public class SpringBootStarterTransactionExample {
     
     public static void main(final String[] args) {