<?xml version="1.0" encoding="utf-8" ?>
<!--
 - Copyright (C) 2018 Connectorio Sp. z o.o.
 -
 - 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/maven-v4_0_0.xsd">

    <!-- Maven model version - the version 4.0.0 is reserved for Maven 2.x+ -->
    <modelVersion>4.0.0</modelVersion>

    <!-- Project identification -->
    <groupId>org.connectorio</groupId>
    <artifactId>connectorio-oss</artifactId>
    <version>4</version>

    <name>ConnectorIO | OSS Parent</name>
    <packaging>pom</packaging>

    <!-- Information about project -->
    <description>Parent project for open source components developed by ConnectorIO.</description>

    <url>http://connectorio.org</url>

    <inceptionYear>2018</inceptionYear>

    <!-- Issue tracker -->
    <issueManagement>
        <system>Github</system>
        <url>https://github.com/ConnectorIO/maven-parent</url>
    </issueManagement>

    <organization>
        <name>ConnectorIO Sp. z o.o.</name>
        <url>http://connectorio.com</url>
    </organization>

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

    <scm>
        <connection>scm:git:git@github.com:ConnectorIO/maven-parent.git</connection>
        <developerConnection>scm:git:git@github.com:ConnectorIO/maven-parent.git</developerConnection>
        <url>https://github.com/ConnectorIO/maven-parent</url>
        <tag>connectorio-oss-4</tag>
    </scm>

    <!-- properties -->
    <properties>
        <!-- Maven plugins -->
        <maven-checkstyle-plugin.version>3.3.0</maven-checkstyle-plugin.version>
        <maven-clean-plugin.version>3.3.1</maven-clean-plugin.version>
        <maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
        <maven-dependency-plugin.version>3.6.0</maven-dependency-plugin.version>
        <maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
        <maven-install-plugin.version>3.1.1</maven-install-plugin.version>
        <maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
        <maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
        <maven-jxr-plugin.version>3.3.0</maven-jxr-plugin.version>
        <maven-release-plugin.version>3.0.0-M6</maven-release-plugin.version>
        <maven-reports-plugin.version>3.4.5</maven-reports-plugin.version>
        <maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
        <maven-site-plugin.version>3.12.1</maven-site-plugin.version>
        <maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
        <maven-source-plugin.version>3.3.0</maven-source-plugin.version>

        <mojohaus-buildhelper-plugin.version>3.4.0</mojohaus-buildhelper-plugin.version>

        <!-- Compilation -->
        <compiler.source>1.8</compiler.source>
        <compiler.target>1.8</compiler.target>

        <!-- Build and raporting plugin properties -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <snapshot.repository-id>sonatype-nexus-snapshots</snapshot.repository-id>
        <snapshot.repository-name>Sonatype Snapshots</snapshot.repository-name>
        <snapshot.repository-url>https://oss.sonatype.org/content/repositories/snapshots/</snapshot.repository-url>

        <release.repository-id>sonatype-nexus-staging</release.repository-id>
        <release.repository-name>Sonatype Central Synchronisation</release.repository-name>
        <release.repository-url>https://oss.sonatype.org/service/local/staging/deploy/maven2</release.repository-url>

        <site.repository-id>github.com</site.repository-id>
        <site.repository-name>GitHub Pages</site.repository-name>
        <site.repository-url>scm:git:git@github.com:ConnectorIO/connectorio.github.io.git</site.repository-url>

        <maven-wagon.version>3.4.3</maven-wagon.version>
        <maven-scm.version>1.12.0</maven-scm.version>
        <maven-scm-publish-plugin.version>3.1.0</maven-scm-publish-plugin.version>

        <project.build.outputTimestamp>1694466575</project.build.outputTimestamp>
    </properties>

    <!-- Repositories -->
    <distributionManagement>
        <repository>
            <id>${release.repository-id}</id>
            <url>${release.repository-url}</url>
            <name>${release.repository-name}</name>
        </repository>
        <snapshotRepository>
            <id>${snapshot.repository-id}</id>
            <url>${snapshot.repository-url}</url>
            <name>${snapshot.repository-name}</name>
        </snapshotRepository>
        <site>
            <id>${site.repository-id}</id>
            <url>${site.repository-url}</url>
            <name>${site.repository-name}</name>
        </site>
    </distributionManagement>

    <developers>
        <developer>
            <id>splatch</id>
            <name>Łukasz Dywicki</name>
            <organization>Connectorio Sp. z o.o.</organization>
            <organizationUrl>http://connectorio.com</organizationUrl>
            <timezone>Europe/Warsaw</timezone>
        </developer>
    </developers>

    <build>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-scm</artifactId>
                <version>${maven-wagon.version}</version>
            </extension>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-http</artifactId>
                <version>${maven-wagon.version}</version>
            </extension>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
                <version>${maven-wagon.version}</version>
            </extension>
            <extension>
                <groupId>org.apache.maven.scm</groupId>
                <artifactId>maven-scm-manager-plexus</artifactId>
                <version>${maven-scm.version}</version>
            </extension>
            <extension>
                <groupId>org.apache.maven.scm</groupId>
                <artifactId>maven-scm-provider-gitexe</artifactId>
                <version>${maven-scm.version}</version>
            </extension>
        </extensions>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${maven-checkstyle-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${maven-clean-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>${compiler.source}</source>
                        <target>${compiler.target}</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${maven-dependency-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                    <configuration>
                        <gpgArguments>
                            <arg>--digest-algo=SHA512</arg>
                        </gpgArguments>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${maven-install-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                    <configuration>
                        <notimestamp>true</notimestamp>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release-plugin.version}</version>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <useReleaseProfile>false</useReleaseProfile>
                        <releaseProfiles>release</releaseProfiles>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${maven-site-plugin.version}</version>
                    <configuration>
                        <skipDeploy>true</skipDeploy>
                        <inputEncoding>${project.build.sourceEncoding}</inputEncoding>
                        <outputEncoding>${project.build.sourceEncoding}</outputEncoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-report-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${mojohaus-buildhelper-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-scm-publish-plugin</artifactId>
                    <version>${maven-scm-publish-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                        <configuration>
                            <includePom>true</includePom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>${maven-reports-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <reportSets>
                    <reportSet>
                        <id>default</id>
                        <inherited>true</inherited>
                        <reports>
                            <report>aggregate-no-fork</report>
                        </reports>
                    </reportSet>
                    <reportSet>
                        <id>aggregate</id>
                        <inherited>true</inherited>
                        <reports>
                            <report>aggregate-no-fork</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>connectorio</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>

            <repositories>
                <repository>
                    <id>co7io-public-releases</id>
                    <url>https://repository.connectorio.cloud/repository/co7io-public-releases</url>
                    <snapshots><enabled>false</enabled></snapshots>
                    <releases><enabled>true</enabled></releases>
                </repository>
                <repository>
                    <id>co7io-public-snapshots</id>
                    <url>https://repository.connectorio.cloud/repository/co7io-public-snapshots</url>
                    <snapshots><enabled>true</enabled></snapshots>
                    <releases><enabled>false</enabled></releases>
                </repository>
            </repositories>
        </profile>

        <profile>
            <id>connectorio-internal</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>

            <repositories>
                <repository>
                    <id>co7io-internal-releases</id>
                    <url>https://repository.connectorio.cloud/repository/co7io-internal-releases</url>
                    <snapshots><enabled>false</enabled></snapshots>
                    <releases><enabled>true</enabled></releases>
                </repository>
                <repository>
                    <id>co7io-internal-snapshots</id>
                    <url>https://repository.connectorio.cloud/repository/co7io-internal-snapshots</url>
                    <snapshots><enabled>true</enabled></snapshots>
                    <releases><enabled>false</enabled></releases>
                </repository>
            </repositories>
        </profile>

        <profile>
            <id>release</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <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-site-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-descriptor</id>
                                <goals>
                                    <goal>attach-descriptor</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>site</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-site-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>stage-for-scm-publish</id>
                                <phase>post-site</phase>
                                <goals>
                                    <goal>stage</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-scm-publish-plugin</artifactId>
                        <configuration>
                            <checkoutDirectory>${project.basedir}/connectorio.github.io</checkoutDirectory>
                            <checkinComment>Updated site for ${project.version}</checkinComment>
                            <content>target/staging</content>
                            <subDirectory>${project.artifactId}</subDirectory>
                            <pubScmUrl>${site.repository-url}</pubScmUrl>
                            <scmBranch>gh-pages</scmBranch>
                        </configuration>
                        <executions>
                            <execution>
                                <id>scm-publish</id>
                                <phase>site-deploy</phase>
                                <goals>
                                    <goal>publish-scm</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
