<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2021 The Netty Project
  ~
  ~ The Netty Project licenses this file to you 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:
  ~
  ~   https://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 https://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
    </parent>

    <groupId>io.netty.contrib</groupId>
    <artifactId>netty-codec-extras-parent</artifactId>
    <version>5.0.0.Alpha2</version>
    <name>Netty/Codec/Extras Parent</name>
    <packaging>pom</packaging>
    <url>https://netty.io/</url>
    <description>
        Netty is an asynchronous event-driven network application framework for
        rapid development of maintainable high performance protocol servers and
        clients.
    </description>

    <organization>
        <name>The Netty Project</name>
        <url>https://netty.io/</url>
    </organization>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>
    <inceptionYear>2021</inceptionYear>

    <scm>
        <url>https://github.com/netty-contrib/codec-extras</url>
        <connection>scm:git:https://github.com/netty-contrib/codec-extras.git</connection>
        <developerConnection>scm:git:https://github.com/netty-contrib/codec-extras.git</developerConnection>
        <tag>netty-codec-extras-parent-5.0.0.Alpha2</tag>
    </scm>

    <developers>
        <developer>
            <id>netty.io</id>
            <name>The Netty Project Contributors</name>
            <email>netty@googlegroups.com</email>
            <url>https://netty.io/</url>
            <organization>The Netty Project</organization>
            <organizationUrl>https://netty.io/</organizationUrl>
        </developer>
    </developers>

    <properties>
        <netty.version>5.0.0.Alpha5</netty.version>
        <netty.build.version>29</netty.build.version>
        <project.scm.id>github</project.scm.id>
        <release.gpg.keyname />
        <release.gpg.passphrase />
        <test.argLine>-D_</test.argLine>
    </properties>

    <modules>
        <module>codec-extras</module>
        <module>examples</module>
    </modules>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <release>11</release>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>check-style</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>validate</phase>
                        <configuration>
                            <consoleOutput>true</consoleOutput>
                            <logViolationsToConsole>true</logViolationsToConsole>
                            <failsOnError>true</failsOnError>
                            <failOnViolation>true</failOnViolation>
                            <configLocation>io/netty/checkstyle.xml</configLocation>
                            <sourceDirectories>
                                <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
                                <sourceDirectory>${project.build.testSourceDirectory}</sourceDirectory>
                            </sourceDirectories>
                        </configuration>
                        <inherited>false</inherited>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>8.29</version>
                    </dependency>
                    <dependency>
                        <groupId>io.netty</groupId>
                        <artifactId>netty-build-common</artifactId>
                        <version>${netty.build.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M5</version>
                <configuration>
                    <!-- Ensure the whole stacktrace is preserved when an exception is thrown. See https://issues.apache.org/jira/browse/SUREFIRE-1457 -->
                    <trimStackTrace>false</trimStackTrace>
                    <argLine>${test.argLine}</argLine>
                </configuration>
            </plugin>

            <!-- always produce osgi bundles -->
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>5.1.1</version>
                <executions>
                    <execution>
                        <id>generate-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                        <configuration>
                            <supportedProjectTypes>
                                <supportedProjectType>jar</supportedProjectType>
                                <supportedProjectType>bundle</supportedProjectType>
                            </supportedProjectTypes>
                            <instructions>
                                <Export-Package>${project.groupId}.*</Export-Package>
                                <!-- enforce JVM vendor package as optional -->
                                <Import-Package>
                                    sun.misc.*;resolution:=optional,sun.nio.ch;resolution:=optional,sun.security.*;resolution:=optional,org.eclipse.jetty.npn;version="[1,2)";resolution:=optional,org.eclipse.jetty.alpn;version="[1,2)";resolution:=optional,*
                                </Import-Package>
                                <!-- override "internal" private package convention -->
                                <Private-Package>!*</Private-Package>
                            </instructions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.0</version>
                <!-- Eclipse-related OSGi manifests
                      See https://github.com/netty/netty/issues/3886
                      More information: https://rajakannappan.blogspot.ie/2010/03/automating-eclipse-source-bundle.html -->
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
                            <Bundle-Name>${project.name}</Bundle-Name>
                            <Bundle-SymbolicName>${project.groupId}.${project.artifactId}.source</Bundle-SymbolicName>
                            <Bundle-Vendor>${project.organization.name}</Bundle-Vendor>
                            <Bundle-Version>${parsedVersion.osgiVersion}</Bundle-Version>
                            <Eclipse-SourceBundle>
                                ${project.groupId}.${project.artifactId};version="${parsedVersion.osgiVersion}";roots:="."
                            </Eclipse-SourceBundle>
                        </manifestEntries>
                    </archive>
                </configuration>

                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>attach-test-sources</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>test-jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <detectOfflineLinks>false</detectOfflineLinks>
                    <breakiterator>true</breakiterator>
                    <version>false</version>
                    <author>false</author>
                    <keywords>true</keywords>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
                <configuration>
                    <retryFailedDeploymentCount>10</retryFailedDeploymentCount>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>sonatype-nexus</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <!-- Automatically release the artifacts after the verification was complete -->
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.0.0-M6</version>
                <configuration>
                    <useReleaseProfile>false</useReleaseProfile>
                    <arguments>-P sonatype-oss-release -DskipTests -Dgpg.keyname=${release.gpg.keyname} -Dgpg.passphrase=${release.gpg.passphrase}</arguments>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <allowTimestampedSnapshots>false</allowTimestampedSnapshots>
                    <localCheckout>true</localCheckout>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>leak</id>
            <properties>
                <test.argLine>-Dio.netty5.leakDetectionLevel=paranoid -Dio.netty5.leakDetection.targetRecords=32 -Dio.netty5.buffer.lifecycleTracingEnabled=true -Dio.netty5.buffer.leakDetectionEnabled=true
                </test.argLine>
            </properties>
        </profile>
    </profiles>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>5.8.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>3.21.0</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>

