Simplest SpringBoot Project Example: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
Line 2: Line 2:


* [[Spring_Boot#Overview|Spring Boot]]
* [[Spring_Boot#Overview|Spring Boot]]
* [[Writing_a_REST_Service_with_Spring_Boot#Overview|Writing a REST Service with Spring Boot]]


=Overview=
=Overview=

Latest revision as of 00:35, 7 February 2022

Internal

Overview

Also see:

Writing a REST Service with Spring Boot

Example

settings.gradle

rootProject.name = 'simplest-spring-boot-example'

build.gradle

buildscript {
    ext {
        springBootVersion = '2.0.5.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group = 'playground.simplest.springboot'
version = '0.0.1'
sourceCompatibility = 8

repositories {
    mavenCentral()
}

dependencies {

    implementation('org.projectlombok:lombok:1.18.2')
    implementation('org.springframework.boot:spring-boot-starter')
}


Main Class

...
@SpringBootApplication
public class MainApplication {

    public static void main(String[] args) throws Exception {

        SpringApplication.run(MainApplication.class, args);
    }
}

More details:

Spring Boot Main Class