diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..7ece7f6d1f2ee3652c42cc89b4d31b0166acd768 --- /dev/null +++ b/pom.xml @@ -0,0 +1,45 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>de.rtuni.ms.ds</groupId> + <artifactId>dummy-service</artifactId> + <version>1.0.0</version> + <packaging>war</packaging> + + <parent> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-parent</artifactId> + <version>2.2.1.RELEASE</version> + </parent> + + <dependencies> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-tomcat</artifactId> + <scope>provided</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <version>2.2.1.RELEASE</version> + <configuration> + <mainClass>de.rtuni.ms.ds.Application</mainClass> + </configuration> + </plugin> + </plugins> + </build> +</project> \ No newline at end of file diff --git a/src/main/java/de/rtuni/ms/ds/Application.java b/src/main/java/de/rtuni/ms/ds/Application.java new file mode 100644 index 0000000000000000000000000000000000000000..00b39b54043960d80c398566731bb397041a8b32 --- /dev/null +++ b/src/main/java/de/rtuni/ms/ds/Application.java @@ -0,0 +1,51 @@ +/* + * Copyright 2019 (C) by Julian Horner. + * All Rights Reserved. + */ + +package de.rtuni.ms.ds; + +import java.util.Arrays; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; + +/** + * @author Julian + * + */ +@SpringBootApplication +public class Application { + //--------------------------------------------------------------------------------------------- + + /** + * Starts the application. + * + * @param args The arguments + */ + public static void main(final String[] args) { + SpringApplication.run(Application.class, args); + } + + //--------------------------------------------------------------------------------------------- + + @Bean + public CommandLineRunner commandLineRunner(ApplicationContext ctx) { + return args -> { + + System.out.println("Let's inspect the beans provided by Spring Boot:"); + + String[] beanNames = ctx.getBeanDefinitionNames(); + Arrays.sort(beanNames); + for (String beanName : beanNames) { + System.out.println(beanName); + } + + }; + } + + //--------------------------------------------------------------------------------------------- +} diff --git a/src/main/java/de/rtuni/ms/ds/DummyController.java b/src/main/java/de/rtuni/ms/ds/DummyController.java new file mode 100644 index 0000000000000000000000000000000000000000..d6e150544daffd006cdf4ccc9129a482e848c556 --- /dev/null +++ b/src/main/java/de/rtuni/ms/ds/DummyController.java @@ -0,0 +1,27 @@ +/* + * Copyright 2019 (C) by Julian Horner. + * All Rights Reserved. + */ + +package de.rtuni.ms.ds; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Dummy controller. + * + * @author Julian + * + */ +@RestController +public class DummyController { + //--------------------------------------------------------------------------------------------- + + @RequestMapping("/") + public String index() { + return "Greetings from SB"; + } + + //--------------------------------------------------------------------------------------------- +}