<project>
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.pepsoft.worldpainter</groupId>
    <artifactId>WorldPainter</artifactId>
    <version>2.25.0</version>
    <packaging>pom</packaging>

    <name>WorldPainter</name>
    <description>WorldPainter is an interactive map generator for Minecraft. It allows you to "paint" landscapes using similar tools as a regular paint program. Sculpt and mould the terrain, paint materials, trees, snow and ice, etc. onto it, and much more.</description>
    <url>https://www.worldpainter.net/</url>
    <inceptionYear>2011</inceptionYear>

    <licenses>
        <license>
            <name>GNU General Public License, version 3</name>
            <url>https://www.gnu.org/licenses/gpl-3.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <organization>
        <name>pepsoft.org</name>
        <url>https://www.pepsoft.org/</url>
    </organization>

    <developers>
        <developer>
            <name>Pepijn Schmitz</name>
            <organization>pepsoft.org</organization>
            <email>Pepijn.Schmitz@pepsoft.org</email>
            <timezone>Europe/Amsterdam</timezone>
        </developer>
    </developers>

    <modules>
        <module>WPCore</module>
        <module>WPDynmapPreviewer</module>
        <module>WPGUI</module>
    </modules>

    <repositories>
        <repository>
            <id>worldpainter-private</id>
            <url>https://www.worldpainter.net/maven-repo/</url>
            <releases>
                <enabled>true</enabled>
                <checksumPolicy>ignore</checksumPolicy>
            </releases>
        </repository>
    </repositories>

    <scm>
        <connection>scm:git:https://github.com/Captain-Chaos/WorldPainter.git</connection>
        <url>https://github.com/Captain-Chaos/WorldPainter</url>
    </scm>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-toolchains-plugin</artifactId>
                <version>1.1</version>
                <configuration>
                    <toolchains>
                        <jdk>
                            <version>17</version>
                        </jdk>
                    </toolchains>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>toolchain</goal>
                        </goals>
                    </execution>
                </executions>
                <inherited>true</inherited>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>17</source>
                        <target>17</target>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <argLine>-Duser.home=${project.build.directory}</argLine>
                    </configuration>
                </plugin>
                <!-- Inhibit regular deploy -->
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <configuration>
                        <skip>true</skip>
                    </configuration>
                    <inherited>true</inherited>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- Core dependencies -->
        <pepsoft.utils.version>2.0.1</pepsoft.utils.version>
        <pepsoft.swingutils.version>2.0.0</pepsoft.swingutils.version>
        <pepsoft.jnbt.version>1.0.0</pepsoft.jnbt.version>
        <wp.valueobjects.version>1.2.0</wp.valueobjects.version>
        <jetbrains.annotations.version>24.0.1</jetbrains.annotations.version>
        <vecmath.version>1.3.1</vecmath.version>
        <imageio-tiff.version>3.8.2</imageio-tiff.version>
        <slf4j.version>1.7.36</slf4j.version>
        <nashorn-core.version>15.4</nashorn-core.version>
        <dynmap-core.version>3.6</dynmap-core.version>
        <snakeyaml.version>2.0</snakeyaml.version>
        <json-simple.version>1.1.1</json-simple.version>

        <!-- GUI dependencies -->
        <jpen.version>2-150301</jpen.version>
        <jide.version>3.7.13</jide.version>
        <laf-dark.version>201403101706</laf-dark.version>
        <logback.version>1.2.11</logback.version>
        <log4j-to-slf4j.version>2.17.2</log4j-to-slf4j.version>

        <!-- Test dependencies -->
        <junit.version>4.13.2</junit.version>

        <!-- Build dependencies -->
        <lombok.version>1.18.22</lombok.version>

        <!-- Maven plugin versions -->
        <maven-enforcer-plugin.version>3.3.0</maven-enforcer-plugin.version>
        <maven-failsafe-plugin.version>3.0.0-M6</maven-failsafe-plugin.version>
        <maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <buildnumber-maven-plugin.version>1.3</buildnumber-maven-plugin.version>
        <exec-maven-plugin.version>1.3.2</exec-maven-plugin.version>
        <maven-toolchains-plugin.version>1.1</maven-toolchains-plugin.version>
        <maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>
    </properties>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- Make sure we don't try to release snapshots -->
                    <plugin>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <version>${maven-enforcer-plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>validate</phase>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireReleaseVersion/>
                                        <requireReleaseDeps/>
                                    </rules>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>${maven-failsafe-plugin.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <author>false</author>
                                    <use>false</use>
                                    <version>false</version>
                                    <doclint>none</doclint>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</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>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.8.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <ignorePublishedComponents>true</ignorePublishedComponents>
                            <waitUntil>uploaded</waitUntil>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release-snapshot</id>
            <build>
                <plugins>
                    <!-- Make sure we only deploy snapshots -->
                    <plugin>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <version>${maven-enforcer-plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>validate</phase>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireSnapshotVersion/>
                                    </rules>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.8.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <ignorePublishedComponents>true</ignorePublishedComponents>
                            <waitUntil>uploaded</waitUntil>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>integration-tests</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>${maven-failsafe-plugin.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <argLine>-Djava.awt.headless=true</argLine>
                            <argLine>-Duser.home=${project.build.directory}</argLine>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>snapshot-dependencies</id>
            <repositories>
                <repository>
                    <id>oss-snapshots</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
        </profile>
    </profiles>
</project>
