JAVA-10535: Create parent graphql module (#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
This commit is contained in:
kwoyke 2022-04-26 15:48:09 +02:00 committed by GitHub
parent f429e707ff
commit 8735a58dd0
7 changed files with 61 additions and 111 deletions

View File

@ -3,16 +3,14 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung.graphql-dgs</groupId>
<artifactId>graphql-dgs</artifactId> <artifactId>graphql-dgs</artifactId>
<version>1.0</version> <version>1.0</version>
<name>graphql-dgs</name> <name>graphql-dgs</name>
<parent> <parent>
<groupId>com.baeldung</groupId> <groupId>com.baeldung.graphql</groupId>
<artifactId>parent-modules</artifactId> <artifactId>graphql</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent> </parent>
<dependencyManagement> <dependencyManagement>
@ -30,39 +28,22 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId> <artifactId>spring-boot-starter-web</artifactId>
<version>2.6.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.6.2</version>
<scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.netflix.graphql.dgs.codegen</groupId> <groupId>com.netflix.graphql.dgs.codegen</groupId>
<artifactId>graphql-dgs-codegen-client-core</artifactId> <artifactId>graphql-dgs-codegen-client-core</artifactId>
<version>5.1.14</version> <version>${graphql-dgs-codegen-client-core.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.6.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.netflix.graphql.dgs</groupId> <groupId>com.netflix.graphql.dgs</groupId>
<artifactId>graphql-dgs-spring-boot-starter</artifactId> <artifactId>graphql-dgs-spring-boot-starter</artifactId>
<version>4.9.15</version> <version>${graphql-dgs-spring-boot-starter.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.6.2</version>
</plugin>
<plugin> <plugin>
<groupId>io.github.deweyjose</groupId> <groupId>io.github.deweyjose</groupId>
<artifactId>graphqlcodegen-maven-plugin</artifactId> <artifactId>graphqlcodegen-maven-plugin</artifactId>
@ -84,4 +65,9 @@
</plugins> </plugins>
</build> </build>
<properties>
<graphql-dgs-codegen-client-core.version>5.1.14</graphql-dgs-codegen-client-core.version>
<graphql-dgs-spring-boot-starter.version>4.9.15</graphql-dgs-spring-boot-starter.version>
</properties>
</project> </project>

View File

@ -3,24 +3,17 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung.graphql</groupId>
<artifactId>graphql-error-handling</artifactId> <artifactId>graphql-error-handling</artifactId>
<version>1.0</version> <version>1.0</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>graphql-error-handling</name> <name>graphql-error-handling</name>
<parent> <parent>
<groupId>com.baeldung</groupId> <groupId>com.baeldung.graphql</groupId>
<artifactId>parent-boot-2</artifactId> <artifactId>graphql</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<relativePath>../../parent-boot-2</relativePath>
</parent> </parent>
<properties>
<java.version>1.8</java.version>
<lombok.version>1.18.18</lombok.version>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@ -35,13 +28,13 @@
<dependency> <dependency>
<groupId>com.graphql-java</groupId> <groupId>com.graphql-java</groupId>
<artifactId>graphql-spring-boot-starter</artifactId> <artifactId>graphql-spring-boot-starter</artifactId>
<version>5.0.2</version> <version>${graphql-spring-boot-starter.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.graphql-java</groupId> <groupId>com.graphql-java</groupId>
<artifactId>graphql-java-tools</artifactId> <artifactId>graphql-java-tools</artifactId>
<version>5.2.4</version> <version>${graphql-java-tools.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@ -60,38 +53,28 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId> <artifactId>spring-boot-test</artifactId>
<scope>test</scope> <scope>test</scope>
<version>2.6.4</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.graphql-java</groupId> <groupId>com.graphql-java</groupId>
<artifactId>graphql-spring-boot-starter-test</artifactId> <artifactId>graphql-spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
<version>5.0.2</version> <version>${graphql-spring-boot-starter.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.22.0</version>
<scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.skyscreamer</groupId> <groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId> <artifactId>jsonassert</artifactId>
<version>1.5.0</version> <version>${jsonassert.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <properties>
<plugins> <graphql-spring-boot-starter.version>5.0.2</graphql-spring-boot-starter.version>
<plugin> <graphql-java-tools.version>5.2.4</graphql-java-tools.version>
<groupId>org.springframework.boot</groupId> <jsonassert.version>1.5.0</jsonassert.version>
<artifactId>spring-boot-maven-plugin</artifactId> </properties>
</plugin>
</plugins>
</build>
</project> </project>

View File

@ -3,16 +3,14 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung.graphql</groupId>
<artifactId>graphql-java</artifactId> <artifactId>graphql-java</artifactId>
<version>1.0</version> <version>1.0</version>
<name>graphql-java</name> <name>graphql-java</name>
<parent> <parent>
<groupId>com.baeldung</groupId> <groupId>com.baeldung.graphql</groupId>
<artifactId>parent-modules</artifactId> <artifactId>graphql</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent> </parent>
<repositories> <repositories>
@ -44,12 +42,12 @@
<dependency> <dependency>
<groupId>com.github.americanexpress.nodes</groupId> <groupId>com.github.americanexpress.nodes</groupId>
<artifactId>nodes</artifactId> <artifactId>nodes</artifactId>
<version>0.5.0</version> <version>${nodes.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.graphql-java</groupId> <groupId>com.graphql-java</groupId>
<artifactId>graphql-java</artifactId> <artifactId>graphql-java</artifactId>
<version>11.0</version> <version>${graphql-java.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.graphql-java</groupId> <groupId>com.graphql-java</groupId>
@ -77,16 +75,6 @@
<artifactId>jackson-core</artifactId> <artifactId>jackson-core</artifactId>
<version>${jackson.version}</version> <version>${jackson.version}</version>
</dependency> </dependency>
<dependency>
<groupId>io.ratpack</groupId>
<artifactId>ratpack-core</artifactId>
<version>${ratpack-core.version}</version>
</dependency>
<dependency>
<groupId>com.github.americanexpress.nodes</groupId>
<artifactId>nodes</artifactId>
<version>${nodes.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
@ -117,20 +105,10 @@
<version>${graphql-java-extended-scalars.version}</version> <version>${graphql-java-extended-scalars.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId> <artifactId>jetty-maven-plugin</artifactId>
@ -169,6 +147,7 @@
</build> </build>
<properties> <properties>
<graphql-java.version>11.0</graphql-java.version>
<graphql-java-tools.version>5.2.4</graphql-java-tools.version> <graphql-java-tools.version>5.2.4</graphql-java-tools.version>
<graphql-java-servlet.version>6.1.3</graphql-java-servlet.version> <graphql-java-servlet.version>6.1.3</graphql-java-servlet.version>
<graphql-java-annotations.version>3.0.3</graphql-java-annotations.version> <graphql-java-annotations.version>3.0.3</graphql-java-annotations.version>
@ -182,8 +161,6 @@
<jetty-maven-plugin.version>10.0.7</jetty-maven-plugin.version> <jetty-maven-plugin.version>10.0.7</jetty-maven-plugin.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<graphql.java.generator.version>1.18</graphql.java.generator.version> <graphql.java.generator.version>1.18</graphql.java.generator.version>
<graphql-java-extended-scalars.version>2022-04-06T00-10-27-a70541e</graphql-java-extended-scalars.version> <graphql-java-extended-scalars.version>2022-04-06T00-10-27-a70541e</graphql-java-extended-scalars.version>
</properties> </properties>

View File

@ -2,30 +2,21 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung.graphql</groupId>
<artifactId>graphql-spqr</artifactId> <artifactId>graphql-spqr</artifactId>
<version>1.0</version> <version>1.0</version>
<name>graphql-java</name> <name>graphql-spqr</name>
<parent> <parent>
<groupId>com.baeldung</groupId> <groupId>com.baeldung.graphql</groupId>
<artifactId>parent-modules</artifactId> <artifactId>graphql</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent> </parent>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
<version>${spring-boot-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring-boot-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.leangen.graphql</groupId> <groupId>io.leangen.graphql</groupId>
@ -34,18 +25,7 @@
</dependency> </dependency>
</dependencies> </dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.6.2</version>
</plugin>
</plugins>
</build>
<properties> <properties>
<spring-boot-version>2.6.2</spring-boot-version>
<graphql-spqr-spring-boot-starter-version>0.0.6</graphql-spqr-spring-boot-starter-version> <graphql-spqr-spring-boot-starter-version>0.0.6</graphql-spqr-spring-boot-starter-version>
</properties> </properties>
</project> </project>

View File

@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors;
@Service @Service
@GraphQLApi @GraphQLApi
@ -27,8 +28,7 @@ public class BookService implements IBookService {
@GraphQLQuery(name = "getAllBooks", description = "Get all books") @GraphQLQuery(name = "getAllBooks", description = "Get all books")
public List<Book> getAllBooks() { public List<Book> getAllBooks() {
return books.stream() return books.stream().collect(Collectors.toList());
.toList();
} }
@GraphQLMutation(name = "addBook") @GraphQLMutation(name = "addBook")

26
graphql/pom.xml Normal file
View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung.graphql</groupId>
<artifactId>graphql</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>graphql</name>
<packaging>pom</packaging>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-boot-2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2</relativePath>
</parent>
<modules>
<module>graphql-dgs</module>
<module>graphql-error-handling</module>
<module>graphql-java</module>
<module>graphql-spqr</module>
</modules>
</project>

View File

@ -415,8 +415,7 @@
<!-- <module>gradle-5</module> --> <!-- Not a maven project --> <!-- <module>gradle-5</module> --> <!-- Not a maven project -->
<!-- <module>gradle-6</module> --> <!-- Not a maven project --> <!-- <module>gradle-6</module> --> <!-- Not a maven project -->
<!-- <module>grails</module> --> <!-- Not a maven project --> <!-- <module>grails</module> --> <!-- Not a maven project -->
<module>graphql/graphql-java</module> <module>graphql</module>
<module>graphql/graphql-dgs</module>
<module>grpc</module> <module>grpc</module>
<module>gson</module> <module>gson</module>
<module>guava-modules</module> <module>guava-modules</module>
@ -896,8 +895,7 @@
<!-- <module>gradle-5</module> --> <!-- Not a maven project --> <!-- <module>gradle-5</module> --> <!-- Not a maven project -->
<!-- <module>gradle-6</module> --> <!-- Not a maven project --> <!-- <module>gradle-6</module> --> <!-- Not a maven project -->
<!-- <module>grails</module> --> <!-- Not a maven project --> <!-- <module>grails</module> --> <!-- Not a maven project -->
<module>graphql/graphql-java</module> <module>graphql</module>
<module>graphql/graphql-dgs</module>
<module>grpc</module> <module>grpc</module>
<module>gson</module> <module>gson</module>
<module>guava-modules</module> <module>guava-modules</module>