<?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>
    <artifactId>scala-masterpom_2.10</artifactId>
    <packaging>pom</packaging>
    <version>1.1.2</version>
    <name>scala-masterpom</name>
    <description>master pom for scala projects.</description>
    <licenses>
      <license>
        <name>Apache License, Version 2.0</name>
        <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        <distribution>repo</distribution>
        <comments>A business-friendly OSS license</comments>
      </license>
    </licenses>
    <parent>
        <groupId>tw.hyl.common</groupId>
        <artifactId>masterpom</artifactId>
        <version>1.1.2</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <scm>
      <developerConnection>scm:git:git@github.com:yunglin/common-masterpom.git</developerConnection>
      <url>http://github.com/yunglin/common-masterpom</url>
      <tag>scala-masterpom_2.10-1.1.2</tag>
  </scm>
    <properties>
        <version.scala>2.10.6</version.scala>
        <version.scala.lib>2.10</version.scala.lib>
        <version.maven.scala>3.1.6</version.maven.scala>
        <version.maven.scalariform>0.1.2</version.maven.scalariform>
        <version.maven.scalastyle>0.2.0</version.maven.scalastyle>
        <version.maven.scoverage>1.0.4</version.maven.scoverage>
    </properties>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.scalariform</groupId>
                    <artifactId>scalariform-maven-plugin</artifactId>
                    <version>${version.maven.scalariform}</version>
                    <executions>
                        <execution>
                            <phase>process-sources</phase>
                            <goals>
                                <goal>format</goal>
                            </goals>
                            <configuration>
                                <alignParameters>true</alignParameters>
                                <alignSingleLineCaseStatements>true</alignSingleLineCaseStatements>
                                <doubleIndentClassDeclaration>true</doubleIndentClassDeclaration>
                                <preserveDanglingCloseParenthesis>true</preserveDanglingCloseParenthesis>
                                <indentSpaces>4</indentSpaces>
                                <indentPackageBlocks>true</indentPackageBlocks>
                                <spacesWithinPatternBinders>true</spacesWithinPatternBinders>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>${version.maven.scala}</version>
                <configuration>
                    <scalaVersion>${version.scala}</scalaVersion>
                    <args>
                        <arg>-encoding</arg>
                        <arg>UTF-8</arg>
                        <arg>-target:jvm-1.6</arg>
                        <arg>-deprecation</arg>
                        <arg>-feature</arg>
                        <arg>-unchecked</arg>
                        <arg>-Ywarn-adapted-args</arg>
                    </args>
                    <jvmArgs>
                        <jvmArg>-Xms256m</jvmArg>
                        <jvmArg>-Xmx768m</jvmArg>
                    </jvmArgs>
                </configuration>
                <executions>
                    <execution>
                        <id>scala-compile</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>add-source</goal>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>scala-test-compile</id>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${version.maven.surefire}</version>
                <configuration>
                    <includes>
                        <include>**/*Test.scala</include>
                        <include>**/*Test.java</include>
                        <include>**/*Spec.scala</include>
                        <include>**/*Spec.java</include>
                    </includes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.scoverage</groupId>
                <artifactId>scoverage-maven-plugin</artifactId>
                <version>${version.maven.scoverage}</version>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.alchim31.maven</groupId>
                        <artifactId>scala-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>scala-compile</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>add-source</goal>
                                    <goal>compile</goal>
                                </goals>
                                <configuration>
                                    <args>
                                        <arg>-g:vars</arg>
                                    </args>
                                </configuration>
                            </execution>
                            <execution>
                                <id>scala-test-compile</id>
                                <phase>process-test-resources</phase>
                                <goals>
                                    <goal>testCompile</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>org.scoverage</groupId>
                    <artifactId>scalac-scoverage-plugin_${version.scala.lib}</artifactId>
                    <version>${version.scoverage}</version>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
    <dependencies>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${version.scala}</version>
        </dependency>
    </dependencies>
    <reporting>
        <plugins>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>${version.maven.scala}</version>
            </plugin>
            <plugin>
                <groupId>org.scoverage</groupId>
                <artifactId>maven-scoverage-plugin</artifactId>
                <version>${version.maven.scoverage}</version>
            </plugin>
        </plugins>
    </reporting>
    <repositories>
        <repository>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>typesafe-central</id>
            <name>typesafe-releases</name>
            <url>http://repo.typesafe.com/typesafe/releases</url>
        </repository>
        <repository>
            <snapshots />
            <id>typesafe-snapshots</id>
            <name>typesafe-snapshots</name>
            <url>http://repo.typesafe.com/typesafe/snapshots</url>
        </repository>
    </repositories>
</project>
