1
我有一個gradle構建腳本,用於構建可運行的jar(依賴性也是罐子),它使用彈簧啓動gradle插件,工作正常,我想知道如何將其轉換爲gradle腳本kotlin。我不知道如何處理bootRepackage,profile以及kotlin中的processResources。以及它是否支持與Spring Boot Gradle插件一起使用?謝謝。如何使用gradle腳本kotlin和spring啓動gradle插件來構建一個可運行的jar
apply plugin: 'java'
apply plugin: 'eclipse'
buildscript {
repositories {
maven { url 'https://repo.spring.io/libs-milestone' }
}
dependencies {
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.5.4.RELEASE'
}
}
apply plugin: 'org.springframework.boot'
sourceCompatibility = 1.6
targetCompatibility = 1.6
version = "1.0.0"
tasks.withType(JavaCompile) {
options.bootClasspath = "$JDK6_HOME/jre/lib/rt.jar"
}
if (project.hasProperty('env')) {
println "Target environment: $env"
sourceSets.main.resources.srcDir "src/main/profile/$env"
}
processResources{
exclude 'TagNames.properties'
}
repositories {
jcenter()
maven { url "http://clojars.org/repo" }
}
dependencies {
compile files('lib/jlibs-core.jar')
compile files('lib/jlibs-xml.jar')
compile files('lib/autonomyPiB.jar')
}
bootRepackage {
mainClass = 'com.test.TestA'
}