<?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>net.intelie.pipes</groupId>
    <artifactId>pipes-api</artifactId>
    <version>0.24.4</version>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <gpg.executable>gpg2</gpg.executable>
    </properties>

    <name>Pipes API</name>
    <description>Intelie Pipes' API classes and interfaces</description>
    <url>http://pipes.intelie.com/</url>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Juan Lopes</name>
            <email>juan.lopes@intelie.com.br</email>
            <organization>Intelie</organization>
            <organizationUrl>http://www.intelie.com</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/intelie/pipes.git</connection>
        <developerConnection>scm:git:ssh://github.com:intelie/pipes.git</developerConnection>
        <url>http://github.com/intelie/pipes/tree/master</url>
    </scm>

    <dependencies>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.8.6</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>29.0-jre</version>
            <scope>test</scope>
        </dependency>


        <dependency>
            <groupId>net.intelie.introspective</groupId>
            <artifactId>introspective</artifactId>
            <version>0.10</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.16.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>1.10.19</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
            </plugin>

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


            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <outputDirectory>${project.build.directory}/cobertura</outputDirectory>
                    <formats>
                        <format>html</format>
                        <format>xml</format>
                    </formats>
                    <check/>
                    <instrumentation>
                        <exclude>net/intelie/pipes/generated/**/*</exclude>
                    </instrumentation>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/main/generated</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>javacc-maven-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <errorReporting>true</errorReporting>
                    <sourceDirectory>../pipes-api/src/main/java/net/intelie/pipes/grammars</sourceDirectory>
                    <outputDirectory>${project.basedir}/src/main/generated</outputDirectory>
                    <userCharStream>true</userCharStream>
                </configuration>
                <executions>
                    <execution>
                        <id>javacc</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>javacc</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <!-- this is just to workaround a performance problem in javacc generated code -->
                <groupId>com.google.code.maven-replacer-plugin</groupId>
                <artifactId>replacer</artifactId>
                <version>1.5.3</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>replace</goal>
                        </goals>
                        <configuration>
                            <includes>
                                <file>
                                    ${project.basedir}/src/main/generated/net/intelie/pipes/generated/PipeParserCore.java
                                </file>
                                <file>
                                    ${project.basedir}/src/main/generated/net/intelie/pipes/generated/FilterParserCore.java
                                </file>
                                <file>
                                    ${project.basedir}/src/main/generated/net/intelie/pipes/generated/TimeSpanParserCore.java
                                </file>
                            </includes>
                            <replacements>
                                <replacement>
                                    <token>final private LookaheadSuccess jj_ls</token>
                                    <value>final static private LookaheadSuccess jj_ls</value>
                                </replacement>
                            </replacements>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>de.thetaphi</groupId>
                <artifactId>forbiddenapis</artifactId>
                <version>3.0</version>
                <configuration>
                    <bundledSignatures>
                        <bundledSignature>jdk-unsafe</bundledSignature>
                        <bundledSignature>jdk-deprecated</bundledSignature>
                        <bundledSignature>jdk-internal</bundledSignature>
                        <bundledSignature>jdk-non-portable</bundledSignature>
                        <bundledSignature>jdk-system-out</bundledSignature>
                        <bundledSignature>jdk-reflection</bundledSignature>
                    </bundledSignatures>
                    <excludes>
                        <exclude>net/intelie/pipes/generated/**</exclude>
                    </excludes>
                    <suppressAnnotations>
                        <suppressAnnotation>net.intelie.pipes.util.SuppressForbidden</suppressAnnotation>
                    </suppressAnnotations>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                            <goal>testCheck</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>

            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
            </distributionManagement>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>

                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.1</version>
                        <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>
                        <version>2.9.1</version>
                        <configuration>
                            <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                        <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>
                        <version>1.6.7</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>


</project>
