<?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>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.3.5.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

    <groupId>com.github.persapiens</groupId>
    <artifactId>jsf-spring-boot-parent</artifactId>
    <version>1.1.0</version>
    <packaging>pom</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <javax.faces.version>2.2.13</javax.faces.version>
        <omnifaces.version>1.13</omnifaces.version>
        <cdi.version>1.2</cdi.version>
        <primefaces.version>5.3</primefaces.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.7</nexus-staging-maven-plugin.version>
        <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
        
        <findbugs-maven-plugin.version>3.0.3</findbugs-maven-plugin.version>
        <jdepend-maven-plugin.version>2.0</jdepend-maven-plugin.version>
        <maven-pmd-plugin.version>3.6</maven-pmd-plugin.version>
        <maven-javadoc-plugin.version>2.10.3</maven-javadoc-plugin.version>
        <maven-project-info-reports-plugin.version>2.9</maven-project-info-reports-plugin.version>
        <maven-jxr-plugin.version>2.5</maven-jxr-plugin.version>
        <maven-enforcer-plugin.version>1.4.1</maven-enforcer-plugin.version>
        <no-package-cycles-enforcer-rule.version>1.0.5</no-package-cycles-enforcer-rule.version>        
        <maven-failsafe-plugin.version>2.19.1</maven-failsafe-plugin.version>
        <maven-surefire-report-plugin.version>2.19.1</maven-surefire-report-plugin.version>
        <maven-changelog-plugin.version>2.3</maven-changelog-plugin.version>
    </properties>
    
    <modules>
        <module>jsf-spring-boot-autoconfigure</module>
        <module>jsf-spring-boot-starter</module>
    </modules>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${nexus-staging-maven-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven-release-plugin.version}</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>check-pmd-cpd-jdepend-findbugs,attach-test-source-javadoc,sign-artifacts</releaseProfiles>
                    <goals>deploy</goals>
                </configuration>
            </plugin>            
        </plugins>
    </build>    

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>${maven-project-info-reports-plugin.version}</version>
                <configuration>
                    <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>${maven-pmd-plugin.version}</version>
                <configuration>
                    <linkXref>true</linkXref>
                    <targetJdk>${java.source}</targetJdk>
                    <skipEmptyReport>false</skipEmptyReport>
                    <includeTests>true</includeTests>
                    <rulesets>
                        <ruleset>../jsf-spring-boot-autoconfigure/src/main/docs/pmd-ruleset.xml</ruleset>
                    </rulesets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>${findbugs-maven-plugin.version}</version>
                <configuration>
                    <failOnError>true</failOnError>
                    <xmlOutput>true</xmlOutput>
                    <effort>Max</effort>
                    <includeTests>true</includeTests>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jdepend-maven-plugin</artifactId>
                <version>${jdepend-maven-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>${maven-surefire-report-plugin.version}</version>
            </plugin>                    
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>${maven-jxr-plugin.version}</version>
                <configuration>
                    <aggregate>false</aggregate>
                </configuration>
            </plugin>    
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-changelog-plugin</artifactId>
                <version>${maven-changelog-plugin.version}</version>
            </plugin>                    
        </plugins>
    </reporting>
    
    <profiles>        
        <profile>
            <id>attach-test-source-javadoc</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-test</id>
                                <goals>
                                    <goal>test-jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>            

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <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>
                        <configuration>
                            <links>
                                <link>http://docs.oracle.com/javase/8/docs/api/</link>
                            </links>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        
        <profile>
            <id>check-pmd-cpd-jdepend-findbugs</id>
            <build>
                <plugins>    
                    <!-- findbugs -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>findbugs-maven-plugin</artifactId>                
                        <version>${findbugs-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <failOnError>true</failOnError>
                            <includeTests>true</includeTests>
                        </configuration>
                    </plugin>                                               
                                    
                    <!-- 
                        pmd: 
                        cpd: ignorar apenas o que for incluido por projeto
                    -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-pmd-plugin</artifactId>
                        <version>${maven-pmd-plugin.version}</version>
                        <configuration>
                            <skip>false</skip>
                            <printFailingErrors>true</printFailingErrors>
                            <verbose>true</verbose>
                            <includeTests>true</includeTests>
                            <rulesets>
                                <ruleset>../jsf-spring-boot-autoconfigure/src/main/docs/pmd-ruleset.xml</ruleset>
                            </rulesets>
                        </configuration>
                        <executions>
                            <execution>
                                <id>cpd-check</id>
                                <goals>
                                    <goal>cpd-check</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>pmd-check</id>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>    

                    <!--
                        jdepend no package cycles enforcer
                    -->
                    <plugin>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <version>${maven-enforcer-plugin.version}</version>
                        <dependencies>
                            <dependency>
                                <groupId>de.andrena.tools.nopackagecycles</groupId>
                                <artifactId>no-package-cycles-enforcer-rule</artifactId>
                                <version>${no-package-cycles-enforcer-rule.version}</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>enforce-no-package-cycles</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <phase>test</phase>
                                <configuration>
                                    <rules>
                                        <NoPackageCyclesRule implementation="de.andrena.tools.nopackagecycles.NoPackageCyclesRule" />
                                    </rules>
                                    <includeTests>true</includeTests>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>                      
                </plugins>
            </build>
        </profile>
        
        <profile>
            <id>attach-integration-test</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>${maven-failsafe-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>                    
                </plugins>
            </build>
        </profile>
        
        <profile>
            <id>sign-artifacts</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>        
    </profiles>

    <name>JSF Spring Boot Starter Parent</name>
    <description>Starter for building MVC web applications using JSF, Primefaces and Omnifaces</description>
    <url>https://github.com/persapiens/jsf-spring-boot-starter</url>
    <inceptionYear>2016</inceptionYear>

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

    <issueManagement>
        <system>Github</system>
        <url>https://github.com/persapiens/jsf-spring-boot-starter/issues</url>
    </issueManagement>

    <scm>
        <connection>scm:git:https://github.com/persapiens/jsf-spring-boot-starter.git</connection>
        <developerConnection>scm:git:https://github.com/persapiens/jsf-spring-boot-starter.git</developerConnection>
        <url>scm:git:https://github.com/persapiens/jsf-spring-boot-starter.git</url>
        <tag>jsf-spring-boot-parent-1.1.0</tag>
    </scm>

    <organization>
        <name>Persapiens</name>
        <url>https://github.com/persapiens</url>
    </organization>
    
    <developers>
        <developer>
            <id>persapiens</id>
            <name>Marcelo Romulo Fernandes</name>
            <email>persapiens@gmail.com</email>
            <timezone>-3</timezone>
        </developer>
    </developers>
    
    <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>
</project>
