فهرست منبع

修复 provided 问题

miemie 6 سال پیش
والد
کامیت
b4feba876e
4فایلهای تغییر یافته به همراه24 افزوده شده و 27 حذف شده
  1. 10 18
      build.gradle
  2. 2 2
      mybatis-plus-core/build.gradle
  3. 7 6
      mybatis-plus-extension/build.gradle
  4. 5 1
      mybatis-plus/build.gradle

+ 10 - 18
build.gradle

@@ -1,6 +1,5 @@
 buildscript {
     repositories {
-        maven { url "https://repo.spring.io/plugins-release" }
         maven { url "https://plugins.gradle.org/m2/" }
     }
     dependencies {
@@ -80,10 +79,9 @@ subprojects {
 
     apply plugin: 'java'
     apply plugin: 'signing'
-    apply plugin: 'war'
     apply plugin: 'maven-publish'
     apply plugin: 'nebula.optional-base'
-    apply plugin: 'nebula.provided-base'
+
     sourceCompatibility = "${javaVersion}"
     targetCompatibility = "${javaVersion}"
 
@@ -91,10 +89,14 @@ subprojects {
         options.encoding = 'UTF-8'
     }
 
-    jar {
-        manifest {
-            attributes 'Implementation-Version': version
-        }
+    configurations {
+        provided
+    }
+
+    sourceSets {
+        main.compileClasspath += configurations.provided
+        test.compileClasspath += configurations.provided
+        test.runtimeClasspath += configurations.provided
     }
 
     repositories {
@@ -106,7 +108,7 @@ subprojects {
     }
 
     dependencies {
-        compile rootProject.ext.dependencies["lombok"], optional
+        provided rootProject.ext.dependencies["lombok"]
         testCompile rootProject.ext.dependencies["mockito-all"]
         testCompile rootProject.ext.dependencies["junit"]
     }
@@ -205,16 +207,6 @@ subprojects {
                             email = 'jobob@qq.com'
                         }
                     }
-
-                    withXml {
-                        asNode().dependencies.'*'.findAll() {
-                            it.scope.text() == 'compile' && project.configurations.providedCompile.allDependencies.find { dep ->
-                                dep.name == it.artifactId.text()
-                            }
-                        }.each() {
-                            it.scope*.value = 'provided'
-                        }
-                    }
                 }
             }
         }

+ 2 - 2
mybatis-plus-core/build.gradle

@@ -4,8 +4,8 @@ dependencies {
     compile rootProject.ext.dependencies["jsqlparser"]
 //    compile rootProject.ext.dependencies["mybatis-spring"]
 
-    compile rootProject.ext.dependencies["cglib"], optional
-    compile rootProject.ext.dependencies["spring-aop"], optional
+    provided rootProject.ext.dependencies["cglib"]
+    provided rootProject.ext.dependencies["spring-aop"]
 //    provided rootProject.ext.dependencies["spring-tx"]
 
     testCompile rootProject.ext.dependencies["mybatis-ehcache"]

+ 7 - 6
mybatis-plus-extension/build.gradle

@@ -1,15 +1,16 @@
 apply plugin: 'org.jetbrains.kotlin.jvm'
+
 dependencies {
     compile project(":mybatis-plus-core")
     compile rootProject.ext.dependencies["mybatis-spring"]
     compile rootProject.ext.dependencies["mybatis"]
 
-    compile rootProject.ext.dependencies["kotlin-stdlib-jdk8"], optional
-    compile rootProject.ext.dependencies["kotlin-reflect"], optional
-    compile rootProject.ext.dependencies["spring-context-support"], optional
-    compile rootProject.ext.dependencies["spring-jdbc"], optional
-    providedCompile rootProject.ext.dependencies["javax.servlet-api"]
-    compile rootProject.ext.dependencies["slf4j-api"], optional
+    provided rootProject.ext.dependencies["kotlin-stdlib-jdk8"]
+    provided rootProject.ext.dependencies["kotlin-reflect"]
+    provided rootProject.ext.dependencies["spring-context-support"]
+    provided rootProject.ext.dependencies["spring-jdbc"]
+    provided rootProject.ext.dependencies["javax.servlet-api"]
+    provided rootProject.ext.dependencies["slf4j-api"]
 
     testCompile rootProject.ext.dependencies["spring-web"]
     testCompile rootProject.ext.dependencies["javax.servlet-api"]

+ 5 - 1
mybatis-plus/build.gradle

@@ -4,7 +4,11 @@ dependencies {
 
     testCompile rootProject.ext.dependencies["spring-web"]
     testCompile rootProject.ext.dependencies["javax.servlet-api"]
-
+    
+    testCompile rootProject.ext.dependencies["spring-aop"]
+    testCompile rootProject.ext.dependencies["spring-context-support"]
+    testCompile rootProject.ext.dependencies["spring-tx"]
+    testCompile rootProject.ext.dependencies["spring-jdbc"]
     testCompile rootProject.ext.dependencies["spring-test"]
     testCompile rootProject.ext.dependencies["fastjson"]