<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>
    <groupId>org.antipathy</groupId>
    <artifactId>mvn-scalafmt</artifactId>
    <packaging>maven-plugin</packaging>
    <version>0.1</version>
    <name>Scalafmt Maven Plugin</name>
    <description>Maven plugin for ScalaFmt</description>
    <url>https://github.com/SimonJPegg/mvn_scalafmt</url>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://github.com/SimonJPegg/mvn_scalafmt/blob/master/LICENSE.md</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Ciaran Kearney</name>
            <email>ciaran@antipathy.org</email>
            <organization>Antipathy.org</organization>
            <organizationUrl>http://www.antipathy.org</organizationUrl>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/SimonJPegg/mvn_scalafmt</url>
        <connection>scm:git:git://github.com/SimonJPegg/mvn_scalafmt.git</connection>
        <developerConnection>scm:git:git@github.com/SimonJPegg/mvn_scalafmt.git</developerConnection>
    </scm>

    <properties>
        <maven.version>3.3.9</maven.version>
        <maven.annotations.version>3.4</maven.annotations.version>
        <scala.version>2.11.2</scala.version>
        <scala.major.version>2.11</scala.major.version>
        <scalafmt.version>0.6.5</scalafmt.version>
        <commonslang.verson>2.6</commonslang.verson>
        <scala-maven-plugin.version>3.2.1</scala-maven-plugin.version>
        <maven-compiler-plugin.version>2.0.2</maven-compiler-plugin.version>
        <java.version>1.7</java.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.3</nexus-staging-maven-plugin.version>
        <scalatest.version>2.2.4</scalatest.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${maven.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>${maven.annotations.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.geirsson</groupId>
            <artifactId>scalafmt-core_${scala.major.version}</artifactId>
            <version>${scalafmt.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.geirsson</groupId>
            <artifactId>scalafmt-cli_${scala.major.version}</artifactId>
            <version>${scalafmt.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>${commonslang.verson}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_${scala.major.version}</artifactId>
            <version>${scalatest.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

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

    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>net.alchim31.maven</groupId>
                            <artifactId>scala-maven-plugin</artifactId>
                            <version>${scala-maven-plugin.version}</version>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-compiler-plugin</artifactId>
                            <version>${maven-compiler-plugin.version}</version>
                            <configuration>
                                <source>${java.version}</source>
                                <target>${java.version}</target>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>net.alchim31.maven</groupId>
                        <artifactId>scala-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>scala-compile-first</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-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>

                    <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-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
