File tree Expand file tree Collapse file tree 15 files changed +61
-59
lines changed Expand file tree Collapse file tree 15 files changed +61
-59
lines changed Original file line number Diff line number Diff line change 262
262
<module >java-spi</module >
263
263
<module >performance-tests</module >
264
264
<module >twilio</module >
265
- <module >java-ee-8-security-api</module >
266
- <module >spring-webflux-amqp</module >
265
+ <module >spring-boot-ctx-fluent</module >
266
+ <module >java-ee-8-security-api</module >
267
+ <module >spring-webflux-amqp</module >
267
268
</modules >
268
269
269
270
<dependencies >
Original file line number Diff line number Diff line change 3
3
<modelVersion >4.0.0</modelVersion >
4
4
5
5
<groupId >com.baeldung</groupId >
6
- <artifactId >ctxexample </artifactId >
6
+ <artifactId >spring-boot-ctx-fluent </artifactId >
7
7
<version >0.0.1-SNAPSHOT</version >
8
8
<packaging >jar</packaging >
9
9
10
- <name >ctxexample</name >
11
- <url >http://maven.apache.org</url >
10
+ <parent >
11
+ <artifactId >parent-boot-2</artifactId >
12
+ <groupId >com.baeldung</groupId >
13
+ <version >0.0.1-SNAPSHOT</version >
14
+ <relativePath >../parent-boot-2</relativePath >
15
+ </parent >
12
16
13
- <properties >
14
- <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
15
- </properties >
16
- <parent >
17
- <groupId >org.springframework.boot</groupId >
18
- <artifactId >spring-boot-starter-parent</artifactId >
19
- <version >2.0.0.RELEASE</version >
20
- </parent >
21
17
<dependencies >
22
18
<dependency >
23
19
<groupId >org.springframework.boot</groupId >
24
20
<artifactId >spring-boot-starter-web</artifactId >
25
21
</dependency >
26
22
</dependencies >
23
+
24
+ <properties >
25
+ <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
26
+ </properties >
27
+
27
28
</project >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- package com .baeldung .web ;
1
+ package com .baeldung .ctx1 ;
2
2
3
3
import org .springframework .boot .autoconfigure .EnableAutoConfiguration ;
4
4
import org .springframework .context .annotation .Bean ;
5
5
import org .springframework .context .annotation .ComponentScan ;
6
6
import org .springframework .context .annotation .Configuration ;
7
7
import org .springframework .context .annotation .PropertySource ;
8
8
9
- import com .baeldung .services .IHomeService ;
9
+ import com .baeldung .parent .IHomeService ;
10
10
11
11
@ Configuration
12
- @ ComponentScan ("com.baeldung.web" )
12
+ @ ComponentScan ("com.baeldung.ctx1" )
13
+ @ PropertySource ("classpath:ctx1.properties" )
13
14
@ EnableAutoConfiguration
14
- @ PropertySource ("classpath:web-app.properties" )
15
- public class WebConfig {
15
+ public class Ctx1Config {
16
16
17
17
@ Bean
18
18
public IHomeService homeService () {
19
19
return new GreetingService ();
20
20
}
21
+
21
22
}
Original file line number Diff line number Diff line change 1
- package com .baeldung .web ;
1
+ package com .baeldung .ctx1 ;
2
2
3
3
import org .springframework .beans .factory .annotation .Autowired ;
4
4
import org .springframework .stereotype .Controller ;
5
5
import org .springframework .web .bind .annotation .GetMapping ;
6
6
import org .springframework .web .bind .annotation .ResponseBody ;
7
7
8
- import com .baeldung .services .IHomeService ;
8
+ import com .baeldung .parent .IHomeService ;
9
9
10
10
@ Controller
11
- public class HomeController {
11
+ public class Ctx1Controller {
12
12
13
13
@ Autowired
14
14
IHomeService homeService ;
Original file line number Diff line number Diff line change 1
- package com .baeldung .web ;
1
+ package com .baeldung .ctx1 ;
2
2
3
3
import org .springframework .stereotype .Service ;
4
4
5
- import com .baeldung .services .IHomeService ;
5
+ import com .baeldung .parent .IHomeService ;
6
6
7
7
@ Service
8
8
public class GreetingService implements IHomeService {
Original file line number Diff line number Diff line change 1
- package com .baeldung .rest ;
1
+ package com .baeldung .ctx2 ;
2
2
3
3
import org .springframework .boot .autoconfigure .EnableAutoConfiguration ;
4
4
import org .springframework .context .annotation .ComponentScan ;
5
5
import org .springframework .context .annotation .Configuration ;
6
6
import org .springframework .context .annotation .PropertySource ;
7
7
8
8
@ Configuration
9
- @ ComponentScan ("com.baeldung.rest " )
9
+ @ ComponentScan ("com.baeldung.ctx2 " )
10
10
@ EnableAutoConfiguration
11
- @ PropertySource ("classpath:rest-app .properties" )
12
- public class RestConfig {
11
+ @ PropertySource ("classpath:ctx2 .properties" )
12
+ public class Ctx2Config {
13
13
14
14
}
Original file line number Diff line number Diff line change 1
- package com .baeldung .rest ;
1
+ package com .baeldung .ctx2 ;
2
2
3
3
import org .springframework .beans .factory .annotation .Autowired ;
4
4
import org .springframework .web .bind .annotation .GetMapping ;
5
5
import org .springframework .web .bind .annotation .RestController ;
6
6
7
- import com .baeldung .services .IHomeService ;
7
+ import com .baeldung .parent .IHomeService ;
8
8
9
9
@ RestController
10
- public class GreetingController {
10
+ public class Ctx2Controller {
11
11
12
12
@ Autowired
13
13
IHomeService homeService ;
Original file line number Diff line number Diff line change
1
+ package com .baeldung .parent ;
2
+
3
+ import org .springframework .boot .WebApplicationType ;
4
+ import org .springframework .boot .builder .SpringApplicationBuilder ;
5
+
6
+ import com .baeldung .ctx1 .Ctx1Config ;
7
+ import com .baeldung .ctx2 .Ctx2Config ;
8
+
9
+ public class App {
10
+ public static void main (String [] args ) {
11
+ new SpringApplicationBuilder ().parent (ParentConfig .class )
12
+ .web (WebApplicationType .NONE )
13
+ .child (Ctx1Config .class )
14
+ .web (WebApplicationType .SERVLET )
15
+ .sibling (Ctx2Config .class )
16
+ .web (WebApplicationType .SERVLET )
17
+ .run (args );
18
+ }
19
+ }
Original file line number Diff line number Diff line change 1
- package com .baeldung .services ;
1
+ package com .baeldung .parent ;
2
2
3
3
import org .springframework .stereotype .Service ;
4
4
You can’t perform that action at this time.
0 commit comments