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

    <groupId>info.schnatterer.moby-names-generator</groupId>
    <artifactId>moby-names-generator-parent</artifactId>
    <version>20.10.1-r0</version>
    <packaging>pom</packaging>

    <name>moby-names-generator-parent</name>
    <url>https://github.com/schnatterer/moby-names-generator-java</url>
    <description>Java Version of the famous Moby (Docker) Names Generator</description>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://github.com/schnatterer/moby-names-generator-java/blob/master/LICENSE</url>
        </license>
    </licenses>

    <inceptionYear>2020</inceptionYear>

    <organization>
        <name>github/schnatterer</name>
        <url>https://github.com/schnatterer/</url>
    </organization>

    <developers>
        <developer>
            <name>Johannes Schnatterer</name>
            <email>schnatterer@users.noreply.github.com email</email>
            <timezone>Europe/Berlin</timezone>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/schnatterer/moby-names-generator-java</connection>
        <developerConnection>scm:git:https://github.com/schnatterer/moby-names-generator-java</developerConnection>
        <url>https://github.com/schnatterer/moby-names-generator-java.git</url>
        <tag>HEAD</tag>
    </scm>

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

    <build>
        <pluginManagement>
            
            <plugins>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                    <configuration>
                        <tagNameFormat>@{project.version}</tagNameFormat>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                    <executions>
                        <!-- Compatibility with java 8 and the Jigsaw/JPMS
                             See https://maven.apache.org/plugins/maven-compiler-plugin/examples/module-info.html -->
                        <execution>
                            <id>default-compile</id>
                            <configuration>
                                <!-- compile everything to ensure module-info contains right entries -->
                                <!-- required when JAVA_HOME is JDK 8 or below -->
                                <jdkToolchain>
                                    <version>9</version>
                                </jdkToolchain>
                                <release>9</release>
                            </configuration>
                        </execution>
                        <execution>
                            <id>base-compile</id>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                            <!-- recompile everything for target VM except the module-info.java -->
                            <configuration>
                                <excludes>
                                    <exclude>module-info.java</exclude>
                                </excludes>
                            </configuration>
                        </execution>
                    </executions>
                    <!-- defaults for compile and testCompile -->
                    <configuration>
                        <!-- jdkToolchain required when JAVA_HOME is JDK 9 or above -->
                        <jdkToolchain>
                            <version>[1.5,9)</version>
                        </jdkToolchain>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.2.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.2.0</version>
                    <configuration>
                        <detectJavaApiLink>false</detectJavaApiLink>
                        <encoding>UTF-8</encoding>
                        <sourceFileExcludes>
                            <!--Avoid "Error: module not found" -->
                            <sourceFileExclude>**/module-info.java</sourceFileExclude>
                        </sourceFileExcludes>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.1.2</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.5</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.8</version>
                </plugin>
                <plugin>
                    <groupId>org.kohsuke</groupId>
                    <artifactId>pgp-maven-plugin</artifactId>
                    <version>1.1</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <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>
                    <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.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.kohsuke</groupId>
                        <artifactId>pgp-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>


    <modules>
        <module>processor</module>
        <module>moby-names-generator</module>
        <module>example-java9</module>
        <module>example-java8</module>
    </modules>
</project>
