Преглед на файлове

Revert: 修复 provided 问题 并去除war插件

聂秋秋 преди 6 години
родител
ревизия
5184f3b8a4
променени са 4 файла, в които са добавени 25 реда и са изтрити 23 реда
  1. 17 10
      build.gradle
  2. 2 2
      mybatis-plus-core/build.gradle
  3. 5 6
      mybatis-plus-extension/build.gradle
  4. 1 5
      mybatis-plus/build.gradle

+ 17 - 10
build.gradle

@@ -79,9 +79,10 @@ subprojects {
 
 
     apply plugin: 'java'
     apply plugin: 'java'
     apply plugin: 'signing'
     apply plugin: 'signing'
+    apply plugin: 'war'
     apply plugin: 'maven-publish'
     apply plugin: 'maven-publish'
     apply plugin: 'nebula.optional-base'
     apply plugin: 'nebula.optional-base'
-
+    apply plugin: 'nebula.provided-base'
     sourceCompatibility = "${javaVersion}"
     sourceCompatibility = "${javaVersion}"
     targetCompatibility = "${javaVersion}"
     targetCompatibility = "${javaVersion}"
 
 
@@ -89,14 +90,10 @@ subprojects {
         options.encoding = 'UTF-8'
         options.encoding = 'UTF-8'
     }
     }
 
 
-    configurations {
-        provided
-    }
-
-    sourceSets {
-        main.compileClasspath += configurations.provided
-        test.compileClasspath += configurations.provided
-        test.runtimeClasspath += configurations.provided
+    jar {
+        manifest {
+            attributes 'Implementation-Version': version
+        }
     }
     }
 
 
     repositories {
     repositories {
@@ -108,7 +105,7 @@ subprojects {
     }
     }
 
 
     dependencies {
     dependencies {
-        provided rootProject.ext.dependencies["lombok"]
+        compile rootProject.ext.dependencies["lombok"], optional
         testCompile rootProject.ext.dependencies["mockito-all"]
         testCompile rootProject.ext.dependencies["mockito-all"]
         testCompile rootProject.ext.dependencies["junit"]
         testCompile rootProject.ext.dependencies["junit"]
     }
     }
@@ -207,6 +204,16 @@ subprojects {
                             email = 'jobob@qq.com'
                             email = 'jobob@qq.com'
                         }
                         }
                     }
                     }
+
+                    withXml {
+                        asNode().dependencies.'*'.findAll() {
+                            it.scope.text() == 'compile' && project.configurations.provided.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["jsqlparser"]
 //    compile rootProject.ext.dependencies["mybatis-spring"]
 //    compile rootProject.ext.dependencies["mybatis-spring"]
 
 
-    provided rootProject.ext.dependencies["cglib"]
-    provided rootProject.ext.dependencies["spring-aop"]
+    compile rootProject.ext.dependencies["cglib"], optional
+    compile rootProject.ext.dependencies["spring-aop"], optional
 //    provided rootProject.ext.dependencies["spring-tx"]
 //    provided rootProject.ext.dependencies["spring-tx"]
 
 
     testCompile rootProject.ext.dependencies["mybatis-ehcache"]
     testCompile rootProject.ext.dependencies["mybatis-ehcache"]

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

@@ -1,16 +1,15 @@
 apply plugin: 'org.jetbrains.kotlin.jvm'
 apply plugin: 'org.jetbrains.kotlin.jvm'
-
 dependencies {
 dependencies {
     compile project(":mybatis-plus-core")
     compile project(":mybatis-plus-core")
     compile rootProject.ext.dependencies["mybatis-spring"]
     compile rootProject.ext.dependencies["mybatis-spring"]
     compile rootProject.ext.dependencies["mybatis"]
     compile rootProject.ext.dependencies["mybatis"]
 
 
-    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"]
+    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
     provided rootProject.ext.dependencies["javax.servlet-api"]
     provided rootProject.ext.dependencies["javax.servlet-api"]
-    provided rootProject.ext.dependencies["slf4j-api"]
+    compile rootProject.ext.dependencies["slf4j-api"], optional
 
 
     testCompile rootProject.ext.dependencies["spring-web"]
     testCompile rootProject.ext.dependencies["spring-web"]
     testCompile rootProject.ext.dependencies["javax.servlet-api"]
     testCompile rootProject.ext.dependencies["javax.servlet-api"]

+ 1 - 5
mybatis-plus/build.gradle

@@ -4,11 +4,7 @@ dependencies {
 
 
     testCompile rootProject.ext.dependencies["spring-web"]
     testCompile rootProject.ext.dependencies["spring-web"]
     testCompile rootProject.ext.dependencies["javax.servlet-api"]
     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["spring-test"]
     testCompile rootProject.ext.dependencies["fastjson"]
     testCompile rootProject.ext.dependencies["fastjson"]