<?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/maven-v4_0_0.xsd">

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <groupId>ro.pippo</groupId>
    <artifactId>pippo-parent</artifactId>
    <packaging>pom</packaging>
    <version>1.14.0</version>
    <name>Pippo Parent</name>
    <description>Micro java web framework</description>
    <url>https://pippo.ro</url>

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

    <scm>
        <connection>scm:git:https://github.com/pippo-java/pippo.git</connection>
        <developerConnection>scm:git:git@github.com:pippo-java/pippo.git</developerConnection>
        <url>git@github.com/pippo-java/pippo.git</url>
        <tag>release-1.14.0</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>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <jaxb.version>2.3.1</jaxb.version>
        <xml.bind.version>2.3.0.1</xml.bind.version>

        <servlet.version>3.0.1</servlet.version>
        <slf4j.version>1.7.25</slf4j.version>
        <metrics.version>4.0.2</metrics.version>

        <junit.version>4.13</junit.version>
        <mockito.version>2.24.0</mockito.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>UTF-8</encoding>
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>
                </configuration>
                <inherited>true</inherited>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!-- workaround for https://bugs.openjdk.java.net/browse/JDK-8212233 -->
                    <javaApiLinks>
                        <property>
                            <name>foo</name>
                            <value>bar</value>
                        </property>
                    </javaApiLinks>
                    <doclint>none</doclint>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <goals>deploy</goals>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <tagNameFormat>release-@{project.version}</tagNameFormat>
                </configuration>
            </plugin>

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

        <resources>
            <resource>
                <filtering>false</filtering>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <filtering>false</filtering>
                <directory>src/main/java</directory>
                <includes>
                    <include>**</include>
                </includes>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>

        <testResources>
            <testResource>
                <filtering>false</filtering>
                <directory>src/test/resources</directory>
            </testResource>
            <testResource>
                <filtering>false</filtering>
                <directory>src/test/java</directory>
                <includes>
                    <include>**</include>
                </includes>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </testResource>
        </testResources>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.ocpsoft.prettytime</groupId>
                <artifactId>prettytime</artifactId>
                <version>3.2.5.Final</version>
            </dependency>
            <dependency>
                <groupId>org.kohsuke.metainf-services</groupId>
                <artifactId>metainf-services</artifactId>
                <version>1.7</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <modules>
        <module>pippo</module>
        <module>pippo-core</module>
        <module>maven-archetypes/quickstart</module>
        <module>pippo-test</module>
        <module>pippo-session-parent</module>
        <module>pippo-metrics-parent</module>
        <module>pippo-template-parent</module>
        <module>pippo-content-type-parent</module>
        <module>pippo-server-parent</module>
        <module>pippo-controller-parent</module>
        <module>pippo-css-parent</module>
        <module>pippo-security-parent</module>
    </modules>

    <profiles>
        <profile>
            <id>coverage</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.8.5</version>
                        <executions>
                            <execution>
                                <id>prepare-agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>sonar</id>
            <properties>
                <sonar.host.url>https://sonarcloud.io</sonar.host.url>
                <sonar.organization>pippo-java</sonar.organization>
                <sonar.projectKey>pippo-java_pippo</sonar.projectKey>
                <sonar.projectName>pippo</sonar.projectName>
                <sonar.moduleKey>${project.groupId}:${project.artifactId}</sonar.moduleKey>
            </properties>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonarsource.scanner.maven</groupId>
                        <artifactId>sonar-maven-plugin</artifactId>
                        <version>3.9.1.2184</version>
                        <executions>
                            <execution>
                                <id>sonar</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sonar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
