<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.github.alex079</groupId>
	<artifactId>graphql-classes-maven-plugin</artifactId>
	<version>2.1.1</version>
	<packaging>maven-plugin</packaging>

	<name>GraphQL client-side java classes generator</name>
	<description>Maven plugin to generate GraphQL client-side java classes</description>
	<url>https://github.com/Alex079/graphql-classes-maven-plugin</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<maven.compiler.release>8</maven.compiler.release>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.apache.maven.plugin-tools</groupId>
			<artifactId>maven-plugin-annotations</artifactId>
			<version>3.7.1</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.maven.shared</groupId>
			<artifactId>file-management</artifactId>
			<version>3.1.0</version>
		</dependency>
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<version>1.18.26</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.maven.plugin-tools</groupId>
			<artifactId>maven-plugin-tools-api</artifactId>
			<version>3.7.1</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.graphql-java</groupId>
			<artifactId>graphql-java</artifactId>
			<version>20.0</version>
		</dependency>
		<dependency>
			<groupId>com.graphql-java-kickstart</groupId>
			<artifactId>graphql-java-tools</artifactId>
			<version>13.0.2</version>
		</dependency>
		<dependency>
			<groupId>org.freemarker</groupId>
			<artifactId>freemarker</artifactId>
			<version>2.3.32</version>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter</artifactId>
			<version>5.9.2</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.assertj</groupId>
			<artifactId>assertj-core</artifactId>
			<version>3.24.2</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-junit-jupiter</artifactId>
			<version>4.11.0</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.0.0-M9</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-plugin-plugin</artifactId>
				<version>3.7.1</version>
				<configuration>
					<goalPrefix>graphql-classes</goalPrefix>
					<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
				</configuration>
				<executions>
					<execution>
						<id>generate-help</id>
						<goals>
							<goal>helpmojo</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-invoker-plugin</artifactId>
				<version>3.4.0</version>
				<configuration>
					<debug>false</debug>
					<projectsDirectory>src/integration-test</projectsDirectory>
					<cloneProjectsTo>${project.build.directory}/integration-test</cloneProjectsTo>
					<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
					<settingsFile>src/integration-test/settings.xml</settingsFile>
					<showErrors>true</showErrors>
					<goals>
						<goal>clean</goal>
						<goal>verify</goal>
					</goals>
				</configuration>
				<executions>
					<execution>
						<id>integration-test-generate-with-pom</id>
						<phase>integration-test</phase>
						<goals>
							<goal>install</goal>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>exec-maven-plugin</artifactId>
				<version>3.1.0</version>
				<executions>
					<execution>
						<id>integration-test-generate-without-pom</id>
						<phase>integration-test</phase>
						<goals>
							<goal>exec</goal>
						</goals>
						<configuration>
							<executable>mvn</executable>
							<arguments>
								<argument>${project.groupId}:${project.artifactId}:${project.version}:generate</argument>
								<argument>-Dgql.sourceDirectory=../simple/GraphQL</argument>
								<argument>-Dgql.sourceIncludes=*.graphql,*.graphqls,,,</argument>
								<argument>-Dgql.outputDirectory=output</argument>
								<argument>-Dgql.scalarMap=S1=String,S2=Integer,,,Scalar1=Integer,DateTime=java.time.OffsetDateTime</argument>
								<argument>-Dgql.generatedOutputTypes=DEFINED_OPERATIONS</argument>
								<argument>-e</argument>
								<argument>-Dmaven.repo.local=${project.build.directory}/local-repo</argument>
							</arguments>
							<workingDirectory>${project.build.directory}/integration-test/cmd</workingDirectory>
							<outputFile>${project.build.directory}/integration-test/cmd/generate.log</outputFile>
						</configuration>
					</execution>
					<execution>
						<id>integration-test-compile-without-pom</id>
						<phase>integration-test</phase>
						<goals>
							<goal>exec</goal>
						</goals>
						<configuration>
							<executable>sh</executable>
							<arguments>
								<argument>-c</argument>
								<argument>mkdir ../output-classes ; javac -d ../output-classes gql/generated/*/*.java</argument>
							</arguments>
							<workingDirectory>${project.build.directory}/integration-test/cmd/output</workingDirectory>
							<outputFile>${project.build.directory}/integration-test/cmd/compile.log</outputFile>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.sonatype.plugins</groupId>
				<artifactId>nexus-staging-maven-plugin</artifactId>
				<version>1.6.13</version>
				<extensions>true</extensions>
				<configuration>
					<serverId>OSSRH</serverId>
					<nexusUrl>https://oss.sonatype.org/</nexusUrl>
					<autoReleaseAfterClose>true</autoReleaseAfterClose>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>release-artifacts</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>3.2.1</version>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>3.4.1</version>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>3.0.1</version>
						<configuration>
							<useAgent>true</useAgent>
							<executable>gpg2</executable>
						</configuration>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<licenses>
		<license>
			<name>MIT License</name>
			<url>https://github.com/Alex079/graphql-classes-maven-plugin/blob/master/LICENSE</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<distributionManagement>
		<snapshotRepository>
			<id>OSSRH</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>OSSRH</id>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
		</repository>
	</distributionManagement>

	<scm>
		<connection>scm:git:https://github.com/Alex079/graphql-classes-maven-plugin.git</connection>
		<url>https://github.com/Alex079/graphql-classes-maven-plugin</url>
		<tag>v2.1.1</tag>
	</scm>

	<developers>
		<developer>
			<name>Alexander</name>
			<id>Alex079</id>
		</developer>
	</developers>

</project>
