parent
9474266d12
commit
f3d74e30c6
@ -0,0 +1,37 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<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>org.springframework</groupId> |
||||
<artifactId>gs-spring-boot</artifactId> |
||||
<version>0.1.0</version> |
||||
|
||||
<parent> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-starter-parent</artifactId> |
||||
<version>2.0.5.RELEASE</version> |
||||
</parent> |
||||
|
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-starter-web</artifactId> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
<properties> |
||||
<java.version>1.8</java.version> |
||||
</properties> |
||||
|
||||
|
||||
<build> |
||||
<plugins> |
||||
<plugin> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-maven-plugin</artifactId> |
||||
</plugin> |
||||
</plugins> |
||||
</build> |
||||
|
||||
</project> |
@ -0,0 +1,24 @@ |
||||
package hello; |
||||
|
||||
import java.util.Arrays; |
||||
|
||||
import org.springframework.boot.SpringApplication; |
||||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
import org.springframework.context.ApplicationContext; |
||||
|
||||
@SpringBootApplication |
||||
public class Application { |
||||
|
||||
public static void main(String[] args) { |
||||
ApplicationContext ctx = SpringApplication.run(Application.class, 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); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,14 @@ |
||||
package hello; |
||||
|
||||
import org.springframework.web.bind.annotation.RestController; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
||||
@RestController |
||||
public class HelloController { |
||||
|
||||
@RequestMapping("/") |
||||
public String index() { |
||||
return "Greeting for springboot, Hi xadocker....."; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue