<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ Copyright 2012 Tony Chemit
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<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>
    <artifactId>keytool</artifactId>
    <groupId>org.codehaus.mojo</groupId>
    <version>1.5</version>
  </parent>

  <artifactId>keytool-maven-plugin</artifactId>
  <packaging>maven-plugin</packaging>
  <name>Keytool: Maven Plugin</name>
  <description>
    A plugin that wraps the keytool program bundled with Sun's Java SDK. Allows to manipulate keystores.
  </description>

  <prerequisites>
    <maven>${mavenVersion}</maven>
  </prerequisites>

  <inceptionYear>2005</inceptionYear>

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

    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
    </dependency>

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>keytool-api</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-shared-utils</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-toolchain</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>

  </dependencies>

  <build>

    <plugins>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-maven-plugin</artifactId>
        <configuration>
          <signature>
            <groupId>org.codehaus.mojo.signature</groupId>
            <artifactId>java15</artifactId>
            <version>1.0</version>
          </signature>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-plugin-plugin</artifactId>
        <configuration>
          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
        </configuration>
        <executions>
          <execution>
            <id>generate-descriptor</id>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>

  </build>

  <profiles>

    <profile>
      <id>api-1.5</id>
      <activation>
        <jdk>1.5</jdk>
      </activation>

      <dependencies>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>keytool-api-1.5</artifactId>
          <version>${project.version}</version>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>api-1.6</id>
      <activation>
        <jdk>1.6</jdk>
      </activation>
      <dependencies>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>keytool-api-1.6</artifactId>
          <version>${project.version}</version>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>api-1.7</id>
      <activation>
        <jdk>[1.7,)</jdk>
      </activation>
      <dependencies>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>keytool-api-1.7</artifactId>
          <version>${project.version}</version>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>api-1.8</id>
      <activation>
        <jdk>1.8</jdk>
      </activation>
      <dependencies>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>keytool-api-1.7</artifactId>
          <version>${project.version}</version>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>run-its</id>
      <activation>
        <property>
          <name>maven.test.skip</name>
          <value>!true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-invoker-plugin</artifactId>
            <configuration>
              <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
              <settingsFile>src/it/settings.xml</settingsFile>
              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>install</goal>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>reporting</id>
      <activation>
        <property>
          <name>skipReports</name>
          <value>!true</value>
        </property>
      </activation>

      <reporting>
        <plugins>
          <plugin>
            <artifactId>maven-plugin-plugin</artifactId>
            <version>${pluginPluginVersion}</version>
            <configuration>
              <requirements>
                <!--
                NOTE: Maven 2.x does not interpolate properties of the form project.*|pom.* so the Maven Plugin Plugin
                gets garbage when manually examining the config of the Maven Compiler Plugin.
                -->
                <jdk>${mojo.java.target}</jdk>
              </requirements>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>1.5</version>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>l10n-maven-plugin</artifactId>
            <version>1.0-alpha-2</version>
            <configuration>
              <locales>
                <locale>fr</locale>
              </locales>
            </configuration>
          </plugin>
        </plugins>
      </reporting>
    </profile>

  </profiles>

</project>
