Selaa lähdekoodia

排除phoenix依赖与测试用例.

聂秋秋 5 vuotta sitten
vanhempi
commit
7eb5440374

+ 1 - 0
build.gradle

@@ -177,6 +177,7 @@ subprojects {
         useJUnitPlatform()
         exclude("**/generator/**")
         exclude("**/mysql/**")
+        exclude("**/phoenix/**")
     }
 
     task javadocJar(type: Jar) {

+ 2 - 10
mybatis-plus/build.gradle

@@ -13,19 +13,11 @@ dependencies {
     testCompile "${lib.postgresql}"
     testCompile lib.oracle as ConfigurableFileTree
     testCompile "${lib.mysql}"
-//    testCompile "${lib.jackson}"
+    testCompile "${lib.jackson}"
     testCompile "${lib.'mybatis-ehcache'}"
     testCompile "${lib.'mybatis-redis'}"
     testCompile "${lib.'spring-context-support'}"
     testCompile "${lib.'spring-jdbc'}"
     testCompile 'javax.annotation:javax.annotation-api:1.3.2'
-    // 与jackson会冲突
-    testCompile ('com.github.flyingglass:phoenix-core-shaded:1.0.0-SNAPSHOT')
-        {
-            exclude group: 'org.apache.phoenix', module: 'phoenix-core'
-        }
-    testCompile ('com.github.flyingglass:hbase-client-shaded:1.0.0-SNAPSHOT')
-        {
-            exclude group: 'org.apache.hbase', module: 'hbase-client'
-        }
+//    testCompile ('org.apache.phoenix:phoenix-core:5.0.0-HBase-2.0')
 }

+ 4 - 2
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/phoenix/config/DBConfig.java

@@ -27,6 +27,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
 
 import javax.sql.DataSource;
 import java.io.IOException;
+import java.sql.Driver;
 import java.util.Properties;
 
 /**
@@ -34,13 +35,14 @@ import java.util.Properties;
  * @since 2018/6/7
  */
 @Configuration
+@SuppressWarnings("unchecked")
 @EnableTransactionManagement
 public class DBConfig {
 
     @Bean("dataSource")
-    public DataSource dataSource() {
+    public DataSource dataSource() throws ClassNotFoundException {
         SimpleDriverDataSource dataSource = new SimpleDriverDataSource();
-        dataSource.setDriverClass(org.apache.phoenix.jdbc.PhoenixDriver.class);
+        dataSource.setDriverClass((Class<? extends Driver>) Class.forName("org.apache.phoenix.jdbc.PhoenixDriver"));
         dataSource.setUrl("jdbc:phoenix:dnode28,dnode29,dnode30:2181");
         Properties properties = new Properties();
         properties.setProperty("schema", "TEST");