<?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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>com.github.switcherapi</groupId>
	<artifactId>switcher-client</artifactId>
	<packaging>jar</packaging>
	<version>1.3.7</version>

	<name>Switcher Client</name>
	<description>Switcher Client SDK for working with Switcher API</description>
	<url>https://github.com/switcherapi/switcher-client</url>

	<licenses>
		<license>
			<name>MIT License</name>
			<url>http://www.opensource.org/licenses/mit-license.php</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Roger Floriano</name>
			<email>switcher.project@gmail.com</email>
			<organization>switcherapi</organization>
			<organizationUrl>https://github.com/switcherapi</organizationUrl>
		</developer>
	</developers>

	<scm>
		<connection>scm:git:git://github.com:switcherapi/switcher-client.git</connection>
		<developerConnection>scm:git:ssh://github.com:switcherapi/switcher-client.git</developerConnection>
		<url>https://github.com/switcherapi/switcher-client</url>
	</scm>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<java.version>1.8</java.version>
		<maven.compiler.source>${java.version}</maven.compiler.source>
		<maven.compiler.target>${java.version}</maven.compiler.target>

		<!-- rest/json libs -->
		<jersey-client.version>2.36</jersey-client.version>
		<jersey-hk2.version>2.36</jersey-hk2.version>
		<jersey-media-json-jackson.version>2.36</jersey-media-json-jackson.version>
		<gson.version>2.9.0</gson.version>

		<!-- utils -->
		<commons-lang3.version>3.12.0</commons-lang3.version>
		<commons-net.version>3.8.0</commons-net.version>
		<log4j.version>2.17.2</log4j.version>

		<!-- test -->
		<okhttp.version>4.10.0</okhttp.version>
		<junit.version>5.8.2</junit.version>
		<junit-pioneer.version>1.7.1</junit-pioneer.version>

		<!-- Plugins -->
		<maven-compiler.version>3.8.1</maven-compiler.version>
		<maven-source.version>3.2.0</maven-source.version>
		<maven-surefire.version>3.0.0-M5</maven-surefire.version>
		<maven-gpg.version>3.0.1</maven-gpg.version>
		<sonar.version>3.7.0.1746</sonar.version>
		<jacoco.version>0.8.4</jacoco.version>

		<!-- Sonar -->
		<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
		<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
		<sonar.language>java</sonar.language>
		<sonar.coverage.exclusions>
	      **/model/**/*.java,
	      **/exception/**/*.java
	    </sonar.coverage.exclusions>
	</properties>

	<dependencies>
		<!-- rest/json libs -->
		<dependency>
			<groupId>org.glassfish.jersey.core</groupId>
			<artifactId>jersey-client</artifactId>
			<version>${jersey-client.version}</version>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.inject</groupId>
			<artifactId>jersey-hk2</artifactId>
			<version>${jersey-hk2.version}</version>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.media</groupId>
			<artifactId>jersey-media-json-jackson</artifactId>
			<version>${jersey-media-json-jackson.version}</version>
		</dependency>
		
		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
			<version>${gson.version}</version>
		</dependency>

		<!-- utils -->
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>${commons-lang3.version}</version>
		</dependency>
		<dependency>
			<groupId>commons-net</groupId>
			<artifactId>commons-net</artifactId>
			<version>${commons-net.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-core</artifactId>
			<version>${log4j.version}</version>
		</dependency>

		<!-- test -->
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-params</artifactId>
			<version>${junit.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-api</artifactId>
			<version>${junit.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.squareup.okhttp3</groupId>
			<artifactId>okhttp</artifactId>
			<version>${okhttp.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.squareup.okhttp3</groupId>
			<artifactId>mockwebserver</artifactId>
			<version>${okhttp.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit-pioneer</groupId>
			<artifactId>junit-pioneer</artifactId>
			<version>${junit-pioneer.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>junit</groupId>
				<artifactId>junit</artifactId>
				<version>4.13.1</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<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>

	<profiles>
		<profile>
			<id>coverage</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>jacoco-initialize</id>
								<goals>
									<goal>prepare-agent</goal>
								</goals>
							</execution>
							<execution>
								<id>jacoco-site</id>
								<phase>package</phase>
								<goals>
									<goal>report</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>sonar</id>
			<properties>
				<sonar.host.url>https://sonarcloud.io</sonar.host.url>
				<sonar.organization>switcherapi</sonar.organization>
				<sonar.projectKey>switcherapi_switcher-client</sonar.projectKey>
				<sonar.moduleKey>${project.groupId}:${project.artifactId}</sonar.moduleKey>
			</properties>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.sonarsource.scanner.maven</groupId>
						<artifactId>sonar-maven-plugin</artifactId>
						<version>${sonar.version}</version>
						<executions>
							<execution>
								<phase>verify</phase>
								<goals>
									<goal>sonar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>sign</id>
			<build>
				<plugins>
					<!-- Generate and sign all artifacts -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>${maven-source.version}</version>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>${maven-source.version}</version>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>${maven-gpg.version}</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>${maven-compiler.version}</version>
				</plugin>
				<plugin>
					<groupId>org.sonarsource.scanner.maven</groupId>
					<artifactId>sonar-maven-plugin</artifactId>
					<version>${sonar.version}</version>
				</plugin>
				<plugin>
					<groupId>org.jacoco</groupId>
					<artifactId>jacoco-maven-plugin</artifactId>
					<version>${jacoco.version}</version>
				</plugin>
			</plugins>
		</pluginManagement>

		<finalName>switcher-client</finalName>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
		</resources>

		<plugins>
			<!-- Set up Maven to run with JUnit5 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>${maven-surefire.version}</version>
			</plugin>

			<!-- Exclude log4j2 properties -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>${maven-source.version}</version>
				<configuration>
					<excludes>
						<exclude>**/log4j2.properties</exclude>
					</excludes>
				</configuration>
			</plugin>
		</plugins>
	</build>

</project>