<?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>com.imagingbook</groupId>
    <version>1.2.0</version>
    <artifactId>parboiled-java-pom</artifactId>
    <packaging>pom</packaging>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>
        Elegant parsing in Java and Scala - lightweight, easy-to-use, powerful.
        This is a modularized version of the 'parboiled' PEG parser Java/Scala
        implementation developed by Mathias Doenitz, refactored from
        https://github.com/sirthias/parboiled (Version 1.4.1, Jan. 2023).
    </description>
    <inceptionYear>2009</inceptionYear>
    <url>https://github.com/imagingbook/parboiled-modular</url>

    <developers>
        <developer>
            <id>sirthias</id>
            <name>Mathias Doenitz</name>
            <organization>org.parboiled</organization>
            <url>http://parboiled.org</url>
            <roles>
                <role>architect</role>
                <role>original developer</role>
            </roles>
        </developer>
    </developers>

    <contributors>
        <contributor>
            <name>Wilhelm Burger</name>
            <url>https://imagingbook.com</url>
            <roles>
                <role>refactoring</role>
            </roles>
        </contributor>
    </contributors>

    <scm>
        <connection>scm:git:git://github.com/imagingbook/parboiled-modular.git</connection>
        <developerConnection>scm:git:ssh://github.com:imagingbook/parboiled-modular.git.git</developerConnection>
        <url>http://github.com/imagingbook/parboiled-modular.git/tree/master</url>
    </scm>

    <licenses>
        <license>
            <name>Apache-2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>Original project licence</comments>
        </license>
    </licenses>

    <!-- ********************************************************************* -->

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>11</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <asm.version>9.4</asm.version>
        <junit.version>4.13.2</junit.version>

        <!--   *************** JavDoc related items ****************** -->
        <maven.javadoc.skip>true</maven.javadoc.skip>
        <imagingbook.header>
            <![CDATA[<br><font face="verdana"><B>]]>${project.name} ${project.version}<![CDATA[</B></font>]]>
        </imagingbook.header>
        <imagingbook.bottom>Build Date: ${maven.build.timestamp}</imagingbook.bottom>
        <imagingbook.gpgSkip>true</imagingbook.gpgSkip>	<!-- set false on command line for deploy only! -->

        <!--   *************** Deployment related items ****************** -->
        <imagingbook.deploydir>DEPLOY</imagingbook.deploydir>
        <imagingbook.skipdeploy>false</imagingbook.skipdeploy>
    </properties>

    <distributionManagement>
        <!-- used by 'mvn deploy' -->
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>

        <snapshotRepository>
            <!-- <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url> -->
            <id>local-deploy</id>
            <url>file:///${project.basedir}${file.separator}${imagingbook.deploydir}</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <!-- avoid removing the cleaned directories themselves, delete content only: -->
                    <excludeDefaultDirectories>true</excludeDefaultDirectories>
                    <filesets>
                        <!-- because excludeDefaultDirectories=true, target doesn't get cleaned by default -->
                        <fileset>
                            <directory>${project.basedir}/target</directory>
                            <includes><include>**/*</include></includes>
                        </fileset>
                       <!-- <fileset>
                            <directory>${project.basedir}/${imagingbook.deploydir}</directory>
                            <includes><include>**/*</include></includes>
                        </fileset>-->
                        <!--<fileset>
                            <directory>${project.basedir}/javadoc</directory>
                            <includes><include>**/*</include></includes>
                        </fileset>-->
                    </filesets>
                </configuration>
            </plugin>

            <plugin>
                <!-- Note: this is ESSENTIAL to make Java modules work properly! -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.10.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <!-- <compilerArgs>
                        <arg>-Xpkginfo:nonempty</arg>
                    </compilerArgs> -->
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12.4</version>
                <configuration>
                    <skipTests>false</skipTests>
                </configuration>
            </plugin>

            <plugin>  <!-- add more properties to MANIFEST file -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <!-- <useDefaultManifestFile>true</useDefaultManifestFile> --> <!-- not available since version 3.0.0 -->
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                        <manifestEntries>
                            <!-- <Build-Date>${buildDate}</Build-Date> -->
                            <Build-Time>${maven.build.timestamp}</Build-Time>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.4.1</version>
            <configuration>
                <reportOutputDirectory>${project.basedir}</reportOutputDirectory>
                <destDir>javadoc</destDir>
                <doclint>all,-missing</doclint>
                <show>protected</show>
                <author>false</author>
                <source>${java.version}</source>
                <failOnError>false</failOnError>
                <verbose>true</verbose>
                <linksource>true</linksource>
                <detectJavaApiLink>true</detectJavaApiLink>
                <detectLinks>true</detectLinks>
                <header>${imagingbook.header}</header>
                <!--<footer>${imagingbook.header}</footer>-->
                <bottom>${imagingbook.bottom}</bottom>
                <packagesheader>${project.name}</packagesheader>
                <nohelp>true</nohelp>
            </configuration>
            <executions> <!-- see https://maven.apache.org/plugins/maven-javadoc-plugin/examples/aggregate.html -->
                <execution>
                    <id>aggregate</id>
                    <goals>
                        <goal>aggregate</goal>
                    </goals>
                    <phase>site</phase>
                    <configuration>
                    </configuration>
                </execution>
                <execution>
                    <id>attach-javadocs</id>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                    <configuration>
                    </configuration>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.0.1</version>
            <configuration>
                <skip>${imagingbook.gpgSkip}</skip>	<!-- exception with Eclipse maven plugin! -->
            </configuration>
            <executions>
                <execution>
                    <id>sign-artifacts</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>sign</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

        <plugin>  <!-- generate a separate jar file with source code -->
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.2.1</version>
            <configuration>
                <!--generally exclude resources from source jars -->
                <!--<excludeResources>true</excludeResources>-->
            </configuration>
            <executions>
                <execution>
                    <id>attach-sources</id>
                    <goals>
                        <goal>jar-no-fork</goal>	<!-- was "jar" only -->
                    </goals>
                </execution>
            </executions>
        </plugin>

        <plugin> <!-- explicitly define maven-deploy-plugin after other to force exec order -->
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>3.0.0</version>
            <configuration>
                <skip>${imagingbook.skipdeploy}</skip>
            </configuration>
            <executions>
                <execution>
                    <id>deploy</id>
                    <phase>deploy</phase>
                    <goals>
                        <goal>deploy</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        </plugins>
    </build>

</project>