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

  <groupId>org.honton.chas</groupId>
  <artifactId>exists-maven-plugin</artifactId>
  <version>0.3.0</version>
  <packaging>maven-plugin</packaging>

  <name>Artifact Exists Maven Plugin</name>

  <description>Check if a http resource exists, particularly artifacts in a remote repository</description>
  <url>https://github.com/chonton/exists-maven-plugin</url>
  <inceptionYear>2016</inceptionYear>

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

  <developers>
    <developer>
      <name>chas honton</name>
      <email>chas@honton.org</email>
      <url>https://www.linkedin.com/in/chonton</url>
    </developer>
    <developer>
      <name>Pascal</name>
      <url>https://github.com/pascalgn</url>
    </developer>
  </developers>

  <prerequisites>
    <maven>3.5.0</maven>
  </prerequisites>

  <scm>
    <connection>scm:git:git://github.com/chonton/exists-maven-plugin</connection>
    <developerConnection>scm:git:git@github.com:chonton/exists-maven-plugin</developerConnection>
    <url>https://github.com/chonton/exists-maven-plugin</url>
  </scm>

  <distributionManagement>

    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>

    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>

    <site>
      <id>github</id>
      <url>https://chonton.github.com/exists-maven-plugin/${project.version}</url>
    </site>

  </distributionManagement>

  <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>

    <!-- use org.sonatype.plugins:nexus-staging-maven-plugin instead of org.apache.maven.plugins:maven-deploy-plugin -->
    <maven.deploy.skip>true</maven.deploy.skip>
    <!-- use com.github.github:site-maven-plugin instead of org.apache.maven.plugins:maven-site-plugin -->
    <maven.site.deploy.skip>true</maven.site.deploy.skip>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>25.1-android</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-artifact</artifactId>
      <version>3.0</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>3.6.1</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model</artifactId>
      <version>3.6.1</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>3.6.1</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-settings</artifactId>
      <version>3.6.1</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>3.5.2</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.wagon</groupId>
      <artifactId>wagon-provider-api</artifactId>
      <version>3.2.0</version>
    </dependency>

    <dependency>
      <groupId>org.eclipse.sisu</groupId>
      <artifactId>org.eclipse.sisu.plexus</artifactId>
      <version>0.3.3</version>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>

        <plugin>
          <groupId>com.github.github</groupId>
          <artifactId>site-maven-plugin</artifactId>
          <version>0.12</version>
          <configuration>
            <message>Site documentation</message>
            <path>${project.version}</path>
            <merge>true</merge>
            <server>github</server>
            <repositoryName>exists-maven-plugin</repositoryName>
            <repositoryOwner>chonton</repositoryOwner>
          </configuration>
        </plugin>

        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>

        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version>
        </plugin>

        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>

        <plugin>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>1.6</version>
        </plugin>

        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>3.0.0-M1</version>
        </plugin>

        <plugin>
          <artifactId>maven-invoker-plugin</artifactId>
          <version>3.2.0</version>
          <configuration>
            <preBuildHookScript>clean</preBuildHookScript>
            <postBuildHookScript>verify</postBuildHookScript>
            <addTestClassPath>true</addTestClassPath>
            <settingsFile>src/it/settings.xml</settingsFile>
            <localRepositoryPath>${project.build.directory}/it-repo</localRepositoryPath>
            <filterProperties>
              <webserver.port>1080</webserver.port>
            </filterProperties>
            <properties>
              <settings.security>${project.basedir}/src/it/settings-security.xml</settings.security>
            </properties>
          </configuration>
        </plugin>

        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.1.2</version>
        </plugin>

        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>

        <plugin>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>3.6.0</version>
          <configuration>
            <goalPrefix>exists</goalPrefix>
            <extractors>
              <extractor>java-annotations</extractor>
            </extractors>
          </configuration>
        </plugin>

        <plugin>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>

        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.0.2</version>
        </plugin>

        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.7.1</version>
        </plugin>

        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>

        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.20</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>

      </plugins>

    </pluginManagement>

    <plugins>

      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.0.0-M2</version>
        <executions>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>[1.8,)</version>
                </requireJavaVersion>
                <requireMavenVersion>
                  <version>[3.5,)</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-install-plugin</artifactId>
        <executions>
          <!-- install in earlier than usual phase -->
          <execution>
            <goals>
              <goal>install</goal>
            </goals>
            <phase>integration-test</phase>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-invoker-plugin</artifactId>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals>
              <goal>install</goal>
              <goal>verify</goal>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-plugin-plugin</artifactId>
        <executions>
          <execution>
            <id>default-descriptor</id>
            <phase>process-classes</phase>
          </execution>
          <execution>
            <id>help-goal</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>reserve-network-port</id>
            <goals>
              <goal>reserve-network-port</goal>
            </goals>
            <configuration>
              <portNames>
                <portName>deploy.webserver.port</portName>
              </portNames>
            </configuration>
          </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>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <artifactId>maven-plugin-plugin</artifactId>
      </plugin>

      <plugin>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <report>index</report>
              <report>team</report>
              <report>licenses</report>
              <report>dependency-info</report>
              <report>dependency-management</report>
              <report>distribution-management</report>
              <report>plugin-management</report>
              <report>ci-management</report>
              <report>scm</report>
              <report>summary</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <!-- make sure to release for Java 8 -->
    <profile>
      <id>release for java 8</id>
      <activation>
        <jdk>[9,)</jdk>
      </activation>
      <properties>
        <maven.compiler.release>8</maven.compiler.release>
      </properties>
    </profile>

    <!-- publish site to github,
    1. mvn [clean install] site
    2. mvn -P gh-pages pre-site
    -->
    <profile>
      <id>gh-pages</id>
      <build>
        <plugins>
          <!-- push stage to github gh-pages -->
          <plugin>
            <groupId>com.github.github</groupId>
            <artifactId>site-maven-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>site</goal>
                </goals>
                <phase>pre-site</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- release to maven central
    mvn clean deploy -P release
    -->
    <profile>
      <id>release</id>
      <build>
        <plugins>

          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <goals>
                  <goal>sign</goal>
                </goals>
                <phase>verify</phase>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
          </plugin>

        </plugins>

      </build>
    </profile>
  </profiles>

</project>
