官术网_书友最值得收藏!

Completing the Gradle script

Similarly, we add more dependencies of the pre-requisite components. You can look at them in the complete Gradle script build.gradle:

    group 'com.book'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.1.50'
ext.spring_boot_version = '1.5.7.RELEASE'

repositories {
mavenCentral()
}
dependencies {
// Kotlin-Gradle Plugin
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// Opens all the classes - Explained later
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
classpath
"org.springframework.boot:
spring-boot-gradle-plugin:
$spring_boot_version"
}
}

apply plugin: 'kotlin'
apply plugin: "kotlin-spring"
apply plugin: 'org.springframework.boot'

sourceCompatibility = 1.8

repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
// For Exposed library
maven { url "https://dl.bintray.com/kotlin/exposed" }
}

dependencies {
// Kotlin
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"

// Spring
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-jdbc'
compile 'org.springframework.boot:spring-boot-devtools'

// Exposed
compile 'org.jetbrains.exposed:exposed:0.8.5'
// For transaction support
compile 'org.jetbrains.exposed:spring-transaction:0.8.5'

// Object Mapping
compile "com.fasterxml.jackson.module:jackson-module-kotlin"
compile "com.github.mayconbordin:postgis-geojson:1.1"

// Database
compile "org.postgresql:postgresql:9.4.1208"
compile "net.postgis:postgis-jdbc:2.2.1"

// Testing

testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile "org.springframework.boot:spring-boot-starter-test"
}

compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}

Recently the Gradle Team announced support for writing the Gradle script in Kotlin instead of Groovy lang. Read more about it at https://blog.gradle.org/kotlin-meets-gradle.

主站蜘蛛池模板: 濮阳市| 寿阳县| 民权县| 永靖县| 绥德县| 湄潭县| 南溪县| 太湖县| 高清| 沙河市| 宜君县| 利津县| 通化市| 甘肃省| 绿春县| 柘荣县| 化德县| 浪卡子县| 辉县市| 平罗县| 峨眉山市| 阿拉善左旗| 吉首市| 彰化县| 旌德县| 天柱县| 外汇| 邵武市| 盐源县| 固安县| 仙居县| 天峨县| 类乌齐县| 东丽区| 保德县| 安徽省| 正镶白旗| 武强县| 永兴县| 高密市| 靖安县|