From 996ccc4a2760cee1a238d31eba4004ddc0a9be66 Mon Sep 17 00:00:00 2001 From: Juraj Veverka Date: Thu, 13 Sep 2018 04:14:35 +0200 Subject: [PATCH] springboot demo created --- spring/springboot/.gitignore | 27 +++++++++++++ spring/springboot/README.md | 7 ++++ spring/springboot/build.gradle | 39 +++++++++++++++++++ spring/springboot/settings.gradle | 1 + .../springboot/demo/DemoApplication.java | 12 ++++++ .../src/main/resources/application.properties | 0 .../springboot/demo/DemoApplicationTests.java | 16 ++++++++ 7 files changed, 102 insertions(+) create mode 100644 spring/springboot/.gitignore create mode 100644 spring/springboot/README.md create mode 100644 spring/springboot/build.gradle create mode 100644 spring/springboot/settings.gradle create mode 100644 spring/springboot/src/main/java/itx/examples/springboot/demo/DemoApplication.java create mode 100644 spring/springboot/src/main/resources/application.properties create mode 100644 spring/springboot/src/test/java/itx/examples/springboot/demo/DemoApplicationTests.java diff --git a/spring/springboot/.gitignore b/spring/springboot/.gitignore new file mode 100644 index 0000000..b334fd0 --- /dev/null +++ b/spring/springboot/.gitignore @@ -0,0 +1,27 @@ +.gradle +/build/ +/out/ +!gradle/wrapper/gradle-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr +/out/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ \ No newline at end of file diff --git a/spring/springboot/README.md b/spring/springboot/README.md new file mode 100644 index 0000000..20885ea --- /dev/null +++ b/spring/springboot/README.md @@ -0,0 +1,7 @@ +# Simple Spring Boot 2.0 demo + +### Build and run +``` +gradle clean build +java -jar build/libs/demo-0.0.1-SNAPSHOT.jar +``` diff --git a/spring/springboot/build.gradle b/spring/springboot/build.gradle new file mode 100644 index 0000000..9a02cb9 --- /dev/null +++ b/spring/springboot/build.gradle @@ -0,0 +1,39 @@ +buildscript { + ext { + springBootVersion = '2.1.0.M2' + } + repositories { + mavenCentral() + maven { url "https://repo.spring.io/snapshot" } + maven { url "https://repo.spring.io/milestone" } + } + dependencies { + classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") + } +} + +apply plugin: 'java' +apply plugin: 'eclipse' +//apply plugin: 'application' +apply plugin: 'org.springframework.boot' +apply plugin: 'io.spring.dependency-management' + +group = 'itx.examples.springboot' +version = '0.0.1-SNAPSHOT' + +//mainClassName = 'itx.examples.springboot.demo.DemoApplication' + +sourceCompatibility = 10 +targetCompatibility = 10 + +repositories { + mavenCentral() + maven { url "https://repo.spring.io/snapshot" } + maven { url "https://repo.spring.io/milestone" } +} + + +dependencies { + compile('org.springframework.boot:spring-boot-starter-web') + testCompile('org.springframework.boot:spring-boot-starter-test') +} diff --git a/spring/springboot/settings.gradle b/spring/springboot/settings.gradle new file mode 100644 index 0000000..0a383dd --- /dev/null +++ b/spring/springboot/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'demo' diff --git a/spring/springboot/src/main/java/itx/examples/springboot/demo/DemoApplication.java b/spring/springboot/src/main/java/itx/examples/springboot/demo/DemoApplication.java new file mode 100644 index 0000000..a2c39dd --- /dev/null +++ b/spring/springboot/src/main/java/itx/examples/springboot/demo/DemoApplication.java @@ -0,0 +1,12 @@ +package itx.examples.springboot.demo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class DemoApplication { + + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } +} diff --git a/spring/springboot/src/main/resources/application.properties b/spring/springboot/src/main/resources/application.properties new file mode 100644 index 0000000..e69de29 diff --git a/spring/springboot/src/test/java/itx/examples/springboot/demo/DemoApplicationTests.java b/spring/springboot/src/test/java/itx/examples/springboot/demo/DemoApplicationTests.java new file mode 100644 index 0000000..d977223 --- /dev/null +++ b/spring/springboot/src/test/java/itx/examples/springboot/demo/DemoApplicationTests.java @@ -0,0 +1,16 @@ +package itx.examples.springboot.demo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class DemoApplicationTests { + + @Test + public void contextLoads() { + } + +}