<?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>
    <groupId>org.apache.rat</groupId>
    <artifactId>apache-rat-project</artifactId>
    <version>0.17</version>
  </parent>
  <artifactId>apache-rat-tasks</artifactId>
  <packaging>jar</packaging>
  <name>Apache Creadur RAT::Tasks4Ant</name>
  <description>
 A plugin for Apache Ant that runs Apache RAT
   to audit the source to be distributed.
  </description>
  <dependencies>
    <dependency>
      <groupId>org.apache.rat</groupId>
      <artifactId>apache-rat-core</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.rat</groupId>
      <artifactId>apache-rat-tools</artifactId>
    </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.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant-antunit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant-testutil</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <resources>
      <resource>
        <filtering>false</filtering>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <filtering>true</filtering>
        <directory>src/main/filtered-resources</directory>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-test-resources</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <stripVersion>true</stripVersion>
              <includeArtifactIds>ant-antunit</includeArtifactIds>
              <outputDirectory>${project.build.directory}/dependencies</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <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 BaseAntTask</id>
            <goals>
              <goal>java</goal>
            </goals>
            <phase>generate-sources</phase>
            <configuration>
              <classpathScope>test</classpathScope>
              <mainClass>org.apache.rat.tools.AntGenerator</mainClass>
              <arguments>
                <argument>org.apache.rat.anttasks</argument>
                <argument>BaseAntTask</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>
          <execution>
            <id>Ant documentation generation</id>
            <phase>pre-site</phase>
            <goals>
              <goal>java</goal>
            </goals>
            <configuration>
              <mainClass>org.apache.rat.tools.AntDocumentation</mainClass>
              <classpathScope>test</classpathScope>
              <arguments>
                <argument>${project.basedir}/src/site/apt/</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>test</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <skip>${skipTests}</skip>
              <target>
                <ant antfile="src/test/resources/antunit/report-bad-configurations.xml" inheritAll="false" inheritRefs="false">
                  <property name="jar.name" location="${project.build.outputDirectory}" />
                  <property name="base.dir" location="${basedir}" />
                  <property name="antunit.jar.name" location="${project.build.directory}/dependencies/ant-antunit.jar" />
                  <property name="test.skipped" value="${skipTests}" />
                  <property name="test.classpath" refid="maven.test.classpath" />
                </ant>
                <ant antfile="src/test/resources/antunit/report-normal-operation.xml" inheritAll="false" inheritRefs="false">
                  <property name="jar.name" location="${project.build.outputDirectory}" />
                  <property name="base.dir" location="${basedir}" />
                  <property name="antunit.jar.name" location="${project.build.directory}/dependencies/ant-antunit.jar" />
                  <property name="test.skipped" value="${maven.test.skip}" />
                  <property name="test.classpath" refid="maven.test.classpath" />
                </ant>
              </target>
            </configuration>
          </execution>
        </executions>
      </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>
      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
        <configuration>
          <excludeFilterFile>../src/conf/spotbugs-exclude.xml</excludeFilterFile>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
          <filesets>
            <fileset>
              <directory>src/main/java/org/apache/rat/anttasks</directory>
              <includes>
                <include>BaseAntTask.java</include>
              </includes>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.rat</groupId>
          <artifactId>apache-rat-plugin</artifactId>
          <configuration>
            <excludes>
              <!-- Generated by Eclipse, and not distributed, so ignorable. -->
              <exclude>bin/**/*</exclude>
              <exclude>.externalToolBuilders/**/*</exclude>
              <!-- These files do not have license headers -->
              <exclude>src/test/resources/</exclude>
              <exclude>src/site/apt/*.txt</exclude>
            </excludes>
          </configuration>
        </plugin>
        <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-dependency-plugin</artifactId>
                    <versionRange>[2.0,)</versionRange>
                    <goals>
                      <goal>copy-dependencies</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>
  </build>
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
    </plugins>
  </reporting>
</project>
