<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>de.energiequant.common</groupId>
    <artifactId>webdataretrieval</artifactId>
    <name>Web Data Retrieval</name>
    <description>helper library for common web-based data retrieval tasks</description>
    <version>0.2.6</version>
    <packaging>jar</packaging>

    <url>https://github.com/dneuge/web-data-retrieval</url>

    <licenses>
        <license>
            <name>MIT</name>
            <url>https://opensource.org/licenses/MIT</url>
        </license>
    </licenses>

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

        <!-- runtime dependencies -->
        <commons.io.version>[2.12,2.19.999]</commons.io.version>
        <commons.compress.version>[1.22,1.27.999]</commons.compress.version>
        <slf4j.version>[1.7.25,1.7.999]</slf4j.version>
        <httpcomponents.version>[5.0.4,5.4.999]</httpcomponents.version>

        <!-- test dependencies -->
        <hamcrest.junit.version>2.0.0.0</hamcrest.junit.version>
        <junit.version>4.13.1</junit.version>
        <junitdataprovider.version>1.13.1</junitdataprovider.version>
        <mockito.version>3.12.4</mockito.version>
        <slf4jtest.version>1.2.0</slf4jtest.version>
        <jacoco.version>0.8.11</jacoco.version>

        <!-- build dependencies -->
        <maven.plugin.compiler.version>3.14.0</maven.plugin.compiler.version>
        <maven.plugin.dependency.version>3.6.1</maven.plugin.dependency.version>
        <maven.plugin.gpg.version>3.2.7</maven.plugin.gpg.version>
        <maven.plugin.jar.version>3.4.2</maven.plugin.jar.version>
        <maven.plugin.javadoc.version>3.2.0</maven.plugin.javadoc.version>
        <maven.plugin.source.version>3.2.0</maven.plugin.source.version>
        <maven.plugin.surefire.version>3.2.5</maven.plugin.surefire.version>
        <sonatype.plugin.centralPublishing.version>0.7.0</sonatype.plugin.centralPublishing.version>
    </properties>

    <scm>
        <connection>scm:git:git://github.com/dneuge/web-data-retrieval.git</connection>
        <developerConnection>scm:git:ssh://github.com:dneuge/web-data-retrieval.git</developerConnection>
        <url>https://github.com/dneuge/web-data-retrieval</url>
    </scm>

    <developers>
        <developer>
            <name>Daniel Neugebauer</name>
            <email>dneuge@energiequant.de</email>
            <url>http://www.energiequant.de/</url>
        </developer>
    </developers>

    <dependencies>
        <!-- runtime dependencies -->
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons.io.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-compress</artifactId>
            <version>${commons.compress.version}</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>

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


        <!-- test dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-junit</artifactId>
            <version>${hamcrest.junit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>uk.org.lidalia</groupId>
            <artifactId>slf4j-test</artifactId>
            <version>${slf4jtest.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.tngtech.java</groupId>
            <artifactId>junit-dataprovider</artifactId>
            <version>${junitdataprovider.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>${maven.plugin.dependency.version}</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven.plugin.jar.version}</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Built-By></Built-By>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.plugin.surefire.version}</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven.plugin.source.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <excludes>
                        <exclude>**/ManualTest*</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven.plugin.javadoc.version}</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <sourceFileExcludes>
                        <sourceFileExcludes>**/ManualTest*</sourceFileExcludes>
                    </sourceFileExcludes>
                    <!-- detectOfflineLinks needs to be disabled or artifacts will link to invalid URLs derived from project.url -->
                    <detectOfflineLinks>false</detectOfflineLinks>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.eluder.coveralls</groupId>
                <artifactId>coveralls-maven-plugin</artifactId>
                <version>4.3.0</version>
                <configuration>
                    <branch>${env.coveralls_branch}</branch>
                    <repoToken>${env.coveralls_token}</repoToken>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <reportSets>
                    <reportSet>
                        <reports>
                            <!-- select non-aggregate reports -->
                            <report>report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>


    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>${maven.plugin.compiler.version}</version>
                        <configuration>
                            <excludes>
                                <exclude>**/ManualTest*</exclude>
                            </excludes>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven.plugin.gpg.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <keyname>${gpg.keyname}</keyname>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>${sonatype.plugin.centralPublishing.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
