更新编译配置,规范版本定义
authorTang Cheng <cheng.tang@supwisdom.com>
Tue, 9 Apr 2019 05:10:47 +0000 (13:10 +0800)
committerTang Cheng <cheng.tang@supwisdom.com>
Tue, 9 Apr 2019 05:10:47 +0000 (13:10 +0800)
build.gradle
gradle.properties [new file with mode: 0644]
settings.gradle

index dc115a2..ea080fb 100644 (file)
@@ -1,16 +1,16 @@
 plugins {
-    id 'org.jetbrains.kotlin.plugin.jpa' version '1.2.41'
-    id 'org.springframework.boot' version '2.1.3.RELEASE'
     id 'war'
-    id 'org.jetbrains.kotlin.jvm' version '1.2.41'
-    id 'org.jetbrains.kotlin.plugin.spring' version '1.2.41'
+    id 'org.springframework.boot'
+    id 'org.jetbrains.kotlin.jvm'
+    id 'org.jetbrains.kotlin.plugin.jpa'
+    id 'org.jetbrains.kotlin.plugin.spring'
 }
 
 apply plugin: 'io.spring.dependency-management'
 
 group = 'com.supwisdom'
-version = '0.0.1-SNAPSHOT'
-sourceCompatibility = '1.8'
+version = payapiVersion
+sourceCompatibility = jdkVersion
 
 repositories {
     mavenCentral()
@@ -35,13 +35,13 @@ dependencies {
 compileKotlin {
     kotlinOptions {
         freeCompilerArgs = ['-Xjsr305=strict']
-        jvmTarget = '1.8'
+        jvmTarget = jdkVersion
     }
 }
 
 compileTestKotlin {
     kotlinOptions {
         freeCompilerArgs = ['-Xjsr305=strict']
-        jvmTarget = '1.8'
+        jvmTarget = jdkVersion
     }
 }
diff --git a/gradle.properties b/gradle.properties
new file mode 100644 (file)
index 0000000..b59ebef
--- /dev/null
@@ -0,0 +1,4 @@
+springbootVersion = 2.1.3.RELEASE
+kotlinVersion = 1.2.41
+payapiVersion = 1.0
+jdkVersion = 1.8
\ No newline at end of file
index cbac435..3a84da4 100644 (file)
@@ -1,6 +1,20 @@
 pluginManagement {
+    resolutionStrategy {
+        eachPlugin {
+            if (requested.id.namespace != null) {
+                if (requested.id.namespace.startsWith("org.jetbrains.kotlin")) {
+                    println "Kotlin version $kotlinVersion"
+                    useVersion kotlinVersion
+                } else if(requested.id.namespace.startsWith("org.springframework")) {
+                    println "Springboot version $springbootVersion"
+                    useVersion springbootVersion
+                }
+            }
+        }
+    }
     repositories {
         gradlePluginPortal()
     }
 }
 rootProject.name = 'dlpay'
+