Spring Initializr build.gradle: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Spring Initializr =Example= <syntaxhighlight lang='groovy'> buildscript { ext { springBootVersion = '2.0....")
 
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:


* [[Spring_Initializr#Build_Specification|Spring Initializr]]
* [[Spring_Initializr#Build_Specification|Spring Initializr]]
* [[IntelliJ IDEA Plugin for Spring Boot#build.gradle|IntelliJ IDEA Plugin for Spring Boot]]


=Example=
=Example=


<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 31: 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()
}