<?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>

    <version>1.1.0</version>
    <groupId>com.milesight.beaveriot.integrations</groupId>
    <artifactId>beaver-iot-integrations</artifactId>
    <packaging>pom</packaging>
    <name>beaver-iot-integrations</name>
    <description>Beaver IoT integrations.</description>
    <url>https://github.com/milesight-iot/beaver-iot-integrations</url>
    <scm>
        <url>https://github.com/milesight-iot/beaver-iot-integrations</url>
    </scm>
    <organization>
        <name>Milesight</name>
        <url>https://www.milesight.com</url>
    </organization>
    <developers>
        <developer>
            <id>Simon</id>
            <name>Simon Zhao</name>
            <email>simon.zhao@milesight.com</email>
        </developer>
    </developers>
    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://opensource.org/license/MIT</url>
        </license>
    </licenses>

    <modules>
        <module>integrations</module>
    </modules>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <beaver-iot.version>1.1.0</beaver-iot.version>
        <deploy.skip>false</deploy.skip>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.milesight.beaveriot</groupId>
                <artifactId>beaver-iot-parent</artifactId>
                <version>${beaver-iot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.1</version>
                <configuration>
                    <skipSource>${deploy.skip}</skipSource>
                </configuration>
                <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.10.1</version>
                <configuration>
                    <legacyMode>true</legacyMode>
                    <doclint>none</doclint>
                    <skip>${deploy.skip}</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <configuration>
                            <skip>${deploy.skip}</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.6.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <waitUntil>published</waitUntil>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>snapshot</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>deploy</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>deploy</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>

            <distributionManagement>
                <repository>
                    <id>nexus</id>
                    <url>https://nexus.milesight.com/repository/maven-open-source/</url>
                </repository>
                <snapshotRepository>
                    <id>snapshots</id>
                    <url>https://nexus.milesight.com/repository/maven-open-source/</url>
                    <uniqueVersion>false</uniqueVersion>
                </snapshotRepository>
            </distributionManagement>

            <repositories>
                <repository>
                    <id>snapshots</id>
                    <name>nexus-snapshots</name>
                    <url>https://nexus.milesight.com/repository/maven-open-source/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                    </snapshots>
                </repository>
            </repositories>
        </profile>
    </profiles>

</project>
