<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2021 OPPO ESA Stack Project
  ~
  ~ 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>io.esastack</groupId>
    <artifactId>esa-cabin</artifactId>
    <packaging>pom</packaging>
    <version>0.1.0</version>

    <name>ESA Cabin</name>
    <description>
        ESA Cabin is a lightweight class isolation container for Java applications.
    </description>
    <url>https://github.com/esastack</url>

    <scm>
        <url>https://github.com/esastack/esa-commons</url>
        <connection>scm:git:git://github.com/esastack/esa-cabin.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/esastack/esa-cabin.git</developerConnection>
        <tag>v0.1.0</tag>
    </scm>

    <developers>
        <developer>
            <name>The ESA Stack Project Contributors</name>
            <email>esa.stack@oppo.com</email>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

<!--    <repositories>-->
<!--        <repository>-->
<!--            <id>ossrh</id>-->
<!--            <url>https://oss.sonatype.org/content/repositories/snapshots</url>-->
<!--            <snapshots>-->
<!--                <enabled>true</enabled>-->
<!--            </snapshots>-->
<!--            <releases>-->
<!--                <enabled>false</enabled>-->
<!--            </releases>-->
<!--        </repository>-->
<!--    </repositories>-->

<!--    <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>-->

    <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>

    <properties>
        <slf4j.version>1.7.25</slf4j.version>
        <logback.version>1.2.3</logback.version>
        <commons-lang.version>3.11</commons-lang.version>
        <commons-collections.version>4.4</commons-collections.version>
        <picocontainer.version>2.15</picocontainer.version>
        <asm.version>5.0.3</asm.version>
        <junit.version>4.12</junit.version>
        <testng.version>6.14.3</testng.version>

        <maven.assembly.plugin>2.4</maven.assembly.plugin>
        <maven.plugin.plugin>3.4</maven.plugin.plugin>
        <surefire.version>2.20</surefire.version>

        <maven.core.version>2.2.1</maven.core.version>
        <maven.artifact.version>2.2.1</maven.artifact.version>
        <maven.archiver.version>2.5</maven.archiver.version>
        <maven.plugin.api.version>3.1.1</maven.plugin.api.version>
        <maven.plugin.annotations.version>3.2</maven.plugin.annotations.version>
        <maven.common.artifact.filters.version>1.4</maven.common.artifact.filters.version>

        <plexus.utils.version>3.0</plexus.utils.version>
        <plexus.build.api.version>0.0.7</plexus.build.api.version>
        <plexus.component.annotations.version>1.5.5</plexus.component.annotations.version>

    </properties>

    <modules>
        <module>cabin-api</module>
        <module>cabin-archive</module>
        <module>cabin-container</module>
        <module>cabin-common</module>
        <module>cabin-bootstrap</module>
        <module>cabin-maven</module>
        <module>cabin-boot</module>
        <module>cabin-core</module>
        <module>cabin-test</module>
<!--        <module>cabin-samples</module>-->
<!--        <module>cabin-samples/cabin-sample-lib-module</module>-->
<!--        <module>cabin-samples/cabin-sample-app</module>-->
    </modules>

    <!-- All the third part dependencies witch should not passed to third part should be included here as optional -->
    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <!--Cabin Dependencies-->
            <dependency>
                <groupId>io.esastack</groupId>
                <artifactId>cabin-archive</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.esastack</groupId>
                <artifactId>cabin-common</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.esastack</groupId>
                <artifactId>cabin-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.esastack</groupId>
                <artifactId>cabin-container</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.esastack</groupId>
                <artifactId>cabin-boot</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.esastack</groupId>
                <artifactId>cabin-bootstrap</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.esastack</groupId>
                <artifactId>cabin-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.esastack</groupId>
                <artifactId>cabin-test</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.esastack</groupId>
                <artifactId>cabin-maven-common</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons-lang.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-collections4</artifactId>
                <version>${commons-collections.version}</version>
            </dependency>
            <dependency>
                <groupId>org.picocontainer</groupId>
                <artifactId>picocontainer</artifactId>
                <version>${picocontainer.version}</version>
            </dependency>
            <dependency>
                <groupId>org.ow2.asm</groupId>
                <artifactId>asm</artifactId>
                <version>${asm.version}</version>
            </dependency>
            <!-- maven -->
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-core</artifactId>
                <version>${maven.core.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.plugin-tools</groupId>
                <artifactId>maven-plugin-annotations</artifactId>
                <version>${maven.plugin.annotations.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-archiver</artifactId>
                <version>${maven.archiver.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.shared</groupId>
                <artifactId>maven-common-artifact-filters</artifactId>
                <version>${maven.common.artifact.filters.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-plugin-api</artifactId>
                <version>${maven.plugin.api.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-artifact</artifactId>
                <version>${maven.artifact.version}</version>
            </dependency>

            <!-- plexus -->
            <dependency>
                <groupId>org.codehaus.plexus</groupId>
                <artifactId>plexus-component-annotations</artifactId>
                <version>${plexus.component.annotations.version}</version>
            </dependency>

            <dependency>
                <groupId>org.codehaus.plexus</groupId>
                <artifactId>plexus-utils</artifactId>
                <version>${plexus.utils.version}</version>
            </dependency>

            <dependency>
                <groupId>org.sonatype.plexus</groupId>
                <artifactId>plexus-build-api</artifactId>
                <version>${plexus.build.api.version}</version>
            </dependency>

            <!-- test -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
            </dependency>

            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>${testng.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>


    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>export-javadoc</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.2.0</version>
                        <configuration>
                            <doclint>all,-missing</doclint>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
<!--            <plugin>-->
<!--                <groupId>org.apache.maven.plugins</groupId>-->
<!--                <artifactId>maven-gpg-plugin</artifactId>-->
<!--                <version>1.6</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-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <configuration>
                    <attach>true</attach>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>compile</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.1.1</version>
                <configuration>
                    <archive>
                        <index>true</index>
                        <manifestEntries>
                            <Built-By>bot</Built-By>
                            <CabinJarTye>CabinCoreJar</CabinJarTye>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.0.0-M1</version>
                <configuration>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release,export-javadoc</releaseProfiles>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <allowTimestampedSnapshots>false</allowTimestampedSnapshots>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.6</version>
                <executions>
                    <execution>
                        <id>jacoco-init</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <excludes>
                                <exclude>esa/commons/jmh/**</exclude>
                                <exclude>esa/commons/concurrencytest/**</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>coverage-report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.1.1</version>
                <executions>
                    <execution>
                        <id>check-style</id>
                        <configuration>
                            <skip>false</skip>
                            <configLocation>esa/commons/checkstyle.xml</configLocation>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <logViolationsToConsole>true</logViolationsToConsole>
                            <failsOnError>true</failsOnError>
                            <failOnViolation>true</failOnViolation>
                            <propertyExpansion>main.basedir=${basedir}</propertyExpansion>
                            <sourceDirectories>
                                <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
                                <sourceDirectory>${project.build.testSourceDirectory}</sourceDirectory>
                            </sourceDirectories>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>validate</phase>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>8.35</version>
                    </dependency>
                    <dependency>
                        <groupId>io.esastack</groupId>
                        <artifactId>commons-build</artifactId>
                        <version>0.1.0</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven.assembly.plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>${maven.plugin.plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${surefire.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.0.1</version>
                    <configuration>
                        <attach>true</attach>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>compile</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

            </plugins>
        </pluginManagement>
    </build>

</project>
