Skip to content

Commit 79c91fd

Browse files
shaimaa-hshalabypivovarit
authored andcommitted
Spring With Maven BOM (eugenp#2121)
* Spring With Maven BOM * change xml indentation to spaces
1 parent f03ed85 commit 79c91fd

6 files changed

Lines changed: 79 additions & 0 deletions

File tree

‎pom.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
<module>spring-amqp-simple</module>
132132
<module>spring-apache-camel</module>
133133
<module>spring-batch</module>
134+
<module>spring-bom</module>
134135
<module>spring-boot</module>
135136
<module>spring-cloud-data-flow</module>
136137
<module>spring-cloud</module>

‎spring-bom/README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
### Relevant Articles:
3+
- [Spring with Maven BOM]

‎spring-bom/pom.xml‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0"?>
2+
<project
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
4+
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>com.baeldung</groupId>
8+
<artifactId>parent-modules</artifactId>
9+
<version>1.0.0-SNAPSHOT</version>
10+
</parent>
11+
<groupId>com.baeldung</groupId>
12+
<artifactId>spring-bom</artifactId>
13+
<version>1.0.0-SNAPSHOT</version>
14+
<name>spring-bom</name>
15+
<url>http://maven.apache.org</url>
16+
<properties>
17+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18+
</properties>
19+
<dependencyManagement>
20+
<dependencies>
21+
<dependency>
22+
<groupId>org.springframework</groupId>
23+
<artifactId>spring-framework-bom</artifactId>
24+
<version>4.3.8.RELEASE</version>
25+
<type>pom</type>
26+
<scope>import</scope>
27+
</dependency>
28+
</dependencies>
29+
</dependencyManagement>
30+
<dependencies>
31+
<dependency>
32+
<groupId>org.springframework</groupId>
33+
<artifactId>spring-context</artifactId>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.springframework</groupId>
37+
<artifactId>spring-web</artifactId>
38+
</dependency>
39+
</dependencies>
40+
</project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.baeldung.spring.bom;
2+
3+
import org.springframework.context.ApplicationContext;
4+
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
5+
6+
public class HelloWorldApp {
7+
8+
public static void main(String[] args) {
9+
ApplicationContext ctx = new AnnotationConfigApplicationContext(HelloWorldConfig.class);
10+
HelloWorldBean helloWorldBean = ctx.getBean(HelloWorldBean.class);
11+
System.out.println(helloWorldBean.sayHello());
12+
}
13+
14+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.baeldung.spring.bom;
2+
3+
public class HelloWorldBean {
4+
5+
public String sayHello() {
6+
return "Hello World With Maven BOM";
7+
}
8+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.baeldung.spring.bom;
2+
3+
import org.springframework.context.annotation.Bean;
4+
import org.springframework.context.annotation.Configuration;
5+
6+
@Configuration
7+
public class HelloWorldConfig {
8+
9+
@Bean
10+
public HelloWorldBean helloWorldBean() {
11+
return new HelloWorldBean();
12+
}
13+
}

0 commit comments

Comments
 (0)