<?xml version="1.0"?>
<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>
	<parent>
		<groupId>com.graphql-java-generator</groupId>
		<artifactId>graphql-maven-plugin-project</artifactId>
		<version>1.9</version>
	</parent>

	<artifactId>graphql-maven-plugin-logic</artifactId>

	<name>graphql-maven-plugin-logic</name>


	<build>
		<plugins>
			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
			</plugin>
			<plugin>
				<!-- We'll read the sources from graphql-client, to add the sources to the generated code (thus: no external dependency 
					in the generated code) -->
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>graphql-java-client-sources</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>copy</goal>
						</goals>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>${project.groupId}</groupId>
									<artifactId>graphql-java-runtime</artifactId>
									<type>jar</type>
									<classifier>sources</classifier>
									<overWrite>true</overWrite>
									<destFileName>graphql-java-runtime-sources.jar</destFileName>
									<outputDirectory>${project.build.directory}/classes/</outputDirectory>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>add-test-source</id>
						<phase>generate-test-sources</phase>
						<goals>
							<goal>add-test-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>${project.build.directory}/junittest/AllGraphQLCases_Client_SpringConfiguration/generated-src</source>
								<source>${project.build.directory}/junittest/AllGraphQLCases_Client_SpringConfiguration_separateUtilityClasses/generated-src</source>
								<source>${project.build.directory}/junittest/AllGraphQLCases_Server_SpringConfiguration/generated-src</source>
								<source>${project.build.directory}/junittest/AllGraphQLCases_Server_SpringConfiguration_separateUtilityClasses/generated-src</source>
								<source>${project.build.directory}/junittest/CodeGeneratorTest/generated-src</source>
								<source>${project.build.directory}/junittest/CustomTemplates_Client_SpringConfiguration/generated-src</source>
								<source>${project.build.directory}/junittest/CustomTemplates_Server_SpringConfiguration/generated-src</source>
								<source>${project.build.directory}/junittest/Forum_Client_SpringConfiguration/generated-src</source>
								<source>${project.build.directory}/junittest/Forum_Server_SpringConfiguration/generated-src</source>
								<source>${project.build.directory}/junittest/StarWars_Client_SpringConfiguration/generated-src</source>
								<source>${project.build.directory}/junittest/StarWars_Server_SpringConfiguration/generated-src</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<dependencies>
		<!-- Internal dependencies -->
		<dependency>
			<groupId>com.graphql-java-generator</groupId>
			<artifactId>graphql-java-runtime</artifactId>
		</dependency>

		<!-- Dependencies for tests -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-api</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-junit-jupiter</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<!-- This dependency is necessary for tests only. But, in order to check in eclipse that the generated code compiles, 
				we need to add it to the compilation classpath -->
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jpa</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-websocket</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.javatuples</groupId>
			<artifactId>javatuples</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.graphql-java</groupId>
			<artifactId>graphql-java-extended-scalars</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
			<scope>test</scope>
		</dependency>

		<!-- Other dependencies -->
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-slf4j-impl</artifactId>
		</dependency>
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.persistence</groupId>
			<artifactId>javax.persistence-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.velocity</groupId>
			<artifactId>velocity</artifactId>
		</dependency>

		<!-- dependendencies for graphql -->
		<dependency>
			<groupId>com.graphql-java</groupId>
			<artifactId>graphql-java</artifactId>
		</dependency>

		<!-- dependendencies for json -->
		<dependency>
			<groupId>org.leadpony.justify</groupId>
			<artifactId>justify</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.johnzon</groupId>
			<artifactId>johnzon-core</artifactId>
		</dependency>
	</dependencies>

	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<reportSets>
					<reportSet>
						<id>non-aggregate</id>
						<reports>
							<report>javadoc</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
		</plugins>
	</reporting>
</project>