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

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>9</version>
  </parent>

  <groupId>com.github.sevntu-checkstyle</groupId>
  <artifactId>sevntu-checkstyle-maven-plugin</artifactId>
  <name>Sevntu Checkstyle Maven Plugin</name>
  <version>1.28.0</version>

  <licenses>
    <license>
      <name>LGPL-2.1+</name>
      <url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt</url>
    </license>
  </licenses>

  <dependencies>
    <dependency>
      <groupId>com.github.sevntu-checkstyle</groupId>
      <artifactId>sevntu-checks</artifactId>
      <version>1.28.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-checkstyle-plugin</artifactId>
      <version>2.17</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.2.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.4</version>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <phase>package</phase>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
      </plugin>

      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.8</version>
        <extensions>true</extensions>
        <configuration>
          <!-- serverId is ID of a <server> section from Maven's settings.xml
              to pick authentication information from
          -->
          <serverId>sonatype-nexus-staging</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
          <skipStaging>true</skipStaging>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <profiles>

    <profile>
      <id>local-deploy</id>
      <distributionManagement>
        <repository>
          <id>com.github.sevntu-checkstyle</id>
          <name>Sevntu Checkstyle Maven Plugin</name>
          <url>file://${basedir}/../gh-pages/maven2/</url>
        </repository>
      </distributionManagement>
    </profile>

    <profile>
      <!-- first part of profile is in settings.xml with defined gpg.passphrase and gpg.keyname -->
      <id>gpg</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>
</project>
