<?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.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
    </parent>
    
    <groupId>pl.wavesoftware</groupId>
    <artifactId>eid-exceptions</artifactId>
    <version>1.1.0</version>
    <packaging>jar</packaging>
    
    <name>EID Runtime Exceptions and Utilities</name>
    <description>
        This small library holds a set of Exceptions that implements idea of fast, reusable, error codes 
        that can be simple thrown fast in case of unpredictable and unrecoverable application failure.
    </description>
    
    <properties>
        <netbeans.hint.license>apache20</netbeans.hint.license>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <sonar.working.directory>${project.build.directory}/sonar</sonar.working.directory>
        <sonar.host.url>https://sonar.wavesoftware.pl</sonar.host.url>
        <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
	<sonar.java.source>6</sonar.java.source>
	<java.source.version>${sonar.java.source}</java.source.version>
        <maven.compiler.source>1.${java.source.version}</maven.compiler.source>
        <maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
        <coveralls.skip>${skipTests}</coveralls.skip>
    </properties>
    
    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    
    <scm>
        <connection>scm:git:https://github.com/wavesoftware/java-eid-exceptions.git</connection>
        <developerConnection>scm:git:git@github.com:wavesoftware/java-eid-exceptions.git</developerConnection>
        <url>https://github.com/wavesoftware/java-eid-exceptions</url>
    </scm>

    <ciManagement>
        <system>travis-ci</system>
        <url>https://travis-ci.org/wavesoftware/java-eid-exceptions</url>
    </ciManagement>
    
    <dependencies>
        
        <!-- Tests -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <!-- Version pin for compatibility with JDK 1.6 -->
            <version>1.7.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>3.0.1</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>1.3</version>
            <scope>test</scope>
            <type>jar</type>
        </dependency>
        
    </dependencies>
    
    <profiles>
        <profile>
            <id>ci</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.7.5.201505241946</version>
                        <executions>
                            <execution>
                                <id>jacoco-initialize</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                    <goal>prepare-agent-integration</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>jacoco-site</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>report</goal>
                                    <goal>report-integration</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <includes>
                                <include>pl/wavesoftware/**</include>
                            </includes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>sonar</id>
            <activation>
                <property>
                    <!-- tries to determine is interactive user session -->
                    <name>env.GDMSESSION</name>
                </property>
            </activation>
            <properties>
                <sonar.analysis.mode>preview</sonar.analysis.mode>
                <sonar.issuesReport.console.enable>true</sonar.issuesReport.console.enable>
                <sonar.issuesReport.html.enable>true</sonar.issuesReport.html.enable>
                <sonar.report.export.path>issues.json</sonar.report.export.path>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.7.5.201505241946</version>
                        <executions>
                            <execution>
                                <id>jacoco-initialize</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                    <goal>prepare-agent-integration</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>jacoco-site</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>report</goal>
                                    <goal>report-integration</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <includes>
                                <include>pl/wavesoftware/**</include>
                            </includes>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>sonar-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>sonar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.codehaus.gmaven</groupId>
                        <artifactId>groovy-maven-plugin</artifactId>
                        <version>2.0</version>
                        <dependencies>
                            <dependency>
                                <groupId>org.codehaus.groovy</groupId>
                                <artifactId>groovy-all</artifactId>
                                <version>2.0.6</version>
                            </dependency>
                        </dependencies>
                        <configuration>
                            <defaults>
                                <sonar.issues.file>${sonar.working.directory}/${sonar.report.export.path}</sonar.issues.file>
                            </defaults>
                            <source>${project.basedir}/src/test/groovy/verify-sonar-issues.groovy</source>
                        </configuration>
                        <executions>
                            <execution>
                                <id>verify-sonar-issues</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>execute</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        
        <profile>
            <id>travis</id>
            <activation>
                <property>
                    <name>env.TRAVIS</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.eluder.coveralls</groupId>
                        <artifactId>coveralls-maven-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <id>coveralls-default</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <compilerArgs>
                        <arg>-Werror</arg>
                        <arg>-Xlint:-deprecation</arg>
                        <arg>-Xlint:all</arg>
                    </compilerArgs>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <useDefaultManifestFile>true</useDefaultManifestFile>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19</version>
                <configuration>
                    <trimStackTrace>false</trimStackTrace>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.19</version>
                <configuration>
                    <trimStackTrace>false</trimStackTrace>
                    <encoding>UTF-8</encoding>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>2.7.1</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    
</project>
