Merge branch 'master' into bael-16656

This commit is contained in:
Josh Cummings
2019-10-26 15:37:05 -06:00
committed by GitHub
parent db85c8f275
commit 0be2175c89
20539 changed files with 1643630 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
## Spring BOM
This module contains articles about Spring with Maven BOM (Bill Of Materials)
### Relevant Articles:
- [Spring with Maven BOM](https://www.baeldung.com/spring-maven-bom)
+43
View File
@@ -0,0 +1,43 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung</groupId>
<artifactId>spring-bom</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>spring-bom</name>
<url>http://maven.apache.org</url>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>${spring-framework-bom.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
</dependencies>
<properties>
<spring-framework-bom.version>4.3.8.RELEASE</spring-framework-bom.version>
</properties>
</project>
@@ -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());
}
}
@@ -0,0 +1,8 @@
package com.baeldung.spring.bom;
public class HelloWorldBean {
public String sayHello() {
return "Hello World With Maven BOM";
}
}
@@ -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();
}
}
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>
@@ -0,0 +1,13 @@
package org.baeldung;
import org.junit.Test;
import com.baeldung.spring.bom.HelloWorldApp;
public class SpringContextIntegrationTest {
@Test
public final void testMain() throws Exception {
HelloWorldApp.main(null);
}
}
@@ -0,0 +1,13 @@
package org.baeldung;
import org.junit.Test;
import com.baeldung.spring.bom.HelloWorldApp;
public class SpringContextTest {
@Test
public final void testMain() throws Exception {
HelloWorldApp.main(null);
}
}