Spring With Maven BOM (#2121)

* Spring With Maven BOM

* change xml indentation to spaces
This commit is contained in:
shaimaa-hshalaby
2017-06-24 08:04:09 +02:00
committed by Grzegorz Piwowarek
parent f03ed8548b
commit 79c91fdb33
6 changed files with 79 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
package com.baeldung.spring.bom;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
public class HelloWorldApp {
public static void main(String[] args) {
ApplicationContext ctx = new AnnotationConfigApplicationContext(HelloWorldConfig.class);
HelloWorldBean helloWorldBean = ctx.getBean(HelloWorldBean.class);
System.out.println(helloWorldBean.sayHello());
}
}

View File

@@ -0,0 +1,8 @@
package com.baeldung.spring.bom;
public class HelloWorldBean {
public String sayHello() {
return "Hello World With Maven BOM";
}
}

View File

@@ -0,0 +1,13 @@
package com.baeldung.spring.bom;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class HelloWorldConfig {
@Bean
public HelloWorldBean helloWorldBean() {
return new HelloWorldBean();
}
}