Spring Initializr build.gradle: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 7: Line 7:


<syntaxhighlight lang='groovy'>
<syntaxhighlight lang='groovy'>
buildscript {
//file:noinspection GradlePackageUpdate
     ext {
plugins {
        springBootVersion = '2.0.5.RELEASE'
     id 'org.springframework.boot' version '2.6.3'
     }
     id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    repositories {
     id 'java'
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
     }
}
}


apply plugin: 'java'
group = 'playground.smoke'
apply plugin: 'eclipse'
version = '0.1.0-SNAPSHOT'
apply plugin: 'org.springframework.boot'
sourceCompatibility = '11'
apply plugin: 'io.spring.dependency-management'
 
group = 'playground.spring.springBootWithInitializrFromIntellij'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8


repositories {
repositories {
Line 32: Line 22:
}
}


dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}


dependencies {
tasks.named('test') {
    implementation('org.springframework.boot:spring-boot-starter')
     useJUnitPlatform()
    runtimeOnly('org.springframework.boot:spring-boot-devtools')
     compileOnly('org.projectlombok:lombok')
    testImplementation('org.springframework.boot:spring-boot-starter-test')
}
}
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 23:52, 6 February 2022

Internal

Example

//file:noinspection GradlePackageUpdate
plugins {
    id 'org.springframework.boot' version '2.6.3'
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    id 'java'
}

group = 'playground.smoke'
version = '0.1.0-SNAPSHOT'
sourceCompatibility = '11'

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

tasks.named('test') {
    useJUnitPlatform()
}