<!--

    Copyright (C) 2014 Stratio (http://stratio.com)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<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.stratio</groupId>
    <artifactId>parent</artifactId>
    <version>0.7.1</version>
    <packaging>pom</packaging>
    <description>The Stratio pom</description>
    <name>stratio-parent-pom</name>
    <url>https://github.com/Stratio</url>

    <distributionManagement>
        <repository>
            <id>releases</id>
            <name>Stratio releases</name>
            <url>http://sodio.stratio.com/nexus/content/repositories/releases/</url>
        </repository>
        <snapshotRepository>
            <id>snapshots</id>
            <name>Stratio snapshots</name>
            <url>http://sodio.stratio.com/nexus/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

    <organization>
        <name>Stratio</name>
        <url>http://stratio.com</url>
    </organization>

    <inceptionYear>2015</inceptionYear>

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

    <scm>
        <url>https://github.com/Stratio/</url>
        <connection>scm:git:git@github.com:Stratio/stratio-parent.git</connection>
        <developerConnection>scm:git:git@github.com:Stratio/stratio-parent.git
        </developerConnection>
        <tag>HEAD</tag>
    </scm>
    
    <properties>
        <confluence.version></confluence.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.sonarsource.java</groupId>
            <artifactId>sonar-jacoco-listeners</artifactId>
            <version>3.7.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.sonarsource.java</groupId>
                <artifactId>sonar-jacoco-listeners</artifactId>
                <version>3.7.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>6.9.9</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <developers>
        <developer>
            <id>jdelgado</id>
            <name>Javier Delgado</name>
            <email>jdelgado@stratio.com</email>
            <roles>
                <role>architect</role>
                <role>developer</role>
                <role>maintainer</role>
            </roles>
        </developer>
    </developers>
    
    <build>
        <extensions>            
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
                <version>2.10</version>
            </extension>
        </extensions>
        
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.7.5.201505241946</version>
                    <configuration>
                        <dataFile>${jacoco.dataFile}</dataFile>
                        <includes>                    
                            <include>com/stratio/**</include>
                        </includes>
                    </configuration>
                    <executions>
                        <execution>
                            <id>unit-test-coverage</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                            <configuration>
                                <skip>${skipUTs}</skip>
                                <destFile>${basedir}/target/jacocoUT.exec</destFile>
                                <propertyName>jacoco-UT-argline</propertyName>
                            </configuration>
                        </execution>
                        <execution>
                            <id>integration-test-coverage</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                            <configuration>
                                <skip>${skipITs}</skip>
                                <destFile>${basedir}/target/jacocoIT.exec</destFile>
                                <propertyName>jacoco-IT-argline</propertyName>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.18.1</version>
                    <configuration>
                        <skipTests>${skipITs}</skipTests>
                        <argLine>
                            ${jacoco-IT-argline}
                        </argLine>
                        <reportsDirectory>${project.build.directory}/failsafe-reports</reportsDirectory>
                        <properties>
                            <property>
                                <name>listener</name>
                                <value>org.sonar.java.jacoco.JUnitListener</value>
                            </property>
                        </properties>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.18.1</version>
                    <configuration>
                        <skipTests>${skipUTs}</skipTests>
                        <argLine>
                            ${jacoco-UT-argline}
                        </argLine>
                        <properties>
                            <property>
                                <name>listener</name>
                                <value>org.sonar.java.jacoco.JUnitListener</value>
                            </property>
                        </properties>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>2.11</version>
                    <configuration>
                        <mapping>
                            <java>SLASHSTAR_STYLE</java>
                            <scala>SLASHSTAR_STYLE</scala>
                        </mapping>
                        <useDefaultExcludes>true</useDefaultExcludes>
                        <header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</header>
                        <properties>
                            <owner>${project.organization.name}</owner>
                            <email>${project.organization.url}</email>
                            <failOnMissingHeader>true</failOnMissingHeader>
                        </properties>
                        <includes>
                            <include>**/src/**</include>
                        </includes>
                        <excludes>
                            <exclude>**/.*/**</exclude>
                            <exclude>**/_themes/stratio/**</exclude>
                            <exclude>**/*.rst</exclude>
                            <exclude>**/*.feature</exclude>
                            <exclude>**/README*</exclude>
                            <exclude>**/node*/**</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>net.alchim31.maven</groupId>
                    <artifactId>scala-maven-plugin</artifactId>
                    <version>3.2.2</version>
                    <configuration>
                        <checkMultipleScalaVersions>false</checkMultipleScalaVersions>
                        <recompileMode>modified-only</recompileMode>
                    </configuration>
                    <executions>
                        <execution>
                            <id>default</id>
                            <goals>
                                <goal>add-source</goal>
                                <goal>compile</goal>
                                <goal>testCompile</goal>
                                <goal>doc</goal>
                                <goal>doc-jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.5</version>
                    <configuration>
                        <useIncrementalCompilation>false</useIncrementalCompilation>
                    </configuration>
                </plugin>            
                <plugin>
                <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.10</version>
                    <executions>
                        <execution>
                            <id>parse-version</id>
                            <goals>
                                <goal>parse-version</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>confluence-property</id>
                            <goals>
                                <goal>regex-property</goal>
                            </goals>
                            <configuration>
                              <name>confluence.version</name>
                              <value>${parsedVersion.majorVersion}x${parsedVersion.minorVersion}</value>
                              <regex>.</regex>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <profiles>
        <profile>
            <id>sonatype</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
