<?xml version="1.0" encoding="UTF-8"?>
<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">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.datastax.stargate</groupId>
	<artifactId>stargate-sdk</artifactId>
	<name>+ stargate-sdk</name>
	<description>Connect to Stargate Data Gateway</description>

	<parent>
		<groupId>com.datastax.astra</groupId>
		<artifactId>astra-sdk-parent</artifactId>
		<version>0.3.3</version>
	</parent>

	<properties>
		<dgs.codegen.version>5.1.16</dgs.codegen.version>
		<nodes.version>0.5.0</nodes.version>
		<retry4j.version>0.15.0</retry4j.version>
		<graphql-codegen.version>1.16</graphql-codegen.version>
	</properties>
	
	<dependencies>
	    
	    <!--  Support for Cqlsession -->
		<dependency>
			<groupId>com.datastax.oss</groupId>
			<artifactId>java-driver-core</artifactId>
		</dependency>
		
		<!--  http Client v5 -->
		<dependency>
    		<groupId>org.apache.httpcomponents.client5</groupId>
  			<artifactId>httpclient5</artifactId>
		</dependency>
		<dependency>
  			<groupId>org.apache.httpcomponents.client5</groupId>
  			<artifactId>httpclient5-fluent</artifactId>
		</dependency>
		<!--  Implements retry HTTP CALLS -->
		<dependency>
		    <groupId>com.evanlennick</groupId>
		    <artifactId>retry4j</artifactId>
		    <version>${retry4j.version}</version>
		</dependency>

		<!-- Support for JSON Api -->
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-core</artifactId>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-annotations</artifactId>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
		</dependency>
		<!-- Json Schema Validation -->
		<dependency>
	    	<groupId>org.everit.json</groupId>
	    	<artifactId>org.everit.json.schema</artifactId>
	    </dependency>
		<!--  Logger -->
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-core</artifactId>
		</dependency>
		<!-- GraphQL -->
		<dependency>
			<groupId>com.netflix.graphql.dgs.codegen</groupId>
			<artifactId>graphql-dgs-codegen-client-core</artifactId>
			<version>${dgs.codegen.version}</version>
			<scope>provided</scope>
		</dependency>
		<!-- GRPC -->
		 <dependency>
	        <groupId>io.stargate.grpc</groupId>
	        <artifactId>grpc-proto</artifactId>
   		</dependency>
	    <dependency>
	         <groupId>io.grpc</groupId>
	         <artifactId>grpc-netty-shaded</artifactId>
	    </dependency>
		<!-- Unit tests -->
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-api</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.platform</groupId>
			<artifactId>junit-platform-runner</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>
		<plugins>
		
			<plugin>
				<groupId>io.github.deweyjose</groupId>
				<artifactId>graphqlcodegen-maven-plugin</artifactId>
				<version>${graphql-codegen.version}</version>
				<executions>
					<execution>
						<goals>
							<goal>generate</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<packageName>com.datastax.stargate.graphql</packageName>
					<schemaPaths>
						<path>src/main/resources/graphql</path>
					</schemaPaths>
					<generateBoxedTypes>true</generateBoxedTypes>
					<generateClient>true</generateClient>
					<writeToFiles>true</writeToFiles>
				</configuration>
			</plugin>
			
			<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>target/generated-sources</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            
		
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>0.8.2</version>
				<executions>
					<execution>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
					</execution>
					<!-- attached to Maven test phase -->
					<execution>
						<id>report</id>
						<phase>test</phase>
						<goals>
							<goal>report</goal>
							 <goal>prepare-agent</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
