<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2018 Lime Mojito Pty Ltd
  ~
  ~    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.limemojito.oss.standards</groupId>
    <artifactId>oss-maven-standards</artifactId>
    <version>2.5.0</version>
    <packaging>pom</packaging>

    <properties>
        <!-- Overridden by build server -->
        <build.number>LOCAL</build.number>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- Because DRY -->
        <bitbucket.url>https://bitbucket.org/limemojito/oss-maven-standards</bitbucket.url>
        <git.url>git@bitbucket.org:limemojito/oss-maven-standards.git</git.url>
        <lime.scm.url>scm:git:${git.url}</lime.scm.url>
        <lime.website.url>https://www.limemojito.com</lime.website.url>

        <version.checkstyle>10.3.2</version.checkstyle>
        <version.java>11</version.java>
        <!-- This has both library and build implications -->
        <version.spring.boot>2.7.2</version.spring.boot>
        <version.lombok>1.18.24</version.lombok>
    </properties>

    <modules>
        <module>library</module>
        <module>java-development</module>
        <module>jar-development</module>
    </modules>

    <name>Lime Mojito OSS Development Standard Build</name>
    <description>A set of maven poms that allow us to use an agile development methodology when we build our apps. Checkstyle, unit test, coverage,
        etc are all built into the build.
    </description>
    <url>${bitbucket.url}</url>
    <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>
    <developers>
        <developer>
            <id>Lime Mojito Pty Ltd</id>
            <name>Development Group</name>
            <email>sales@limemojito.com</email>
            <timezone>+10</timezone>
            <organization>Lime Mojito Pty Ltd</organization>
            <organizationUrl>${lime.website.url}</organizationUrl>
            <roles>
                <role>developer</role>
            </roles>
        </developer>
    </developers>
    <issueManagement>
        <system>Bitbucket</system>
        <url>${bitbucket.url}/issues</url>
    </issueManagement>

    <organization>
        <name>Lime Mojito Pty Ltd</name>
        <url>${lime.website.url}</url>
    </organization>

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

    <scm>
        <connection>${lime.scm.url}</connection>
        <developerConnection>${lime.scm.url}</developerConnection>
        <url>${bitbucket.url}</url>
        <tag>oss-maven-standards-2.5.0</tag>
    </scm>

    <profiles>
        <profile>
            <id>fast-build</id>
            <properties>
                <checkstyle.skip>true</checkstyle.skip>
                <enforcer.skip>true</enforcer.skip>
                <gpg.skip>true</gpg.skip>
                <jacoco.skip>true</jacoco.skip>
                <skipTests>true</skipTests>
            </properties>
        </profile>
        <profile>
            <id>dev-build</id>
            <properties>
                <gpg.skip>true</gpg.skip>
            </properties>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-gpg-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.0.1</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.13</version>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <useReleaseProfile>false</useReleaseProfile>
                        <releaseProfiles>release</releaseProfiles>
                        <goals>deploy</goals>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

</project>
