<!--
  ~ Copyright 2014-2023 JKOOL, LLC.
  ~
  ~ 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>com.jkoolcloud</groupId>
    <artifactId>jesl</artifactId>
    <version>1.2.2</version>
    <packaging>jar</packaging>

    <name>jesl</name>
    <url>https://github.com/Nastel/JESL</url>
    <description>jKool Event Streaming Library</description>
    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    <organization>
        <name>${project.organization.name}</name>
        <url>${project.organization.url}</url>
    </organization>
    <developers>
        <developer>
            <name>jKool Team</name>
            <email>support@jkoolcloud.com</email>
            <organization>jKool</organization>
            <organizationUrl>${project.organization.url}</organizationUrl>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:git://github.com/Nastel/JESL</connection>
        <developerConnection>scm:git:git//github.com/Nastel/JESL</developerConnection>
        <url>https://github.com/Nastel/JESL</url>
    </scm>
    <distributionManagement>
        <repository>
            <id>oss.sonatype.org</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>oss.sonatype.org</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <properties>
        <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <project.resources.encoding>UTF-8</project.resources.encoding>
        <project.organization.name>jKool, LLC</project.organization.name>
        <project.organization.url>https://www.meshiq.com/</project.organization.url>
        <product.vendor>${project.organization.name}</product.vendor>

        <project.java.version>11</project.java.version>
        <maven.compiler.source>${project.java.version}</maven.compiler.source>
        <maven.compiler.target>${project.java.version}</maven.compiler.target>
        <maven.compiler.release>${project.java.version}</maven.compiler.release>
        <maven.compiler.debuglevel>source,lines,vars</maven.compiler.debuglevel>
        <maven.compiler.verbose>false</maven.compiler.verbose>
        <maven.compiler.fork>false</maven.compiler.fork>

        <release.deploy.name>${project.artifactId}</release.deploy.name>
        <release.deploy.dir>build/</release.deploy.dir>
        <release.deploy.finalName>${release.deploy.name}-${project.version}</release.deploy.finalName>
        <release.deploy.zip.assembly>src/assembly/zipDeployAssembly.xml</release.deploy.zip.assembly>
        <release.deploy.gz.assembly>src/assembly/gzDeployAssembly.xml</release.deploy.gz.assembly>
        <release.deploy.dir.assembly>src/assembly/dirDeployAssembly.xml</release.deploy.dir.assembly>

        <assembly.line.endings>unix</assembly.line.endings>

        <maven.source.skip>true</maven.source.skip>
        <maven.javadoc.skip>true</maven.javadoc.skip>
        <assembly.skipAssembly>true</assembly.skipAssembly>
        <gpg.skip>true</gpg.skip>

        <build.assemblies.attach>false</build.assemblies.attach>

        <tnt4j.version>3.1.2</tnt4j.version>
        <httpcomponents.version>5.3.1</httpcomponents.version>
        <slf4j.version>2.0.13</slf4j.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.jkoolcloud</groupId>
            <artifactId>tnt4j-core</artifactId>
            <version>${tnt4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents.client5</groupId>
            <artifactId>httpclient5</artifactId>
            <version>${httpcomponents.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>slf4j-api</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- optional dependencies for sim module -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${slf4j.version}</version>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>

        <!-- Optional runtime dependencies -->
        <!-- Uncomment if Kafka sink needed -->
        <!--dependency>
            <groupId>com.jkoolcloud</groupId>
            <artifactId>tnt4j-kafka-sink</artifactId>
            <version>${tnt4j.version}</version>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency-->
        <!-- Uncomment if MQTT sink needed -->
        <!--dependency>
            <groupId>com.jkoolcloud</groupId>
            <artifactId>tnt4j-mqtt-sink</artifactId>
            <version>${tnt4j.version}</version>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency-->
    </dependencies>

    <profiles>
        <profile>
            <id>win-ln</id>
            <activation>
                <os>
                    <family>windows</family>
                </os>
            </activation>
            <properties>
                <assembly.line.endings>crlf</assembly.line.endings>
            </properties>
        </profile>

        <profile>
            <id>pack-bin</id>
            <properties>
                <assembly.skipAssembly>false</assembly.skipAssembly>
            </properties>
        </profile>
        <profile>
            <id>pack-all</id>
            <properties>
                <maven.source.skip>false</maven.source.skip>
                <maven.javadoc.skip>false</maven.javadoc.skip>
                <assembly.skipAssembly>false</assembly.skipAssembly>
            </properties>
        </profile>
        <profile>
            <id>pack-maven</id>
            <properties>
                <maven.source.skip>false</maven.source.skip>
                <maven.javadoc.skip>false</maven.javadoc.skip>
            </properties>
        </profile>
        <profile>
            <id>maven-release</id>
            <properties>
                <maven.source.skip>false</maven.source.skip>
                <maven.javadoc.skip>false</maven.javadoc.skip>
                <gpg.skip>false</gpg.skip>
            </properties>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>oss.sonatype.org-snapshot</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <build>
        <defaultGoal>clean install</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
                    <verbose>${maven.compiler.verbose}</verbose>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                    <debuglevel>${maven.compiler.debuglevel}</debuglevel>
                    <fork>${maven.compiler.fork}</fork>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.3.1</version>
                <configuration>
                    <encoding>${project.resources.encoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.1</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>3.6.3</version>
                <configuration>
                    <failOnError>false</failOnError>
                    <doclint>all</doclint>
                </configuration>
                <executions>
                    <execution>
                        <id>build-javadocs-module</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.3.2</version>
                <executions>
                    <execution>
                        <id>clean-build</id>
                        <phase>package</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                        <configuration>
                            <excludeDefaultDirectories>true</excludeDefaultDirectories>
                            <skip>${assembly.skipAssembly}</skip>
                            <filesets>
                                <fileset>
                                    <directory>${release.deploy.dir}</directory>
                                    <includes>
                                        <include>${release.deploy.finalName}/</include>
                                        <include>${release.deploy.finalName}.*</include>
                                    </includes>
                                </fileset>
                            </filesets>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.4.1</version>
                <executions>
                    <execution>
                        <id>dependency-convergence</id>
                        <phase>package</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <dependencyConvergence/>
                                <banDuplicatePomDependencyVersions/>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.7.1</version>
                <executions>
                    <execution>
                        <id>deploy-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <appendAssemblyId>false</appendAssemblyId>
                            <descriptors>
                                <!--<descriptor>${release.deploy.dir.assembly}</descriptor>-->
                                <descriptor>${release.deploy.zip.assembly}</descriptor>
                                <descriptor>${release.deploy.gz.assembly}</descriptor>
                            </descriptors>
                            <attach>${build.assemblies.attach}</attach>
                            <outputDirectory>${release.deploy.dir}</outputDirectory>
                            <finalName>${release.deploy.finalName}</finalName>
                            <tarLongFileMode>gnu</tarLongFileMode>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.4.1</version>
                <configuration>
                    <archive>
                        <!--<index>true</index>-->
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                        <manifest>
                            <addClasspath>true</addClasspath>
                        </manifest>
                        <manifestEntries>
                            <Implementation-Vendor>${product.vendor}</Implementation-Vendor>
                            <Implementation-Title>${project.name}</Implementation-Title>
                            <Implementation-Version>${project.version}-${maven.build.timestamp}</Implementation-Version>
                            <X-Compile-Source-JDK>${maven.compiler.source}</X-Compile-Source-JDK>
                            <X-Compile-Target-JDK>${maven.compiler.target}</X-Compile-Target-JDK>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>5.1.9</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Export-Package>com.jkoolcloud.jesl.*</Export-Package>
                    </instructions>
                </configuration>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.2.4</version>
                <configuration>
                    <gpgArguments>
                        <arg>--pinentry-mode</arg>
                        <arg>loopback</arg>
                    </gpgArguments>
                    <keyname>${gpg.keyname}</keyname>
                    <passphraseEnvName>MAVEN_GPG_PASSPHRASE</passphraseEnvName>
                    <bestPractices>true</bestPractices>
                </configuration>
                <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-deploy-plugin</artifactId>
                <version>3.1.2</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.13</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>oss.sonatype.org</serverId>
                    <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
                <executions>
                    <execution>
                        <id>deploy-to-sonatype</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.16.2</version>
                <configuration>
                    <generateBackupPoms>false</generateBackupPoms>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>