<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.ingenico.connect.gateway</groupId>
	<artifactId>connect-sdk-java</artifactId>
	<version>6.27.0</version>
	<packaging>jar</packaging>

	<name>connect-sdk-java</name>
	<description>SDK to communicate with the Ingenico ePayments platform using the Ingenico Connect Server API</description>
	<url>https://github.com/Ingenico-ePayments/connect-sdk-java</url>

	<organization>
		<name>Ingenico ePayments</name>
		<url>https://www.ingenico.com/epayments/</url>
	</organization>

	<licenses>
		<license>
			<name>MIT</name>
			<url>https://github.com/Ingenico-ePayments/connect-sdk-java/blob/master/LICENSE.txt</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Ingenico ePayments</name>
			<email>github@epay.ingenico.com</email>
			<organization>Ingenico ePayments</organization>
			<organizationUrl>https://www.ingenico.com/epayments/</organizationUrl>
		</developer>
	</developers>

	<scm>
		<connection>scm:git:git@github.com:Ingenico-ePayments/connect-sdk-java.git</connection>
		<developerConnection>scm:git:git@github.com:Ingenico-ePayments/connect-sdk-java.git</developerConnection>
		<url>https://github.com/Ingenico-ePayments/connect-sdk-java</url>
	</scm>

	<issueManagement>
		<system>GitHub</system>
		<url>https://github.com/Ingenico-ePayments/connect-sdk-java/issues</url>
	</issueManagement>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

		<maven.compiler.source>1.6</maven.compiler.source>
		<maven.compiler.target>1.6</maven.compiler.target>

		<version.httpclient>4.5.13</version.httpclient>
		<version.httpmime>4.5.13</version.httpmime>
	</properties>

	<build>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
			</resource>
			<resource>
				<!-- add LICENSE.txt to META-INF -->
				<directory>${basedir}</directory>
				<filtering>false</filtering>
				<targetPath>META-INF</targetPath>
				<includes>
					<include>LICENSE.txt</include>
				</includes>
			</resource>
		</resources>

		<pluginManagement>
			<plugins>
				<!-- this plugin is required to make Eclipse lifecycle errors disappear -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.apache.maven.plugins</groupId>
										<artifactId>maven-antrun-plugin</artifactId>
										<versionRange>[1.0,)</versionRange>
										<goals>
											<goal>run</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.5.1</version>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.6</version>
				<configuration>
					<archive>
						<manifestEntries>
							<Specification-Title>${project.name}</Specification-Title>
							<Specification-Version>${project.version}</Specification-Version>
							<Specification-Vendor>GlobalCollect</Specification-Vendor>
							<Implementation-Title>${project.name}</Implementation-Title>
							<Implementation-Version>${project.version}</Implementation-Version>
							<Implementation-Vendor>GlobalCollect</Implementation-Vendor>

							<!-- override default Built-By -->
							<Built-By>Ingenico ePayments</Built-By>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>2.4</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<phase>package</phase>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<archive>
						<manifestEntries>
							<Specification-Title>${project.name}</Specification-Title>
							<Specification-Version>${project.version}</Specification-Version>
							<Specification-Vendor>GlobalCollect</Specification-Vendor>
							<Implementation-Title>${project.name}</Implementation-Title>
							<Implementation-Version>${project.version}</Implementation-Version>
							<Implementation-Vendor>GlobalCollect</Implementation-Vendor>

							<!-- override default Built-By -->
							<Built-By>Ingenico ePayments</Built-By>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.10.3</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<phase>package</phase>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<docencoding>UTF-8</docencoding>
					<splitindex>true</splitindex>
					<links>
						<!-- Use an HTTPS URL to the JSE docs -->
						<link>https://docs.oracle.com/javase/7/docs/api/</link>
					</links>
					<archive>
						<manifestEntries>
							<Specification-Title>${project.name}</Specification-Title>
							<Specification-Version>${project.version}</Specification-Version>
							<Specification-Vendor>GlobalCollect</Specification-Vendor>
							<Implementation-Title>${project.name}</Implementation-Title>
							<Implementation-Version>${project.version}</Implementation-Version>
							<Implementation-Vendor>GlobalCollect</Implementation-Vendor>

							<!-- override default Built-By -->
							<Built-By>Ingenico ePayments</Built-By>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.8</version>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<target>
								<copy todir="${project.build.directory}/apidocs/META-INF">
									<fileset dir="${basedir}">
										<include name="LICENSE.txt" />
									</fileset>
								</copy>
							</target>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.6</version>
				<executions>
					<execution>
						<id>create-assemblies</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<descriptors>
						<descriptor>src/main/assembly/src.xml</descriptor>
						<descriptor>src/main/assembly/bin.xml</descriptor>
					</descriptors>
					<attach>false</attach>
				</configuration>
			</plugin>

			<!-- Add the generated sources to the source directories. -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.10</version>
				<executions>
					<execution>
						<id>add-source</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>${basedir}/src/main/generated</source>
							</sources>
						</configuration>
					</execution>
					<execution>
						<id>add-test-source</id>
						<phase>generate-test-sources</phase>
						<goals>
							<goal>add-test-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>${basedir}/src/examples/java</source>
								<source>${basedir}/src/it/java</source>
							</sources>
						</configuration>
					</execution>
					<execution>
						<id>add-test-resource</id>
						<phase>generate-test-sources</phase>
						<goals>
							<goal>add-test-resource</goal>
						</goals>
						<configuration>
							<resources>
								<resource>
									<directory>src/examples/resources</directory>
								</resource>
								<resource>
									<directory>src/it/resources</directory>
								</resource>
							</resources>
						</configuration>
					</execution> 
				</executions>
			</plugin>

			<!-- Skip IT tests during normal maven build. -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.19.1</version>
				<configuration>
					<excludes>
						<exclude>/com/ingenico/connect/gateway/sdk/it/**/*</exclude>
					</excludes>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<dependencies>
		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
			<version>2.8.6</version>
		</dependency>

		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>${version.httpclient}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpmime</artifactId>
			<version>${version.httpmime}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<classifier>tests</classifier>
			<version>${version.httpclient}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.13.1</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-library</artifactId>
			<version>1.3</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-all</artifactId>
			<version>1.10.19</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<profiles>
		<profile>
			<id>release</id>

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

			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>1.6</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
								<configuration>
									<gpgArguments>
										<arg>--pinentry-mode</arg>
										<arg>loopback</arg>
									</gpgArguments>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>1.6.7</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>integration</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<excludes>
								<exclude>none</exclude>
							</excludes>
							<includes>
								<include>/com/ingenico/connect/gateway/sdk/it/**/*</include>
							</includes>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
