<?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>com.enos-iot</groupId>
    <artifactId>apim-poseidon</artifactId>
    <version>3.0.1</version>
    <description>
        apim client for enos
    </description>

    <name>apim-poseidon</name>
    <url>https://www.enos-iot.com/</url>

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

        <sonar.exclusions>
            src/main/java/com/enosiot/apim/poseidon/**
        </sonar.exclusions>
    </properties>


    <dependencies>
        <!--okhttp3-->
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
            <version>3.14.9</version>
        </dependency>

        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpkix-jdk15on</artifactId>
            <version>1.60</version>
            <scope>compile</scope>
            <optional>true</optional>
        </dependency>

        <!--fastjson-->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.83</version>
        </dependency>

        <dependency>
            <groupId>org.tinylog</groupId>
            <artifactId>tinylog</artifactId>
            <version>1.3.6</version>
            <scope>compile</scope>
            <optional>true</optional>
        </dependency>

        <!-- junit -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classifier>javadoc</classifier>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!--            <plugin>-->
            <!--                <groupId>org.apache.maven.plugins</groupId>-->
            <!--                <artifactId>maven-gpg-plugin</artifactId>-->
            <!--                <version>1.6</version>-->
            <!--                <executions>-->
            <!--                    <execution>-->
            <!--                        <id>sign-artifacts</id>-->
            <!--                        <goals>-->
            <!--                            <goal>sign</goal>-->
            <!--                        </goals>-->
            <!--                    </execution>-->
            <!--                </executions>-->
            <!--            </plugin>-->
            <plugin>
                <groupId>net.ju-n.maven.plugins</groupId>
                <artifactId>checksum-maven-plugin</artifactId>
                <version>1.3</version>
                <executions>
                    <execution>
                        <id>checksum-maven-plugin-files</id>
                        <phase>install</phase>
                        <goals>
                            <goal>files</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <fileSets>
                        <fileSet>
                            <directory>${project.build.directory}</directory>
                            <includes>
                                <include>*.jar</include>
                                <include>*.pom</include>
                            </includes>
                        </fileSet>
                    </fileSets>
                    <algorithms>
                        <algorithm>SHA-1</algorithm>
                        <algorithm>MD5</algorithm>
                    </algorithms>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.1</version>
                <configuration>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>META-INF/*.SF</exclude>
                                <exclude>META-INF/*.DSA</exclude>
                                <exclude>META-INF/*.RSA</exclude>
                            </excludes>
                        </filter>
                    </filters>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <createSourcesJar>true</createSourcesJar>
                            <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
                            <shadeSourcesContent>true</shadeSourcesContent>
                            <artifactSet>
                                <includes>
                                    <include>org.tinylog:tinylog</include>
                                    <include>org.bouncycastle:bcpkix-jdk15on</include>
                                    <include>org.bouncycastle:bcprov-jdk15on</include>
                                </includes>
                            </artifactSet>
                            <relocations>
                                <!-- tinylog -->
                                <relocation>
                                    <pattern>org.pmw.tinylog</pattern>
                                    <shadedPattern>enos.poseidon.shade.org.pmw.tinylog</shadedPattern>
                                </relocation>
                                <!-- bcpkix -->
                                <relocation>
                                    <pattern>org.bouncycastle</pattern>
                                    <shadedPattern>enos.poseidon.shade.org.bouncycastle</shadedPattern>
                                </relocation>
                            </relocations>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <id>EnosIot</id>
            <name>EnOS Core</name>
            <email>sw.tc@eniot.io</email>
        </developer>
    </developers>

    <distributionManagement>
        <repository>
            <id>envision.repo</id>
            <name>envision internal repository for released artifacts</name>
            <url>http://nexus.eniot.io/content/repositories/releases</url>
        </repository>
        <snapshotRepository>
            <id>envision.repo.snapshots</id>
            <name>envision internal repository for snapshots artifacts</name>
            <url>http://nexus.eniot.io/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

</project>