Files
initializr/initializr-generator/src/main/resources/templates/starter-build.gradle
2017-11-16 14:42:27 +01:00

112 lines
3.0 KiB
Groovy

buildscript {
ext {
{{#buildPropertiesGradle}}
{{key}} = '{{value}}'
{{/buildPropertiesGradle}}
}
repositories {
mavenCentral()
{{^isRelease}}
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
{{/isRelease}}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
{{^bootOneThreeAvailable}}
classpath('io.spring.gradle:dependency-management-plugin:{{dependencyManagementPluginVersion}}')
{{/bootOneThreeAvailable}}
{{#kotlin}}
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}")
{{/kotlin}}
}
}
apply plugin: '{{language}}'
{{#kotlin}}
apply plugin: 'kotlin-spring'
{{/kotlin}}
{{#war}}
apply plugin: 'eclipse-wtp'
{{/war}}
{{^war}}
apply plugin: 'eclipse'
{{/war}}
apply plugin: '{{springBootPluginName}}'
{{^bootOneThreeAvailable}}
apply plugin: 'io.spring.dependency-management'
{{/bootOneThreeAvailable}}
{{#bootTwoZeroAvailable}}
apply plugin: 'io.spring.dependency-management'
{{/bootTwoZeroAvailable}}
{{#war}}
apply plugin: 'war'
{{/war}}
group = '{{groupId}}'
version = '{{version}}'
sourceCompatibility = {{javaVersion}}{{#kotlin}}{{#java8OrLater}}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}{{/java8OrLater}}{{/kotlin}}
repositories {
mavenCentral()
{{#repositoryValues}}
maven { url "{{value.url}}" }
{{/repositoryValues}}
}
{{#providedDependencies}}
configurations {
providedRuntime
}
{{/providedDependencies}}
{{^buildPropertiesVersions.empty}}
ext {
{{#buildPropertiesVersions}}
{{key}} = '{{value}}'
{{/buildPropertiesVersions}}
}
{{/buildPropertiesVersions.empty}}
dependencies {
{{#compileDependencies}}
compile('{{groupId}}:{{artifactId}}{{#version}}:{{version}}{{/version}}{{#type}}@{{type}}{{/type}}')
{{/compileDependencies}}
{{#groovy}}
compile('org.codehaus.groovy:groovy')
{{/groovy}}
{{#kotlin}}
compile("org.jetbrains.kotlin:{{kotlinStdlibArtifactId}}{{^kotlinSupport}}:${kotlinVersion}{{/kotlinSupport}}")
compile("org.jetbrains.kotlin:kotlin-reflect{{^kotlinSupport}}:${kotlinVersion}{{/kotlinSupport}}")
{{/kotlin}}
{{#runtimeDependencies}}
runtime('{{groupId}}:{{artifactId}}{{#version}}:{{version}}{{/version}}{{#type}}@{{type}}{{/type}}')
{{/runtimeDependencies}}
{{#compileOnlyDependencies}}
compileOnly('{{groupId}}:{{artifactId}}{{#version}}:{{version}}{{/version}}{{#type}}@{{type}}{{/type}}')
{{/compileOnlyDependencies}}
{{#providedDependencies}}
providedRuntime('{{groupId}}:{{artifactId}}{{#version}}:{{version}}{{/version}}{{#type}}@{{type}}{{/type}}')
{{/providedDependencies}}
testCompile('org.springframework.boot:spring-boot-starter-test')
{{#testDependencies}}
testCompile('{{groupId}}:{{artifactId}}{{#version}}:{{version}}{{/version}}{{#type}}@{{type}}{{/type}}')
{{/testDependencies}}
}
{{#hasBoms}}
dependencyManagement {
imports {
{{#reversedBoms}}
mavenBom "{{groupId}}:{{artifactId}}:{{versionToken}}"
{{/reversedBoms}}
}
}
{{/hasBoms}}