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

<!-- 
 Codehaus License Maven Plugin
     
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/lgpl-3.0.html>.
-->

<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">
  <parent>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>mojo-parent</artifactId>
    <version>28</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>license-maven-plugin</artifactId>
  <packaging>maven-plugin</packaging>
  <name>License Maven Plugin</name>
  <version>1.0</version>
  <description>Maven plugin to download and collect license files from project dependencies.</description>

  <scm>
    <connection>scm:svn:http://svn.codehaus.org/mojo/tags/license-maven-plugin-1.0</connection>
    <developerConnection>scm:svn:https://svn.codehaus.org/mojo/tags/license-maven-plugin-1.0</developerConnection>
    <url>http://fisheye.codehaus.org/browse/mojo/tags/license-maven-plugin-1.0</url>
  </scm>

  <issueManagement>
    <system>JIRA</system>
    <url>http://jira.codehaus.org/browse/MLICENSE</url>
  </issueManagement>

  <inceptionYear>2010</inceptionYear>
  <licenses>
    <license>
      <name>The GNU Lesser General Public License, Version 3.0</name>
      <url>http://www.gnu.org/licenses/lgpl-3.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <prerequisites>
    <maven>2.2.1</maven>
  </prerequisites>

  <properties>
    <mojo.java.target>1.5</mojo.java.target>
    <mavenVersion>2.2.1</mavenVersion>
    <processorVersion>1.2.2</processorVersion>
    <pluginPluginVersion>2.5.1</pluginPluginVersion>
    <javadocPluginVersion>2.7</javadocPluginVersion>

    <!-- versions of javadoc tagglets -->
    <mavenPluginToolsJavadocVersion>2.5.1</mavenPluginToolsJavadocVersion>
    <plexusComponentJavadocVersion>1.3.0</plexusComponentJavadocVersion>

  </properties>

  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-project</artifactId>
      <version>${mavenVersion}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-artifact</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${mavenVersion}</version>
      <scope>provided</scope>
      <exclusions>

        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>jcl-over-slf4j</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-cli</groupId>
          <artifactId>commons-cli</artifactId>
        </exclusion>

      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
      <version>1.5.15</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-container-default</artifactId>
      <version>1.0-alpha-9-stable-1</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.nuiton.processor</groupId>
      <artifactId>nuiton-processor</artifactId>
      <version>${processorVersion}</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.5</version>
    </dependency>

    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.1.1</version>
    </dependency>

    <dependency>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
      <version>3.2.1</version>
    </dependency>

    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.16</version>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.2</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>

      <!-- expose new plexus components -->
      <plugin>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-component-metadata</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>generate-metadata</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>create-component-descriptor</id>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-plugin-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-component-metadata</artifactId>
          <version>1.5.5</version>
        </plugin>

        <plugin>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>2.3</version>
        </plugin>

        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${javadocPluginVersion}</version>
          <configuration>
            <charset>${project.reporting.outputEncoding}</charset>
            <links>
              <link>http://download.oracle.com/javase/6/docs/api</link>
            </links>
            <tagletArtifacts>
              <tagletArtifact>
                <groupId>org.apache.maven.plugin-tools</groupId>
                <artifactId>maven-plugin-tools-javadoc</artifactId>
                <version>${mavenPluginToolsJavadocVersion}</version>
              </tagletArtifact>
              <tagletArtifact>
                <groupId>org.codehaus.plexus</groupId>
                <artifactId>plexus-component-javadoc</artifactId>
                <version>${plexusComponentJavadocVersion}</version>
              </tagletArtifact>
            </tagletArtifacts>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <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>
              <debug>false</debug>
            </configuration>
            <executions>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>install</goal>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <pomIncludes>
                    <!--<pomInclude>update-file-header/test-mojo/pom.xml</pomInclude>-->
                    <pomInclude>add-third-party/*/pom.xml</pomInclude>
                    <pomInclude>aggregate-add-third-party/*/pom.xml</pomInclude>
                    <pomInclude>update-file-header/*/pom.xml</pomInclude>
                    <pomInclude>update-project-license/*/pom.xml</pomInclude>
                    <pomInclude>download-licenses/*/pom.xml</pomInclude>
                  </pomIncludes>
                  <pomExcludes>
                    <pomExclude>download-licenses/MOJO-1674/pom.xml</pomExclude>
                  </pomExcludes>
                </configuration>
              </execution>
              <!-- as this it is run in offline, then execute it after the previous its... -->
              <execution>
                <id>integration-test-offline</id>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <pomIncludes>
                    <pomInclude>download-licenses/MOJO-1674/pom.xml</pomInclude>
                  </pomIncludes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>maven-3</id>
      <activation>
        <file>
          <!--  This employs that the basedir expression is only recognized by Maven 3.x (see MNG-2363) -->
          <exists>${basedir}</exists>
        </file>
      </activation>
      <properties>
        <sitePluginVersion>3.0</sitePluginVersion>
      </properties>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-site-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-descriptor</id>
                <goals>
                  <goal>attach-descriptor</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-invoker-plugin</artifactId>
            <version>1.5</version>
          </plugin>
        </plugins>
      </reporting>
    </profile>

    <profile>
      <id>analyze-dependencies</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <defaultGoal>verify</defaultGoal>
        <plugins>
          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>analyze</id>
                <goals>
                  <goal>analyze-only</goal>
                </goals>
                <configuration>
                  <verbose>true</verbose>
                  <failOnWarning>true</failOnWarning>
                  <ignoreNonCompile>true</ignoreNonCompile>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
