<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2011-2023 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.7.9</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>
        <staging.nexus.url>https://oss.sonatype.org</staging.nexus.url>

        <checkstyle.version>10.9.1</checkstyle.version>
        <java.version>11</java.version>
        <!-- This has both library and build implications -->
        <spring.boot.version>2.7.9</spring.boot.version>
        <lombok.version>1.18.26</lombok.version>
    </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>https://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>${staging.nexus.url}/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>${staging.nexus.url}/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.7.9</tag>
    </scm>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>3.2.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.11.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.2.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.5.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <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>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.2.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.8</version>
                </plugin>
                <plugin>
                    <groupId>org.projectlombok</groupId>
                    <artifactId>lombok-maven-plugin</artifactId>
                    <version>1.18.20.0</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </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-deploy-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default-deploy</id>
                                <configuration>
                                    <altReleaseDeploymentRepository>
                                        lime-release::https://artifactory.nonprod.limemojito.com/artifactory/libs-release-local
                                    </altReleaseDeploymentRepository>
                                    <altSnapshotDeploymentRepository>
                                        lime-snapshot::https://artifactory.nonprod.limemojito.com/artifactory/libs-snapshot-local
                                    </altSnapshotDeploymentRepository>
                                </configuration>
                                <goals>
                                    <goal>deploy</goal>
                                </goals>
                                <phase>deploy</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <!--
                        A custom configuration of the nexus staging plugin so it does NOT display maven-deploy-plugin as we want to use that to get
                        to the lime repository.  Nexus publish is very, very slow globally so we want it in lime local first.
                         -->
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.13</version>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>${staging.nexus.url}/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                        <executions>
                            <execution>
                                <id>nexus-deploy</id>
                                <phase>deploy</phase>
                                <!-- By default, this is the phase deploy goal will bind to -->
                                <goals>
                                    <goal>deploy</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

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

</project>
