<?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>2.2</version>
	</parent>

	<artifactId>graphql-maven-plugin-logic</artifactId>

	<name>graphql-maven-plugin-logic</name>


	<build>
		<resources>
			<resource>
				<!-- Due to Spring Boot, the filtering placeholder is @..@ (instead of ${..}) -->
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
		</resources>
		<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-common-runtime</artifactId>
									<type>jar</type>
									<classifier>sources</classifier>
									<overWrite>true</overWrite>
									<destFileName>graphql-java-common-runtime-sources.jar</destFileName>
									<outputDirectory>${project.build.directory}/generated-resources/runtime_sources/</outputDirectory>
								</artifactItem>
								<artifactItem>
									<groupId>${project.groupId}</groupId>
									<artifactId>graphql-java-client-runtime</artifactId>
									<type>jar</type>
									<classifier>sources</classifier>
									<overWrite>true</overWrite>
									<destFileName>graphql-java-client-runtime-sources.jar</destFileName>
									<outputDirectory>${project.build.directory}/generated-resources/runtime_sources/</outputDirectory>
								</artifactItem>
								<artifactItem>
									<groupId>${project.groupId}</groupId>
									<artifactId>graphql-java-server-runtime</artifactId>
									<type>jar</type>
									<classifier>sources</classifier>
									<overWrite>true</overWrite>
									<destFileName>graphql-java-server-runtime-sources.jar</destFileName>
									<outputDirectory>${project.build.directory}/generated-resources/runtime_sources/</outputDirectory>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>add-resource</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>add-resource</goal>
						</goals>
						<configuration>
							<resources>
								<resource>
									<directory>${project.build.directory}/generated-resources/runtime_sources</directory>
								</resource>
							</resources>
						</configuration>
					</execution>
					<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_graphql/AllGraphQLCases_Client_SpringConfiguration/generated-src</source>
								<source>${project.build.directory}/junittest_graphql/AllGraphQLCases_ClientPojo_SpringConfiguration/generated-src</source>
								<source>${project.build.directory}/junittest_graphql/AllGraphQLCases_Client_SpringConfiguration_addRelayConnections/generated-src</source>
								<source>${project.build.directory}/junittest_graphql/AllGraphQLCases_Client_SpringConfiguration_separateUtilityClasses/generated-src</source>
								<source>${project.build.directory}/junittest_graphql/AllGraphQLCases_Server_SpringConfiguration/generated-src</source>
								<source>${project.build.directory}/junittest_graphql/AllGraphQLCases_ServerPojo_SpringConfiguration/generated-src</source>
								<source>${project.build.directory}/junittest_graphql/AllGraphQLCases_Server_SpringConfiguration_separateUtilityClasses/generated-src</source>
								<source>${project.build.directory}/junittest_graphql/CodeGeneratorTest/generated-src</source>
								<source>${project.build.directory}/junittest_graphql/CustomTemplates_Client_SpringConfiguration/generated-src</source>
								<source>${project.build.directory}/junittest_graphql/CustomTemplates_Server_SpringConfiguration/generated-src</source>
								<source>${project.build.directory}/junittest_graphql/Forum_Client_SpringConfiguration/generated-src</source>
								<source>${project.build.directory}/junittest_graphql/Forum_Server_SpringConfiguration/generated-src</source>
								<source>${project.build.directory}/junittest_graphql/StarWars_Client_SpringConfiguration/generated-src</source>
								<source>${project.build.directory}/junittest_graphql/StarWars_Server_SpringConfiguration/generated-src</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<dependencies>
		<dependency>
			<groupId>com.graphql-java-generator</groupId>
			<artifactId>graphql-java-common-runtime</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
		</dependency>

		<!-- Internal dependencies (for test only) -->
		<dependency>
			<groupId>com.graphql-java-generator</groupId>
			<artifactId>graphql-java-client-runtime</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.graphql-java-generator</groupId>
			<artifactId>graphql-java-server-runtime</artifactId>
			<scope>test</scope>
		</dependency>

		<!-- Dependencies for tests -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>javax.persistence</groupId>
			<artifactId>javax.persistence-api</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>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
		</dependency>
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.sonatype.plexus</groupId>
			<artifactId>plexus-build-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.velocity</groupId>
			<artifactId>velocity-engine-core</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-no-fork</report>
							<report>test-javadoc-no-fork</report>
						</reports>
					</reportSet>
				</reportSets>
				<configuration>
					<source>8</source>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-site-plugin</artifactId>
			</plugin>
		</plugins>
	</reporting>

</project>