<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2018-2018 Gryphon Zone
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->

<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>zone.gryphon</groupId>
    <artifactId>screech</artifactId>
    <version>0.1</version>
    <packaging>pom</packaging>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>Highly pluggable async HTTP abstraction library</description>
    <url>https://github.com/gryphon-zone/screech</url>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>galen</id>
            <name>Galen</name>
            <email>tyrol@gryphon.zone</email>
            <timezone>-6</timezone>
            <roles>
                <role>developer</role>
            </roles>
            <organizationUrl>https://github.com/gryphon-zone/</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:gryphon-zone/screech.git</connection>
        <developerConnection>scm:git:git@github.com:gryphon-zone/screech.git</developerConnection>
        <url>https://github.com/gryphon-zone/screech/tree/master</url>
        <tag>screech-0.1</tag>
    </scm>

    <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>

    <modules>
        <module>annotations</module>
        <module>asynchttpclient2</module>
        <module>bom</module>
        <module>build-bom</module>
        <module>core</module>
        <module>gson2</module>
        <module>integration</module>
        <module>jackson2</module>
        <module>jetty</module>
        <module>test-utilities</module>
    </modules>

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

        <pedantic.testOnlyDeps>
            org.junit:junit,org.assertj:assertj-core,org.mockito:mockito-all,ch.qos.logback:logback-classic,ch.qos.logback:logback-core
        </pedantic.testOnlyDeps>

        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.1.1</version>
                <executions>
                    <execution>
                        <id>analyze-dependencies</id>
                        <goals>
                            <goal>analyze-only</goal>
                        </goals>
                        <configuration>
                            <failOnWarning>true</failOnWarning>
                            <outputXML>true</outputXML>
                            <ignoredUnusedDeclaredDependencies>
                                <dependency>ch.qos.logback:logback-classic:jar:*</dependency>
                                <dependency>ch.qos.logback:logback-core:jar:*</dependency>
                                <dependency>org.projectlombok:lombok:jar:*</dependency>
                            </ignoredUnusedDeclaredDependencies>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0-M2</version>
                <executions>
                    <execution>
                        <id>require-upper-bound-deps</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireUpperBoundDeps />
                            </rules>
                        </configuration>
                    </execution>
                    <execution>
                        <id>pedantic-pom</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <!-- see the following for documentation about configuration of the enforcer -->
                                <!-- https://github.com/ferstl/pedantic-pom-enforcers/wiki/CompoundPedanticEnforcer -->
                                <compound implementation="com.github.ferstl.maven.pomenforcers.CompoundPedanticEnforcer">

                                    <!-- Enforcers -->
                                    <enforcers>
                                        POM_SECTION_ORDER,MODULE_ORDER,DEPENDENCY_MANAGEMENT_ORDER,DEPENDENCY_ORDER,DEPENDENCY_CONFIGURATION,DEPENDENCY_SCOPE
                                    </enforcers>

                                    <!-- POM_SECTION_ORDER configuration -->
                                    <pomSectionPriorities>
                                        modelVersion,parent,groupId,artifactId,version,packaging
                                    </pomSectionPriorities>

                                    <!-- DEPENDENCY_ORDER configuration -->
                                    <dependenciesOrderBy>scope,groupId,artifactId</dependenciesOrderBy>
                                    <dependenciesScopePriorities>
                                        import,compile,runtime,provided,test
                                    </dependenciesScopePriorities>
                                    <dependenciesGroupIdPriorities>${project.groupId}</dependenciesGroupIdPriorities>

                                    <!-- DEPENDENCY_MANAGEMENT_ORDER configuration -->
                                    <dependencyManagementOrderBy>scope,groupId,artifactId</dependencyManagementOrderBy>
                                    <dependencyManagementScopePriorities>
                                        import,compile,runtime,provided,test
                                    </dependencyManagementScopePriorities>
                                    <dependencyManagementGroupIdPriorities>
                                        ${project.groupId}
                                    </dependencyManagementGroupIdPriorities>

                                    <!-- DEPENDENCY_CONFIGURATION configuration -->
                                    <manageDependencyVersions>true</manageDependencyVersions>
                                    <allowUnmangedProjectVersions>false</allowUnmangedProjectVersions>
                                    <manageDependencyExclusions>true</manageDependencyExclusions>

                                    <!-- DEPENDENCY_SCOPE configuration -->
                                    <compileDependencies />
                                    <providedDependencies>org.projectlombok:lombok</providedDependencies>
                                    <runtimeDependencies />
                                    <systemDependencies />
                                    <testDependencies>${pedantic.testOnlyDeps}</testDependencies>
                                    <importDependencies />

                                    <!-- DEPENDENCY_MANAGEMENT_LOCATION configuration -->
                                    <allowParentPomsForDependencyManagement>
                                        true
                                    </allowParentPomsForDependencyManagement>
                                    <dependencyManagingPoms />

                                    <!-- PLUGIN_MANAGEMENT_ORDER configuration -->
                                    <pluginManagementOrderBy>groupId,artifactId</pluginManagementOrderBy>
                                    <pluginManagementGroupIdPriorities>
                                        ${project.groupId}
                                    </pluginManagementGroupIdPriorities>
                                    <pluginManagementArtifactIdPriorities />

                                    <!-- PLUGIN_CONFIGURATION configuration -->
                                    <managePluginVersions>false</managePluginVersions>
                                    <managePluginConfigurations>false</managePluginConfigurations>
                                    <managePluginDependencies>false</managePluginDependencies>

                                    <!-- PLUGIN_MANAGEMENT_LOCATION configuration -->
                                    <allowParentPomsForPluginManagement>true</allowParentPomsForPluginManagement>
                                    <pluginManagingPoms />

                                </compound>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.github.ferstl</groupId>
                        <artifactId>pedantic-pom-enforcers</artifactId>
                        <version>1.3.1</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-javadoc</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <quiet>true</quiet>
                            <failOnError>false</failOnError>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>