<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>${version.scalafmt}</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>
        <developer>
            <name>Eric Casteleijn</name>
            <email>mumpsimus@simple.com</email>
            <organization>simple.com</organization>
            <organizationUrl>http://simple.com</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>
        <version.commonslang>2.6</version.commonslang>
        <version.java>1.7</version.java>
        <version.maven.annotations>3.4</version.maven.annotations>
        <version.maven.plugin.compiler>2.0.2</version.maven.plugin.compiler>
        <version.maven.plugin.gpg>1.6</version.maven.plugin.gpg>
        <version.maven.plugin.nexus.staging>1.6.3</version.maven.plugin.nexus.staging>
        <version.maven.plugin.scala>3.2.1</version.maven.plugin.scala>
        <version.maven>3.3.9</version.maven>
        <version.scala.binary>2.11</version.scala.binary>
        <version.scala>2.11.8</version.scala>
        <version.scalafmt>0.6.8</version.scalafmt>
        <version.scalatest>3.0.3</version.scalatest>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${version.scala}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${version.maven}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>${version.maven.annotations}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.geirsson</groupId>
            <artifactId>scalafmt-core_${version.scala.binary}</artifactId>
            <version>${version.scalafmt}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.geirsson</groupId>
            <artifactId>scalafmt-cli_${version.scala.binary}</artifactId>
            <version>${version.scalafmt}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>${version.commonslang}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_${version.scala.binary}</artifactId>
            <version>${version.scalatest}</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>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>net.alchim31.maven</groupId>
                            <artifactId>scala-maven-plugin</artifactId>
                            <version>${version.maven.plugin.scala}</version>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-compiler-plugin</artifactId>
                            <version>${version.maven.plugin.compiler}</version>
                            <configuration>
                                <source>${version.java}</source>
                                <target>${version.java}</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-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>
        <profile>
            <id>release</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>net.alchim31.maven</groupId>
                            <artifactId>scala-maven-plugin</artifactId>
                            <version>${version.maven.plugin.scala}</version>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-compiler-plugin</artifactId>
                            <version>${version.maven.plugin.compiler}</version>
                            <configuration>
                                <source>${version.java}</source>
                                <target>${version.java}</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>${version.maven.plugin.gpg}</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>${version.maven.plugin.nexus.staging}</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>
