Skip to content

Commit cc37377

Browse files
BAEL-778 - renaming the vertx-spring to spring-vertx
1 parent 5cb1c71 commit cc37377

13 files changed

Lines changed: 106 additions & 105 deletions

File tree

‎pom.xml‎

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
34
<modelVersion>4.0.0</modelVersion>
45
<groupId>com.baeldung</groupId>
56
<artifactId>parent-modules</artifactId>
@@ -11,20 +12,20 @@
1112
<properties>
1213
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1314
<gib.referenceBranch>refs/heads/master</gib.referenceBranch>
14-
<!-- <gib.enabled>false</gib.enabled>-->
15+
<!-- <gib.enabled>false</gib.enabled>-->
1516
<junit.version>4.12</junit.version>
16-
<org.hamcrest.version>1.3</org.hamcrest.version>
17+
<org.hamcrest.version>1.3</org.hamcrest.version>
1718
<mockito.version>1.10.19</mockito.version>
1819
<!-- logging -->
1920
<org.slf4j.version>1.7.21</org.slf4j.version>
2021
<logback.version>1.1.7</logback.version>
2122
<!-- plugins -->
22-
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
23-
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
23+
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
24+
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
2425
</properties>
2526

2627
<modules>
27-
<module>vertx-spring</module>
28+
<module>spring-vertx</module>
2829
<module>aws</module>
2930
<module>akka-streams</module>
3031
<module>algorithms</module>
@@ -71,7 +72,7 @@
7172
<module>immutables</module>
7273

7374
<module>jackson</module>
74-
<!-- <module>java-cassandra</module> -->
75+
<!-- <module>java-cassandra</module> -->
7576
<module>vavr</module>
7677
<module>javax-servlets</module>
7778
<module>javaxval</module>
@@ -123,8 +124,8 @@
123124
<module>selenium-junit-testng</module>
124125
<module>solr</module>
125126
<module>spark-java</module>
126-
<module>spring-5</module>
127-
<module>spring-5-mvc</module>
127+
<module>spring-5</module>
128+
<module>spring-5-mvc</module>
128129
<module>spring-akka</module>
129130
<module>spring-amqp</module>
130131
<module>spring-all</module>
@@ -176,7 +177,7 @@
176177
<module>spring-rest-angular</module>
177178
<module>spring-rest-docs</module>
178179
<module>spring-rest</module>
179-
<module>spring-rest-simple</module>
180+
<module>spring-rest-simple</module>
180181
<module>spring-security-cache-control</module>
181182
<module>spring-security-client/spring-security-jsp-authentication</module>
182183
<module>spring-security-client/spring-security-jsp-authorize</module>
@@ -243,12 +244,12 @@
243244
<groupId>ch.qos.logback</groupId>
244245
<artifactId>logback-core</artifactId>
245246
<version>${logback.version}</version>
246-
</dependency>
247+
</dependency>
247248
<dependency>
248249
<groupId>org.slf4j</groupId>
249250
<artifactId>jcl-over-slf4j</artifactId>
250251
<version>${org.slf4j.version}</version>
251-
</dependency>
252+
</dependency>
252253

253254
<!-- test -->
254255
<dependency>
@@ -268,8 +269,8 @@
268269
<artifactId>hamcrest-library</artifactId>
269270
<version>${org.hamcrest.version}</version>
270271
<scope>test</scope>
271-
</dependency>
272-
<dependency>
272+
</dependency>
273+
<dependency>
273274
<groupId>org.hamcrest</groupId>
274275
<artifactId>hamcrest-all</artifactId>
275276
<version>${org.hamcrest.version}</version>
@@ -281,7 +282,7 @@
281282
<version>${mockito.version}</version>
282283
<scope>test</scope>
283284
</dependency>
284-
</dependencies>
285+
</dependencies>
285286

286287
<build>
287288
<plugins>
@@ -296,7 +297,7 @@
296297
<plugin>
297298
<groupId>org.apache.maven.plugins</groupId>
298299
<artifactId>maven-surefire-plugin</artifactId>
299-
<version>${maven-surefire-plugin.version}</version>
300+
<version>${maven-surefire-plugin.version}</version>
300301
<configuration>
301302
<forkCount>3</forkCount>
302303
<reuseForks>true</reuseForks>
@@ -313,12 +314,12 @@
313314
<plugin>
314315
<groupId>org.apache.maven.plugins</groupId>
315316
<artifactId>maven-compiler-plugin</artifactId>
316-
<version>${maven-compiler-plugin.version}</version>
317+
<version>${maven-compiler-plugin.version}</version>
317318
<configuration>
318319
<source>1.8</source>
319320
<target>1.8</target>
320321
</configuration>
321-
</plugin>
322+
</plugin>
322323
</plugins>
323324
<extensions>
324325
<!--<extension>

