<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.devzendo</groupId>
    <artifactId>group-parent</artifactId>
    <version>1.2.2</version>
    <packaging>pom</packaging>
    <name>group-parent</name>

    <description>The parent of all DevZendo.org Maven Java projects
        (Apache License v2) 2008-2024 Matt Gumbley, DevZendo.org
    </description>

    <url>https://devzendo.github.io/dev/commons/</url>

    <organization>
        <name>DevZendo.org</name>
        <url>http://devzendo.org/</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>
        <url>https://github.com/devzendo/group-parent.git</url>
        <connection>scm:git:https://github.com/devzendo/group-parent.git</connection>
        <developerConnection>scm:git:git@github.com:devzendo/group-parent.git</developerConnection>
        <tag>group-parent-1.2.2</tag>
    </scm>

    <developers>
        <developer>
            <id>matt.gumbley</id>
            <name>Matt Gumbley</name>
            <email>matt.gumbley@devzendo.org</email>
        </developer>
    </developers>

    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-staging</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <properties>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>${maven.compiler.target}</source>
                    <target>${maven.compiler.target}</target>
                    <compilerArgs>
                        <arg>-Xlint:unchecked</arg>
                    </compilerArgs>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                        <configuration>
                            <skipIfEmpty>true</skipIfEmpty>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <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>
                        <configuration>
                            <executable>gpg2</executable>
                        </configuration>
                    </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>sonatype-nexus-staging</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.7.1</version>
                <executions>
                    <execution>
                        <id>attach-descriptor</id>
                        <goals>
                            <goal>attach-descriptor</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <!-- The following plugins are only activated when building on the DevZendo.org CI server -->
    <profiles>
        <profile>
            <id>ci</id>

            <build>
                <plugins>

                    <!-- Cobertura is no longer compatible with Java 9+ 
                    <plugin>
                        <groupId>com.qualinsight.mojo.cobertura</groupId>
                        <artifactId>qualinsight-mojo-cobertura-core</artifactId>
                        <version>2.0.0</version>
                        <executions>
                            <execution>
                                <id>instrument-ut</id>
                                <goals>
                                    <goal>instrument-ut</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>instrument-it</id>
                                <goals>
                                    <goal>instrument-it</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report-ut-coverage</id>
                                <goals>
                                    <goal>report-ut-coverage</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report-it-coverage</id>
                                <goals>
                                    <goal>report-it-coverage</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report-overall-coverage</id>
                                <goals>
                                    <goal>report-overall-coverage</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    -->
                </plugins>
            </build>

            <dependencies>
                <!-- Cobertura is no longer compatible with Java 9+ 
                <dependency>
                    <groupId>net.sourceforge.cobertura</groupId>
                    <artifactId>cobertura</artifactId>
                    <version>2.1.1</version>
                    <scope>test</scope>
                </dependency>
                -->
            </dependencies>

            <reporting>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jxr-plugin</artifactId>
                        <version>2.5</version>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-pmd-plugin</artifactId>
                        <version>3.8</version>
                        <configuration>
                            <targetJdk>${maven.compiler.target}</targetJdk>
                            <rulesets>
                                <ruleset>/rulesets/java/basic.xml</ruleset>
                                <ruleset>/rulesets/java/design.xml</ruleset>
                                <ruleset>/rulesets/java/coupling.xml</ruleset>
                                <ruleset>/rulesets/java/unusedcode.xml</ruleset>
                                <ruleset>/rulesets/java/codesize.xml</ruleset>
                                <ruleset>/rulesets/java/junit.xml</ruleset>
                                <ruleset>/rulesets/java/naming.xml</ruleset>
                                <ruleset>/rulesets/java/optimizations.xml</ruleset>
                                <ruleset>/rulesets/java/strings.xml</ruleset>
                                <ruleset>/rulesets/java/typeresolution.xml</ruleset>
                                <ruleset>/rulesets/java/strictexception.xml</ruleset>
                            </rulesets>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>findbugs-maven-plugin</artifactId>
                        <version>3.0.5</version>
                        <configuration>
                            <effort>Max</effort>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.10.4</version>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-report-plugin</artifactId>
                        <version>2.20.1</version>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-project-info-reports-plugin</artifactId>
                        <version>2.9</version>
                    </plugin>
                </plugins>
            </reporting>

        </profile>
    </profiles>
</project>
