<?xml version="1.0"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You 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>apache-rat-project</artifactId>
    <groupId>org.apache.rat</groupId>
    <version>0.18</version>
  </parent>
  <artifactId>apache-rat-plugin</artifactId>
  <packaging>maven-plugin</packaging>
  <name>Apache Creadur RAT::Plugin4Maven</name>
  <description>A plugin for Apache Maven that runs Apache RAT
    to audit the source to be distributed.</description>
  <inceptionYear>2007</inceptionYear>
  <prerequisites>
    <maven>${mavenMinVersion}</maven>
  </prerequisites>
  <properties>
    <currentVersion>${project.version}</currentVersion>
    <doxiaVersion>2.0.0</doxiaVersion>
  </properties>
  <build>
    <resources>
      <resource>
        <filtering>false</filtering>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <filtering>true</filtering>
        <directory>src/main/filtered-resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/filtered-resources</directory>
        <filtering>true</filtering>
      </testResource>
    </testResources>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-plugin-plugin</artifactId>
          <configuration>
            <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
            <goalPrefix>apache-rat</goalPrefix>
            <!-- RAT-451: Generate into the same package as other auto-generated code -->
            <helpPackageName>org.apache.rat.plugin</helpPackageName>
          </configuration>
          <executions>
            <execution>
              <id>mojo-descriptor</id>
              <goals>
                <goal>descriptor</goal>
              </goals>
            </execution>
            <!-- to generate help goal -->
            <execution>
              <id>help-goal</id>
              <goals>
                <goal>helpmojo</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.rat</groupId>
          <artifactId>apache-rat-plugin</artifactId>
          <configuration>
            <inputExcludes>
              <!-- Generated by Eclipse, and not distributed, so ignorable. -->
              <exclude>bin/**/*</exclude>
              <exclude>.externalToolBuilders/**/*</exclude>
              <!-- These files do not have license headers because they are used to test license headers -->
              <exclude>src/it/**</exclude>
              <exclude>src/it/**/src.apt</exclude>
              <exclude>src/test/resources/unit/**</exclude>
              <exclude>**/*.iml</exclude>
              <!-- these files are generated -->
              <exclude>src/site/apt/*.txt</exclude>
              <!-- These files have a custom license header (non Apache) to test validating custom licenses -->
              <exclude>src/it/CustomLicense/src/**/</exclude>
              <!-- RAT-171: needs to be added since SCM ignores are only parsed in project root -->
              <exclude>**/.bzrignore</exclude>
              <exlcude>invoker_target/**</exlcude>
              <exclude>src/test/resources/XmlOutputExamples/**/*</exclude>
            </inputExcludes>
          </configuration>
        </plugin>
        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <versionRange>[3.3,)</versionRange>
                    <goals>
                      <goal>descriptor</goal>
                      <goal>helpmojo</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <versionRange>[3.5.0,)</versionRange>
                    <goals>
                      <goal>java</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-release-notes</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/META-INF</outputDirectory>
              <overwrite>true</overwrite>
              <resources>
                <resource>
                  <directory>${project.basedir}/..</directory>
                  <includes>
                    <include>RELEASE_NOTES.txt</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>Create BaseRatMojo</id>
            <goals>
              <goal>java</goal>
            </goals>
            <phase>generate-sources</phase>
            <configuration>
              <mainClass>org.apache.rat.tools.MavenGenerator</mainClass>
              <classpathScope>test</classpathScope>
              <arguments>
                <argument>org.apache.rat.plugin</argument>
                <argument>BaseRatMojo</argument>
                <argument>${project.build.sourceDirectory}</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>Initial site generation</id>
            <phase>pre-site</phase>
            <goals>
              <goal>java</goal>
            </goals>
            <configuration>
              <mainClass>org.apache.rat.documentation.Exporter</mainClass>
              <classpathScope>test</classpathScope>
              <arguments>
                <argument>${project.basedir}/src/templates</argument>
                <argument>${project.basedir}/src/site</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <environmentVariables>
            <LANG>en_US</LANG>
          </environmentVariables>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-report-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-invoker-plugin</artifactId>
        <configuration>
          <cloneProjectsTo>${project.build.directory}/invoker_target</cloneProjectsTo>
          <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
          <addTestClassPath>true</addTestClassPath>
          <settingsFile>src/it/settings.xml</settingsFile>
          <postBuildHookScript>verify</postBuildHookScript>
        </configuration>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals>
              <goal>install</goal>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
          <filesets>
            <fileset>
              <directory>invoker_target</directory>
              <followSymlinks>false</followSymlinks>
            </fileset>
            <fileset>
              <directory>src/main/java/org/apache/rat/plugin/</directory>
              <includes>
                <include>BaseRatMojo.java</include>
              </includes>
              <followSymlinks>false</followSymlinks>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
          <consoleOutput>true</consoleOutput>
          <failsOnError>true</failsOnError>
          <failOnViolation>true</failOnViolation>
          <violationSeverity>warning</violationSeverity>
          <excludeGeneratedSources>true</excludeGeneratedSources>
          <configLocation>../src/conf/checkstyle.xml</configLocation>
          <suppressionsLocation>../src/conf/checkstyle-suppressions.xml</suppressionsLocation>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>compile</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>commons-cli</groupId>
      <artifactId>commons-cli</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.rat</groupId>
      <artifactId>apache-rat-core</artifactId>
    </dependency>
    <!-- rat tools in test scope so that it does not get bundled into the plugin -->
    <dependency>
      <groupId>org.apache.rat</groupId>
      <artifactId>apache-rat-tools</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.rat</groupId>
      <artifactId>apache-rat-core</artifactId>
      <type>test-jar</type>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.vintage</groupId>
      <artifactId>junit-vintage-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-artifact</artifactId>
      <version>${mavenVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model</artifactId>
      <version>${mavenVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${mavenVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-settings</artifactId>
      <version>${mavenVersion}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-compat</artifactId>
      <version>${mavenVersion}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.doxia</groupId>
      <artifactId>doxia-core</artifactId>
      <version>${doxiaVersion}</version>
      <exclusions>
        <exclusion>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-container-default</artifactId>
        </exclusion>
        <exclusion>
          <groupId>xerces</groupId>
          <artifactId>xercesImpl</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.doxia</groupId>
      <artifactId>doxia-site-model</artifactId>
      <version>${doxiaVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.doxia</groupId>
      <artifactId>doxia-module-xhtml5</artifactId>
      <version>${doxiaVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.doxia</groupId>
      <artifactId>doxia-sink-api</artifactId>
      <version>${doxiaVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.doxia</groupId>
      <artifactId>doxia-integration-tools</artifactId>
      <version>${doxiaVersion}</version>
      <exclusions>
        <exclusion>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-container-default</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.doxia</groupId>
      <artifactId>doxia-site-renderer</artifactId>
      <version>${doxiaVersion}</version>
      <exclusions>
        <exclusion>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-container-default</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.reporting</groupId>
      <artifactId>maven-reporting-api</artifactId>
      <version>4.0.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-shared-utils</artifactId>
      <version>3.4.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-testing</groupId>
      <artifactId>maven-plugin-testing-harness</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-testing</artifactId>
      <version>2.1.0</version>
      <exclusions>
        <exclusion>
          <!-- we need as optional dependencies -->
          <groupId>org.junit.jupiter</groupId>
          <artifactId>junit-jupiter-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
      <version>3.6.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>
  </dependencies>
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>${mavenPluginPluginVersion}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-report-plugin</artifactId>
        <version>${mavenPluginPluginVersion}</version>
      </plugin>
    </plugins>
  </reporting>
</project>