‎spring-vertx/pom.xml‎

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>com.baeldung</groupId>
7+
<artifactId>vertx-spring</artifactId>
8+
<version>0.0.1-SNAPSHOT</version>
9+
<packaging>jar</packaging>
10+
11+
<name>vertx-spring</name>
12+
<description>A demo project with vertx spring integration</description>
13+
14+
<parent>
15+
<groupId>org.springframework.boot</groupId>
16+
<artifactId>spring-boot-starter-parent</artifactId>
17+
<version>1.5.3.RELEASE</version>
18+
<relativePath/>
19+
<!-- lookup parent from repository -->
20+
</parent>
21+
22+
<properties>
23+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
24+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
25+
<java.version>1.8</java.version>
26+
<vertx.version>3.4.1</vertx.version>
27+
</properties>
28+
29+
<dependencies>
30+
<dependency>
31+
<groupId>org.springframework.boot</groupId>
32+
<artifactId>spring-boot-starter-data-jpa</artifactId>
33+
</dependency>
34+
<dependency>
35+
<groupId>org.springframework.boot</groupId>
36+
<artifactId>spring-boot-starter-web</artifactId>
37+
<exclusions>
38+
<exclusion>
39+
<groupId>org.springframework.boot</groupId>
40+
<artifactId>spring-boot-starter-tomcat</artifactId>
41+
</exclusion>
42+
</exclusions>
43+
</dependency>
44+
<dependency>
45+
<groupId>io.vertx</groupId>
46+
<artifactId>vertx-core</artifactId>
47+
<version>${vertx.version}</version>
48+
</dependency>
49+
<dependency>
50+
<groupId>io.vertx</groupId>
51+
<artifactId>vertx-web</artifactId>
52+
<version>${vertx.version}</version>
53+
</dependency>
54+
55+
<dependency>
56+
<groupId>com.h2database</groupId>
57+
<artifactId>h2</artifactId>
58+
<scope>runtime</scope>
59+
</dependency>
60+
<dependency>
61+
<groupId>org.springframework.boot</groupId>
62+
<artifactId>spring-boot-starter-test</artifactId>
63+
<scope>test</scope>
64+
</dependency>
65+
</dependencies>
66+
67+
<build>
68+
<plugins>
69+
<plugin>
70+
<groupId>org.springframework.boot</groupId>
71+
<artifactId>spring-boot-maven-plugin</artifactId>
72+
</plugin>
73+
</plugins>
74+
</build>
75+
76+
77+
</project>

vertx-spring/src/main/java/com/baeldung/vertxspring/VertxSpringApplication.java renamed to spring-vertx/src/main/java/com/baeldung/vertxspring/VertxSpringApplication.java

File renamed without changes.

vertx-spring/src/main/java/com/baeldung/vertxspring/entity/Article.java renamed to spring-vertx/src/main/java/com/baeldung/vertxspring/entity/Article.java

File renamed without changes.

vertx-spring/src/main/java/com/baeldung/vertxspring/repository/ArticleRepository.java renamed to spring-vertx/src/main/java/com/baeldung/vertxspring/repository/ArticleRepository.java

File renamed without changes.

vertx-spring/src/main/java/com/baeldung/vertxspring/service/ArticleService.java renamed to spring-vertx/src/main/java/com/baeldung/vertxspring/service/ArticleService.java

File renamed without changes.

vertx-spring/src/main/java/com/baeldung/vertxspring/util/DbBootstrap.java renamed to spring-vertx/src/main/java/com/baeldung/vertxspring/util/DbBootstrap.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public class DbBootstrap implements CommandLineRunner {
2121
public void run(String... arg0) throws Exception {
2222

2323
IntStream.range(0, 10)
24-
.forEach(count -> this.articleRepository.save(new Article(new Random().nextLong(), UUID.randomUUID()
25-
.toString())));
24+
.forEach(count -> this.articleRepository.save(new Article(new Random().nextLong(), UUID.randomUUID()
25+
.toString())));
2626

2727
}
2828
}

vertx-spring/src/main/java/com/baeldung/vertxspring/verticles/ServerVerticle.java renamed to spring-vertx/src/main/java/com/baeldung/vertxspring/verticles/ServerVerticle.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ public class ServerVerticle extends AbstractVerticle {
1111

1212
private void getAllArticlesHandler(RoutingContext routingContext) {
1313
vertx.eventBus()
14-
.<String> send(ServiceVerticle.GET_ALL_ARTICLES, "", result -> {
14+
.<String>send(ServiceVerticle.GET_ALL_ARTICLES, "", result -> {
1515
if (result.succeeded()) {
1616
routingContext.response()
1717
.putHeader("content-type", "application/json")
1818
.setStatusCode(200)
1919
.end(result.result()
20-
.body());
20+
.body());
2121
} else {
2222
routingContext.response()
2323
.setStatusCode(500)

vertx-spring/src/main/java/com/baeldung/vertxspring/verticles/ServiceVerticle.java renamed to spring-vertx/src/main/java/com/baeldung/vertxspring/verticles/ServiceVerticle.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,32 @@
1616
public class ServiceVerticle extends AbstractVerticle {
1717

1818
public static final String GET_ALL_ARTICLES = "get.artilces.all";
19-
19+
private final ObjectMapper mapper = Json.mapper;
2020
@Autowired
2121
private ArticleService articleService;
22-
private final ObjectMapper mapper = Json.mapper;
2322

2423
@Override
2524
public void start() throws Exception {
2625
super.start();
2726
vertx.eventBus()
28-
.<String> consumer(GET_ALL_ARTICLES)
29-
.handler(getAllArticleService(articleService));
27+
.<String>consumer(GET_ALL_ARTICLES)
28+
.handler(getAllArticleService(articleService));
3029
}
3130

3231
private Handler<Message<String>> getAllArticleService(ArticleService service) {
33-
return msg -> vertx.<String> executeBlocking(future -> {
32+
return msg -> vertx.<String>executeBlocking(future -> {
3433
try {
3534
future.complete(mapper.writeValueAsString(service.getAllArticle()));
3635
} catch (JsonProcessingException e) {
3736
System.out.println("Failed to serialize result");
3837
future.fail(e);
3938
}
40-
} , result -> {
39+
}, result -> {
4140
if (result.succeeded()) {
4241
msg.reply(result.result());
4342
} else {
4443
msg.reply(result.cause()
45-
.toString());
44+
.toString());
4645
}
4746
});
4847
}

vertx-spring/src/main/resources/application.properties renamed to spring-vertx/src/main/resources/application.properties

File renamed without changes.

0 commit comments

Comments
 (0)