<?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">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.codehaus.sonar-plugins</groupId>
        <artifactId>parent</artifactId>
        <version>18</version>
    </parent>

    <groupId>com.ncredinburgh</groupId>
    <artifactId>sonar-scalastyle</artifactId>
    <packaging>sonar-plugin</packaging>
    <version>0.0.3-SNAPSHOT</version>

    <name>Sonar Scalastyle Plugin</name>
    <description>Enables analysis of Scala projects with Scalastyle.</description>
    <inceptionYear>2014</inceptionYear>

    <licenses>
        <license>
            <name>GNU LGPL 3</name>
            <url>http://www.gnu.org/licenses/lgpl.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <sonar.version>4.5.5</sonar.version>
        <sonar.pluginKey>Scalastyle</sonar.pluginKey>
        <sonar.pluginName>Scalastyle</sonar.pluginName>
        <sonar.pluginClass>com.ncredinburgh.sonar.scalastyle.ScalastylePlugin</sonar.pluginClass>

        <scala.version>2.11.7</scala.version>
        <scala.major.version>2.11</scala.major.version>

        <!-- needed? -->
        <sonar.language>scala</sonar.language>
    </properties>

    <dependencies>


        <dependency>
            <groupId>org.codehaus.sonar</groupId>
            <artifactId>sonar-plugin-api</artifactId>
            <version>${sonar.version}</version>
        </dependency>

        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.version}</version>
        </dependency>

        <dependency>
            <groupId>org.scalastyle</groupId>
            <artifactId>scalastyle_${scala.major.version}</artifactId>
            <version>0.8.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.scala-lang</groupId>
                    <artifactId>scala-library</artifactId>
                </exclusion>
            </exclusions>
        </dependency>


        <!-- Annotations used in sonar api. Scalac errors if it can't find them -->
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>3.0.0</version>
            <scope>provided</scope>
        </dependency>

        <!-- Will compile without but generates warnings -->
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-project</artifactId>
            <version>2.2.1</version>
            <scope>provided</scope>
        </dependency>


        <!-- unit tests -->
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_${scala.major.version}</artifactId>
            <version>2.2.5</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.scala-lang</groupId>
                    <artifactId>scala-library</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

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

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

        <dependency>
            <groupId>org.codehaus.sonar</groupId>
            <artifactId>sonar-core</artifactId>
            <version>${sonar.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>net.alchim31.maven</groupId>
                    <artifactId>scala-maven-plugin</artifactId>
                    <version>3.2.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.18.1</version>
                </plugin>

            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>compile</id>
                        <goals>
                            <goal>add-source</goal>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <jvmArgs>
                                <jvmArg>-Xms64m</jvmArg>
                                <jvmArg>-Xmx1024m</jvmArg>
                            </jvmArgs>
                            <args>
                                <arg>-g:vars</arg>
                                <arg>-unchecked</arg>
                                <arg>-deprecation</arg>
                            </args>
                        </configuration>
                    </execution>
                    <execution>
                        <id>test</id>
                        <goals>
                            <goal>add-source</goal>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <includes>
                        <include>**/*Spec.java</include>
                    </includes>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>