<?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>org.bsc.processor</groupId>
    <artifactId>java2ts-processor-parent</artifactId>
    <version>1.3.1</version>
    <packaging>pom</packaging>

    <name>java2ts-processor::parent</name>
    <description>
        Java Processor to generate Typescript Definition from Java classes - This is to help developing on JVM
        javascript engine (ie Nashorn/Rhino) using Typescript
    </description>
    <url>https://github.com/bsorrentino/java2typescript</url>
    <distributionManagement>
        <repository>
            <name>central</name>
            <id>${release.repo.id}</id>
            <url>${release.repo.url}</url>
        </repository>
        <snapshotRepository>
            <name>snapshot</name>
            <id>${snapshot.repo.id}</id>
            <url>${snapshot.repo.url}</url>
            <!--uniqueVersion>false</uniqueVersion-->
        </snapshotRepository>
        <!--
        <site>
            <id>${release.site.id}</id>
            <url>${release.site.url}</url>
        </site>
        -->
    </distributionManagement>
    <scm>
        <connection>scm:git:https://github.com/bsorrentino/java2typescript.git</connection>
        <developerConnection>scm:git:https://github.com/bsorrentino/java2typescript.git</developerConnection>
        <url>https://github.com/bsorrentino/java2typescript.git</url>
    </scm>

    <inceptionYear>2017</inceptionYear>

    <licenses>
        <license>
            <name>The MIT License</name>
            <url>https://opensource.org/licenses/MIT</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <email>bartolomeo.sorrentino@gmail.com</email>
            <name>Bartolomeo Sorrentino</name>
            <timezone>GMT+1</timezone>
            <roles>
                <role>Owner</role>
            </roles>
        </developer>
    </developers>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <modules>
        <module>processor</module>
        <module>archetype</module>
        <module>samples</module>
        <module>samples.rhino</module>
        <module>core</module>
    </modules>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>edu.washington.cs.types.jsr308</groupId>
                <artifactId>jsr308-compiler</artifactId>
                <version>1.7.5</version>
            </dependency>
            <dependency>
                <groupId>org.kohsuke.metainf-services</groupId>
                <artifactId>metainf-services</artifactId>
                <version>1.7</version>
            </dependency>
            <dependency>
                <groupId>com.github.spullara.mustache.java</groupId>
                <artifactId>compiler</artifactId>
                <version>0.9.4</version>
            </dependency>
            <dependency>
                <groupId>org.glassfish</groupId>
                <artifactId>javax.json</artifactId>
                <version>1.1.2</version>
            </dependency>
            <dependency>
                <groupId>org.bsc</groupId>
                <artifactId>jvm-npm-core</artifactId>
                <version>1.1.0</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.13.1</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-archetype-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.0.2</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.0</version>
                    <configuration>
                        <parameters>true</parameters>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.9.1</version>
                    <configuration>
                        <additionalparam>-Xdoclint:none</additionalparam>
                        <outputDirectory>${project.build.directory}/apidocs</outputDirectory>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.0.0-M1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>

                <plugin>
                    <groupId>org.bsc.maven</groupId>
                    <artifactId>maven-processor-plugin</artifactId>
                    <version>5.0-jdk8-rc3</version>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>1.6.0</version>
                </plugin>

            </plugins>
        </pluginManagement>

        <plugins>
            <!--
            mvn git-changelog-maven-plugin:git-changelog -N -DtoRef=refs/heads/release/...
            -->
            <plugin>
                <groupId>se.bjurr.gitchangelog</groupId>
                <artifactId>git-changelog-maven-plugin</artifactId>
                <inherited>false</inherited>
                <version>1.78</version>
                <!-- Minimal config // -->
                <configuration>
                    <settingsFile>changelog.json</settingsFile>
                    <file>CHANGELOG.md</file>
                </configuration>
            </plugin>

        </plugins>
    </build>
    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>enforce-no-snapshots</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <phase>verify</phase>
                                <configuration>
                                    <rules>
                                        <requireReleaseDeps>
                                            <message>No Snapshots Allowed!</message>
                                        </requireReleaseDeps>
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <!--
                    ====================================================================================
                    # https://github.com/keybase/keybase-issues/issues/2798
                    export GPG_TTY=$(tty)
                    mvn -Prelease source:jar javadoc:jar deploy -Dgpg.passphrase=thephrase
                    ====================================================================================
                    -->
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.5.1</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>sonatype-server</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <stagingProfileId/>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
