<?xml version="1.0"?>
<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>ch.epfl.scala</groupId>
  <artifactId>bloop-maven-plugin</artifactId>
  <packaging>maven-plugin</packaging>

  <version>2.0.3</version>
  <name>Bloop Maven Plugin</name>
  <description>A Maven plugin which exports your Maven build into a format Bloop can understand.</description>
  <url>https://scalacenter.github.io/bloop/docs/build-tools/maven</url>
  <inceptionYear>2017</inceptionYear>

  <properties>
    <version>${project.version}</version>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.source>1.8</maven.compiler.source>
    <nexus.url>https://oss.sonatype.org</nexus.url>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <version.maven.base>3.9.5</version.maven.base>
    <version.maven.plugin.plugin>3.15.1</version.maven.plugin.plugin>
  </properties>

  <scm>
    <connection>scm:git:https://github.com/scalacenter/bloop-maven-plugin.git</connection>
    <developerConnection>scm:git:https://github.com/scalacenter/bloop-maven-plugin.git</developerConnection>
    <url>https://github.com/scalacenter/bloop-maven-plugin</url>
    <tag>HEAD</tag>
  </scm>

  <ciManagement>
    <system>GitHub Actions</system>
    <url>https://github.com/scalacenter/bloop-maven-plugin/actions</url>
  </ciManagement>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/scalacenter/bloop-maven-plugin/issues</url>
  </issueManagement>

  <distributionManagement>
    <snapshotRepository>
      <id>central</id>
      <url>${nexus.url}/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>central</id>
      <url>${nexus.url}/service/local/staging/deploy/maven2</url>
    </repository>
  </distributionManagement>

  <developers>
    <developer>
      <id>jvican</id>
      <name>Jorge Vicente Cantero</name>
      <email>jorge@vican.me</email>
    </developer>
    <developer>
      <id>Duhemm</id>
      <name>Martin Duhem</name>
      <email>martin.duhem@gmail.com</email>
    </developer>
  </developers>

  <licenses>
    <license>
      <name>Apache-2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>${version.maven.plugin.plugin}</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-maven-plugin</artifactId>
        <version>4.5.3</version>
        <executions>
          <execution>
            <id>mixed-compile</id>
            <phase>process-resources</phase>
            <goals>
              <goal>compile</goal>
              <goal>testCompile</goal>
            </goals>
            <configuration>
              <args>
                <arg>-Wunused:imports</arg>
              </args>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>properties-maven-plugin</artifactId>
        <version>1.1.0</version>
        <executions>
          <execution>
            <phase>generate-resources</phase>
            <goals>
              <goal>write-project-properties</goal>
            </goals>
            <configuration>
              <outputFile>./src/test/resources/bloop.properties</outputFile>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.3.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.6.3</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <doclint>none</doclint>
                  <failOnError>false</failOnError>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>0.9.0</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <autoPublish>true</autoPublish>
              <waitUntil>published</waitUntil>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <dependencies>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-library</artifactId>
      <version>2.13.8</version>
    </dependency>
    <dependency>
      <groupId>ch.epfl.scala</groupId>
      <artifactId>bloop-config_2.13</artifactId>
      <version>2.3.3</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${version.maven.base}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${version.maven.base}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model</artifactId>
      <version>${version.maven.base}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-artifact</artifactId>
      <version>${version.maven.base}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>${version.maven.plugin.plugin}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>net.alchim31.maven</groupId>
      <artifactId>scala-maven-plugin</artifactId>
      <version>4.8.0</version>
      <type>maven-plugin</type>
    </dependency>

    <!-- Test -->
    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-verifier</artifactId>
      <version>1.8.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.github.sbt</groupId>
      <artifactId>junit-interface</artifactId>
      <version>0.13.3</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

</project>
