├── .gitignore ├── README.md └── demo ├── .gitignore ├── pom.xml └── src ├── main ├── java │ └── demo │ │ ├── DemoApplication.java │ │ └── HelloWorld.java └── resources │ └── application.properties └── test └── java └── demo └── DemoApplicationTests.java /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hello-world-spring-4 2 | Hello World Example with Spring 4 3 | 4 | See more at springframework.guru 5 | -------------------------------------------------------------------------------- /demo/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled source # 2 | ################### 3 | *.com 4 | *.class 5 | *.dll 6 | *.exe 7 | *.o 8 | *.so 9 | 10 | # Packages # 11 | ############ 12 | # it's better to unpack these files and commit the raw source 13 | # git has its own built in compression methods 14 | *.7z 15 | *.dmg 16 | *.gz 17 | *.iso 18 | *.rar 19 | *.tar 20 | *.zip 21 | 22 | # Logs and databases # 23 | ###################### 24 | *.log 25 | *.sqlite 26 | 27 | # OS generated files # 28 | ###################### 29 | .DS_Store 30 | .DS_Store? 31 | ._* 32 | .Spotlight-V100 33 | .Trashes 34 | ehthumbs.db 35 | Thumbs.db 36 | 37 | .project 38 | .classpath 39 | .idea 40 | *.iml 41 | atlassian-ide-plugin.xml 42 | target 43 | -------------------------------------------------------------------------------- /demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.test 7 | demo 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | demo 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 1.2.2.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | demo.DemoApplication 24 | 1.7 25 | 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter 31 | 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-starter-test 36 | test 37 | 38 | 39 | 40 | 41 | 42 | 43 | org.springframework.boot 44 | spring-boot-maven-plugin 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /demo/src/main/java/demo/DemoApplication.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.context.ApplicationContext; 6 | 7 | @SpringBootApplication 8 | public class DemoApplication { 9 | 10 | public static void main(String[] args) { 11 | ApplicationContext ctx = SpringApplication.run(DemoApplication.class, args); 12 | HelloWorld helloWorld = (HelloWorld) ctx.getBean("helloWorld"); 13 | helloWorld.sayHello(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /demo/src/main/java/demo/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | /** 6 | * Created by jt on 3/11/15. 7 | */ 8 | @Component 9 | public class HelloWorld { 10 | public void sayHello(){ 11 | System.out.println("Hello World!!!!"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/springframeworkguru/hello-world-spring-4/be6e5b67abeec05daedfdce4743b1177508e4996/demo/src/main/resources/application.properties -------------------------------------------------------------------------------- /demo/src/test/java/demo/DemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.SpringApplicationConfiguration; 6 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 7 | 8 | @RunWith(SpringJUnit4ClassRunner.class) 9 | @SpringApplicationConfiguration(classes = DemoApplication.class) 10 | public class DemoApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | --------------------------------------------------------------------------------