Skip to content

Commit daf47d8

Browse files
authored
JAVA-10535: Create parent graphql module (eugenp#12112)
* JAVA-10535: Create parent graphql module * JAVA-10535: Cleanup * JAVA-10535: pom files cleanup * JAVA-10535: Use parent-boot-2 as a parent module
1 parent 70a0d0e commit daf47d8

7 files changed

Lines changed: 61 additions & 111 deletions

File tree

graphql/graphql-dgs/pom.xml

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
6-
<groupId>com.baeldung.graphql-dgs</groupId>
76
<artifactId>graphql-dgs</artifactId>
87
<version>1.0</version>
98
<name>graphql-dgs</name>
109

1110
<parent>
12-
<groupId>com.baeldung</groupId>
13-
<artifactId>parent-modules</artifactId>
11+
<groupId>com.baeldung.graphql</groupId>
12+
<artifactId>graphql</artifactId>
1413
<version>1.0.0-SNAPSHOT</version>
15-
<relativePath>../..</relativePath>
1614
</parent>
1715

1816
<dependencyManagement>
@@ -30,39 +28,22 @@
3028
<dependencies>
3129
<dependency>
3230
<groupId>org.springframework.boot</groupId>
33-
<artifactId>spring-boot-starter</artifactId>
34-
<version>2.6.2</version>
35-
</dependency>
36-
<dependency>
37-
<groupId>org.springframework.boot</groupId>
38-
<artifactId>spring-boot-starter-test</artifactId>
39-
<version>2.6.2</version>
40-
<scope>test</scope>
31+
<artifactId>spring-boot-starter-web</artifactId>
4132
</dependency>
4233
<dependency>
4334
<groupId>com.netflix.graphql.dgs.codegen</groupId>
4435
<artifactId>graphql-dgs-codegen-client-core</artifactId>
45-
<version>5.1.14</version>
46-
</dependency>
47-
<dependency>
48-
<groupId>org.springframework.boot</groupId>
49-
<artifactId>spring-boot-starter-web</artifactId>
50-
<version>2.6.2</version>
36+
<version>${graphql-dgs-codegen-client-core.version}</version>
5137
</dependency>
5238
<dependency>
5339
<groupId>com.netflix.graphql.dgs</groupId>
5440
<artifactId>graphql-dgs-spring-boot-starter</artifactId>
55-
<version>4.9.15</version>
41+
<version>${graphql-dgs-spring-boot-starter.version}</version>
5642
</dependency>
5743
</dependencies>
5844

5945
<build>
6046
<plugins>
61-
<plugin>
62-
<groupId>org.springframework.boot</groupId>
63-
<artifactId>spring-boot-maven-plugin</artifactId>
64-
<version>2.6.2</version>
65-
</plugin>
6647
<plugin>
6748
<groupId>io.github.deweyjose</groupId>
6849
<artifactId>graphqlcodegen-maven-plugin</artifactId>
@@ -84,4 +65,9 @@
8465
</plugins>
8566
</build>
8667

68+
<properties>
69+
<graphql-dgs-codegen-client-core.version>5.1.14</graphql-dgs-codegen-client-core.version>
70+
<graphql-dgs-spring-boot-starter.version>4.9.15</graphql-dgs-spring-boot-starter.version>
71+
</properties>
72+
8773
</project>

graphql/graphql-error-handling/pom.xml

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,17 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
6-
<groupId>com.baeldung.graphql</groupId>
76
<artifactId>graphql-error-handling</artifactId>
87
<version>1.0</version>
98
<packaging>jar</packaging>
109
<name>graphql-error-handling</name>
1110

1211
<parent>
13-
<groupId>com.baeldung</groupId>
14-
<artifactId>parent-boot-2</artifactId>
15-
<version>0.0.1-SNAPSHOT</version>
16-
<relativePath>../../parent-boot-2</relativePath>
12+
<groupId>com.baeldung.graphql</groupId>
13+
<artifactId>graphql</artifactId>
14+
<version>1.0.0-SNAPSHOT</version>
1715
</parent>
1816

19-
<properties>
20-
<java.version>1.8</java.version>
21-
<lombok.version>1.18.18</lombok.version>
22-
</properties>
23-
2417
<dependencies>
2518
<dependency>
2619
<groupId>org.springframework.boot</groupId>
@@ -35,13 +28,13 @@
3528
<dependency>
3629
<groupId>com.graphql-java</groupId>
3730
<artifactId>graphql-spring-boot-starter</artifactId>
38-
<version>5.0.2</version>
31+
<version>${graphql-spring-boot-starter.version}</version>
3932
</dependency>
4033

4134
<dependency>
4235
<groupId>com.graphql-java</groupId>
4336
<artifactId>graphql-java-tools</artifactId>
44-
<version>5.2.4</version>
37+
<version>${graphql-java-tools.version}</version>
4538
</dependency>
4639

4740
<dependency>
@@ -60,38 +53,28 @@
6053
<groupId>org.springframework.boot</groupId>
6154
<artifactId>spring-boot-test</artifactId>
6255
<scope>test</scope>
63-
<version>2.6.4</version>
6456
</dependency>
6557

6658
<dependency>
6759
<groupId>com.graphql-java</groupId>
6860
<artifactId>graphql-spring-boot-starter-test</artifactId>
6961
<scope>test</scope>
70-
<version>5.0.2</version>
71-
</dependency>
72-
73-
<dependency>
74-
<groupId>org.assertj</groupId>
75-
<artifactId>assertj-core</artifactId>
76-
<version>3.22.0</version>
77-
<scope>test</scope>
62+
<version>${graphql-spring-boot-starter.version}</version>
7863
</dependency>
7964

8065
<dependency>
8166
<groupId>org.skyscreamer</groupId>
8267
<artifactId>jsonassert</artifactId>
83-
<version>1.5.0</version>
68+
<version>${jsonassert.version}</version>
8469
<scope>test</scope>
8570
</dependency>
8671

8772
</dependencies>
8873

89-
<build>
90-
<plugins>
91-
<plugin>
92-
<groupId>org.springframework.boot</groupId>
93-
<artifactId>spring-boot-maven-plugin</artifactId>
94-
</plugin>
95-
</plugins>
96-
</build>
74+
<properties>
75+
<graphql-spring-boot-starter.version>5.0.2</graphql-spring-boot-starter.version>
76+
<graphql-java-tools.version>5.2.4</graphql-java-tools.version>
77+
<jsonassert.version>1.5.0</jsonassert.version>
78+
</properties>
79+
9780
</project>

graphql/graphql-java/pom.xml

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
6-
<groupId>com.baeldung.graphql</groupId>
76
<artifactId>graphql-java</artifactId>
87
<version>1.0</version>
98
<name>graphql-java</name>
109

1110
<parent>
12-
<groupId>com.baeldung</groupId>
13-
<artifactId>parent-modules</artifactId>
11+
<groupId>com.baeldung.graphql</groupId>
12+
<artifactId>graphql</artifactId>
1413
<version>1.0.0-SNAPSHOT</version>
15-
<relativePath>../../pom.xml</relativePath>
1614
</parent>
1715

1816
<repositories>
@@ -44,12 +42,12 @@
4442
<dependency>
4543
<groupId>com.github.americanexpress.nodes</groupId>
4644
<artifactId>nodes</artifactId>
47-
<version>0.5.0</version>
45+
<version>${nodes.version}</version>
4846
</dependency>
4947
<dependency>
5048
<groupId>com.graphql-java</groupId>
5149
<artifactId>graphql-java</artifactId>
52-
<version>11.0</version>
50+
<version>${graphql-java.version}</version>
5351
</dependency>
5452
<dependency>
5553
<groupId>com.graphql-java</groupId>
@@ -77,16 +75,6 @@
7775
<artifactId>jackson-core</artifactId>
7876
<version>${jackson.version}</version>
7977
</dependency>
80-
<dependency>
81-
<groupId>io.ratpack</groupId>
82-
<artifactId>ratpack-core</artifactId>
83-
<version>${ratpack-core.version}</version>
84-
</dependency>
85-
<dependency>
86-
<groupId>com.github.americanexpress.nodes</groupId>
87-
<artifactId>nodes</artifactId>
88-
<version>${nodes.version}</version>
89-
</dependency>
9078
<dependency>
9179
<groupId>org.apache.commons</groupId>
9280
<artifactId>commons-lang3</artifactId>
@@ -117,20 +105,10 @@
117105
<version>${graphql-java-extended-scalars.version}</version>
118106
</dependency>
119107

120-
121108
</dependencies>
122109

123110
<build>
124111
<plugins>
125-
<plugin>
126-
<groupId>org.apache.maven.plugins</groupId>
127-
<artifactId>maven-compiler-plugin</artifactId>
128-
<version>${maven-compiler-plugin.version}</version>
129-
<configuration>
130-
<source>${maven.compiler.source}</source>
131-
<target>${maven.compiler.target}</target>
132-
</configuration>
133-
</plugin>
134112
<plugin>
135113
<groupId>org.eclipse.jetty</groupId>
136114
<artifactId>jetty-maven-plugin</artifactId>
@@ -169,6 +147,7 @@
169147
</build>
170148

171149
<properties>
150+
<graphql-java.version>11.0</graphql-java.version>
172151
<graphql-java-tools.version>5.2.4</graphql-java-tools.version>
173152
<graphql-java-servlet.version>6.1.3</graphql-java-servlet.version>
174153
<graphql-java-annotations.version>3.0.3</graphql-java-annotations.version>
@@ -182,8 +161,6 @@
182161

183162
<jetty-maven-plugin.version>10.0.7</jetty-maven-plugin.version>
184163

185-
<maven.compiler.source>1.8</maven.compiler.source>
186-
<maven.compiler.target>1.8</maven.compiler.target>
187164
<graphql.java.generator.version>1.18</graphql.java.generator.version>
188165
<graphql-java-extended-scalars.version>2022-04-06T00-10-27-a70541e</graphql-java-extended-scalars.version>
189166
</properties>

graphql/graphql-spqr/pom.xml

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,21 @@
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5-
65
<modelVersion>4.0.0</modelVersion>
7-
<groupId>com.baeldung.graphql</groupId>
86
<artifactId>graphql-spqr</artifactId>
97
<version>1.0</version>
10-
<name>graphql-java</name>
8+
<name>graphql-spqr</name>
119

1210
<parent>
13-
<groupId>com.baeldung</groupId>
14-
<artifactId>parent-modules</artifactId>
11+
<groupId>com.baeldung.graphql</groupId>
12+
<artifactId>graphql</artifactId>
1513
<version>1.0.0-SNAPSHOT</version>
16-
<relativePath>../..</relativePath>
1714
</parent>
1815

1916
<dependencies>
2017
<dependency>
2118
<groupId>org.springframework.boot</groupId>
2219
<artifactId>spring-boot-starter-web</artifactId>
23-
<version>${spring-boot-version}</version>
24-
</dependency>
25-
<dependency>
26-
<groupId>org.springframework.boot</groupId>
27-
<artifactId>spring-boot-starter</artifactId>
28-
<version>${spring-boot-version}</version>
2920
</dependency>
3021
<dependency>
3122
<groupId>io.leangen.graphql</groupId>
@@ -34,18 +25,7 @@
3425
</dependency>
3526
</dependencies>
3627

37-
<build>
38-
<plugins>
39-
<plugin>
40-
<groupId>org.springframework.boot</groupId>
41-
<artifactId>spring-boot-maven-plugin</artifactId>
42-
<version>2.6.2</version>
43-
</plugin>
44-
</plugins>
45-
</build>
46-
4728
<properties>
48-
<spring-boot-version>2.6.2</spring-boot-version>
4929
<graphql-spqr-spring-boot-starter-version>0.0.6</graphql-spqr-spring-boot-starter-version>
5030
</properties>
5131
</project>

graphql/graphql-spqr/src/main/java/com/baeldung/spqr/BookService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import java.util.HashSet;
1010
import java.util.List;
1111
import java.util.Set;
12+
import java.util.stream.Collectors;
1213

1314
@Service
1415
@GraphQLApi
@@ -27,8 +28,7 @@ public Book getBookWithTitle(@GraphQLArgument(name = "title") String title) {
2728

2829
@GraphQLQuery(name = "getAllBooks", description = "Get all books")
2930
public List<Book> getAllBooks() {
30-
return books.stream()
31-
.toList();
31+
return books.stream().collect(Collectors.toList());
3232
}
3333

3434
@GraphQLMutation(name = "addBook")

graphql/pom.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<groupId>com.baeldung.graphql</groupId>
7+
<artifactId>graphql</artifactId>
8+
<version>1.0.0-SNAPSHOT</version>
9+
<name>graphql</name>
10+
<packaging>pom</packaging>
11+
12+
<parent>
13+
<groupId>com.baeldung</groupId>
14+
<artifactId>parent-boot-2</artifactId>
15+
<version>0.0.1-SNAPSHOT</version>
16+
<relativePath>../parent-boot-2</relativePath>
17+
</parent>
18+
19+
<modules>
20+
<module>graphql-dgs</module>
21+
<module>graphql-error-handling</module>
22+
<module>graphql-java</module>
23+
<module>graphql-spqr</module>
24+
</modules>
25+
26+
</project>

pom.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,7 @@
415415
<!-- <module>gradle-5</module> --> <!-- Not a maven project -->
416416
<!-- <module>gradle-6</module> --> <!-- Not a maven project -->
417417
<!-- <module>grails</module> --> <!-- Not a maven project -->
418-
<module>graphql/graphql-java</module>
419-
<module>graphql/graphql-dgs</module>
418+
<module>graphql</module>
420419
<module>grpc</module>
421420
<module>gson</module>
422421
<module>guava-modules</module>
@@ -896,8 +895,7 @@
896895
<!-- <module>gradle-5</module> --> <!-- Not a maven project -->
897896
<!-- <module>gradle-6</module> --> <!-- Not a maven project -->
898897
<!-- <module>grails</module> --> <!-- Not a maven project -->
899-
<module>graphql/graphql-java</module>
900-
<module>graphql/graphql-dgs</module>
898+
<module>graphql</module>
901899
<module>grpc</module>
902900
<module>gson</module>
903901
<module>guava-modules</module>

0 commit comments

Comments
 (0)